[READ-ONLY] Mirror of https://github.com/probablykasper/limp. Programming language made in JS, for fun (unfinished) limp.kasper.space
language
0

Configure Feed

Select the types of activity you want to include in your feed.

Simplified stuff

KH (May 28, 2017, 10:37 PM +0200) a958a62c b163547d

+9 -10
+8 -9
js/limp.js
··· 58 58 case "operator": 59 59 switch (currentWord) { 60 60 case "+": 61 - limpLog("inf", words[wordIndex-1]+words[wordIndex+1]); 62 - break; 63 61 case "-": 64 - limpLog("inf", words[wordIndex-1]-words[wordIndex+1]); 65 - break; 66 62 case "*": 67 - limpLog("inf", words[wordIndex-1]*words[wordIndex+1]); 68 - break; 69 63 case "/": 70 - limpLog("inf", words[wordIndex-1]/words[wordIndex+1]); 71 - break; 72 64 case "%": 73 - limpLog("inf", words[wordIndex-1]%words[wordIndex+1]); 65 + if ( wordType(words[wordIndex-1]) == "number" && wordType(words[wordIndex+1]) == "number" ) { 66 + limpLog("inf", eval(words[wordIndex-1]+currentWord+words[wordIndex+1])); 67 + } else { 68 + limpLog("err", "not number"); 69 + } 74 70 break; 75 71 case "++": 76 72 limpLog("inf", words[wordIndex-1]+1); ··· 79 75 limpLog("inf", words[wordIndex-1]-1); 80 76 break; 81 77 } 78 + break; 79 + case "variable": 80 + // do code... 82 81 break; 83 82 case "instruction": 84 83 // do code...
+1 -1
js/script.limp
··· 1 1 limp(` 2 - 1 * 2 $var 2 + 2 + 2 3 3 `);