瀏覽代碼

Fixed previous commit

Nicolas Petton 12 年之前
父節點
當前提交
72deeefb0a
共有 2 個文件被更改,包括 5 次插入5 次删除
  1. 4 4
      js/parser.js
  2. 1 1
      js/parser.pegjs

+ 4 - 4
js/parser.js

@@ -1474,26 +1474,26 @@ smalltalk.parser = (function(){
         
         
         var savedPos0 = pos;
-        if (input.substr(pos).match(/^[+*\/=><,@%~|&-\\]/) !== null) {
+        if (input.substr(pos).match(/^[\\+*\/=><,@%~|&\-]/) !== null) {
           var result3 = input.charAt(pos);
           pos++;
         } else {
           var result3 = null;
           if (reportMatchFailures) {
-            matchFailed("[+*\\/=><,@%~|&-\\\\]");
+            matchFailed("[\\\\+*\\/=><,@%~|&\\-]");
           }
         }
         if (result3 !== null) {
           var result1 = [];
           while (result3 !== null) {
             result1.push(result3);
-            if (input.substr(pos).match(/^[+*\/=><,@%~|&-\\]/) !== null) {
+            if (input.substr(pos).match(/^[\\+*\/=><,@%~|&\-]/) !== null) {
               var result3 = input.charAt(pos);
               pos++;
             } else {
               var result3 = null;
               if (reportMatchFailures) {
-                matchFailed("[+*\\/=><,@%~|&-\\\\]");
+                matchFailed("[\\\\+*\\/=><,@%~|&\\-]");
               }
             }
           }

+ 1 - 1
js/parser.pegjs

@@ -49,7 +49,7 @@ reference      = variable / classReference
 
 keywordPair    = key:keyword ws arg:binarySend ws {return {key:key, arg: arg}}
 
-binarySelector = bin:[+*/=><,@%~|&-\\]+ {return bin.join("").replace(/\\/g, '\\\\')}
+binarySelector = bin:[\\+*/=><,@%~|&-]+ {return bin.join("").replace(/\\/g, '\\\\')}
 unarySelector  = identifier
 
 keywordPattern = pairs:(ws key:keyword ws arg:identifier {return {key:key, arg: arg}})+ {