[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.

Fixed operators in AST not being stackable + Cleanup

KH (Jun 8, 2017, 3:59 PM +0200) 8cf7390d 5944fc46

+2 -30
+1 -29
js/limp.js
··· 1 1 "use strict"; 2 - // var limpErrors = { 3 - // "u01": "Invalid JavaScript data type passed to limp(). Expected string." 4 - // } 5 2 6 3 function limpLog(type, msg) { 7 4 if (typeof msg == "object") msg = JSON.stringify(msg, null, 4); ··· 19 16 // console.log("[limp] "+msg); 20 17 } 21 18 } 22 - 23 - 24 - 25 - // 3*x+y 26 - var astttttt = [ 27 - { 28 - type: "binexp", 29 - operator: "+", 30 - left: { 31 - type: "binexp", 32 - operator: "*", 33 - left: { 34 - type: "num", 35 - value: 3 36 - }, 37 - right: { 38 - type: "var", 39 - value: "x" 40 - } 41 - }, 42 - right: { 43 - type: "var", 44 - value: "y" 45 - } 46 - } 47 - ]; 48 19 49 20 function limp(input) { 50 21 var pos = 0, line = 1, col = 1; // statement ··· 262 233 token.left = ast[si][ti-1]; 263 234 token.right = ast[si][ti+1]; 264 235 ast[si].splice(ti-1, 3, token); 236 + ti--; 265 237 } 266 238 } 267 239 }
+1 -1
js/script.limp
··· 1 1 limp(` 2 - 1+2; 2 + 1+2-2-5-6; 3 3 `);