Allow decimal number values

Fixes #472
This commit is contained in:
kpdecker
2014-01-17 20:42:02 -06:00
parent 051618c024
commit d4cfe90959
9 changed files with 42 additions and 23 deletions
+4 -4
View File
@@ -201,12 +201,12 @@ var AST = {
this.stringModeValue = string;
},
IntegerNode: function(integer, locInfo) {
NumberNode: function(number, locInfo) {
LocationInfo.call(this, locInfo);
this.type = "INTEGER";
this.type = "NUMBER";
this.original =
this.integer = integer;
this.stringModeValue = Number(integer);
this.number = number;
this.stringModeValue = Number(number);
},
BooleanNode: function(bool, locInfo) {
+2 -2
View File
@@ -321,8 +321,8 @@ Compiler.prototype = {
this.opcode('pushString', string.string);
},
INTEGER: function(integer) {
this.opcode('pushLiteral', integer.integer);
NUMBER: function(number) {
this.opcode('pushLiteral', number.number);
},
BOOLEAN: function(bool) {
+2 -2
View File
@@ -108,8 +108,8 @@ PrintVisitor.prototype.STRING = function(string) {
return '"' + string.string + '"';
};
PrintVisitor.prototype.INTEGER = function(integer) {
return "INTEGER{" + integer.integer + "}";
PrintVisitor.prototype.NUMBER = function(number) {
return "NUMBER{" + number.number + "}";
};
PrintVisitor.prototype.BOOLEAN = function(bool) {