1
0
Bläddra i källkod

Merge branch 'master' into ast-interpreter

Conflicts:
	js/parser.js
Nicolas Petton 12 år sedan
förälder
incheckning
652e3292e3
2 ändrade filer med 5 tillägg och 5 borttagningar
  1. 4 4
      js/parser.js
  2. 1 1
      js/parser.pegjs

+ 4 - 4
js/parser.js

@@ -975,26 +975,26 @@ smalltalk.parser = (function(){
             }
           }
           if (result1 !== null) {
-            if (/^[0-9a-zA-Z]/.test(input.charAt(pos.offset))) {
+            if (/^[0-9a-fA-F]/.test(input.charAt(pos.offset))) {
               result3 = input.charAt(pos.offset);
               advance(pos, 1);
             } else {
               result3 = null;
               if (reportFailures === 0) {
-                matchFailed("[0-9a-zA-Z]");
+                matchFailed("[0-9a-fA-F]");
               }
             }
             if (result3 !== null) {
               result2 = [];
               while (result3 !== null) {
                 result2.push(result3);
-                if (/^[0-9a-zA-Z]/.test(input.charAt(pos.offset))) {
+                if (/^[0-9a-fA-F]/.test(input.charAt(pos.offset))) {
                   result3 = input.charAt(pos.offset);
                   advance(pos, 1);
                 } else {
                   result3 = null;
                   if (reportFailures === 0) {
-                    matchFailed("[0-9a-zA-Z]");
+                    matchFailed("[0-9a-fA-F]");
                   }
                 }
               }

+ 1 - 1
js/parser.pegjs

@@ -23,7 +23,7 @@ number         = n:(hex / float / integer) {
                      return smalltalk.ValueNode._new()
                             ._value_(n)
                  }
-hex            = neg:[-]? "16r" num:[0-9a-zA-Z]+ {return parseInt((neg + num.join("")), 16)}
+hex            = neg:[-]? "16r" num:[0-9a-fA-F]+ {return parseInt((neg + num.join("")), 16)}
 float          = neg:[-]?int:[0-9]+ "." dec:[0-9]+ {return parseFloat((neg + int.join("") + "." + dec.join("")), 10)}
 integer        = neg:[-]?digits:[0-9]+ {return (parseInt(neg+digits.join(""), 10))}
 literalArray   = "#(" ws lits:(lit:literal ws {return lit._value()})* ws ")" {