krl-compiler
Advanced tools
Comparing version 0.10.0 to 0.10.1
{ | ||
"name": "krl-compiler", | ||
"version": "0.10.0", | ||
"version": "0.10.1", | ||
"description": "KRL compiler", | ||
@@ -45,3 +45,3 @@ "main": "src/index.js", | ||
"estree-loc": "^1.0.1", | ||
"krl-parser": "0.10.0", | ||
"krl-parser": "0.11.0", | ||
"lodash": "^4.13.1", | ||
@@ -48,0 +48,0 @@ "minimist": "^1.2.0", |
@@ -15,5 +15,13 @@ var _ = require('lodash'); | ||
'Number': function(ast, comp, e){ | ||
if(ast.value < 0){ | ||
return e('-', e('number', -ast.value)); | ||
} | ||
return e('number', ast.value); | ||
}, | ||
'Identifier': function(ast, comp, e){ | ||
if(ast.value === 'null'){ | ||
//undefined is the true "null" in javascript | ||
//however, undefined can be re-assigned. So `void 0` returns undefined but can't be re-assigned | ||
return e('void', e('number', 0)); | ||
} | ||
return e('call', e('id', 'ctx.scope.get'), [e('str', ast.value)]); | ||
@@ -78,2 +86,5 @@ }, | ||
}, | ||
'Array': function(ast, comp, e){ | ||
return e('array', comp(ast.value)); | ||
}, | ||
'Map': function(ast, comp, e){ | ||
@@ -80,0 +91,0 @@ return e('obj-raw', comp(ast.value)); |
18311
509
6
+ Addedkrl-parser@0.11.0(transitive)
- Removedkrl-parser@0.10.0(transitive)
Updatedkrl-parser@0.11.0