Jelajahi Sumber

Cleaned use of ws

Herbert Vojčík 9 tahun lalu
induk
melakukan
74fadd6750
2 mengubah file dengan 179 tambahan dan 256 penghapusan
  1. 172 248
      support/parser.js
  2. 7 8
      support/parser.pegjs

+ 172 - 248
support/parser.js

@@ -269,8 +269,7 @@ globals.SmalltalkParser = (function() {
                                  return message;
                              }
                          },
-        peg$c118 = function(pair) {return pair;},
-        peg$c119 = function(pairs) {
+        peg$c118 = function(pairs) {
                              var selector = [];
                              var args = [];
                               for(var i = 0; i < pairs.length; i++) {
@@ -283,13 +282,13 @@ globals.SmalltalkParser = (function() {
                                      ._selector_(selector.join(""))
                                      ._arguments_(args);
                          },
-        peg$c120 = function(receiver, tail) {
+        peg$c119 = function(receiver, tail) {
                              return tail._valueForReceiver_(receiver);
                          },
-        peg$c121 = ";",
-        peg$c122 = { type: "literal", value: ";", description: "\";\"" },
-        peg$c123 = function(mess) {return mess;},
-        peg$c124 = function(send, messages) {
+        peg$c120 = ";",
+        peg$c121 = { type: "literal", value: ";", description: "\";\"" },
+        peg$c122 = function(mess) {return mess;},
+        peg$c123 = function(send, messages) {
                              var cascade = [];
                              cascade.push(send);
                              for(var i = 0; i < messages.length; i++) {
@@ -301,21 +300,21 @@ globals.SmalltalkParser = (function() {
                                     ._receiver_(send._receiver())
                                     ._nodes_(cascade);
                          },
-        peg$c125 = "<",
-        peg$c126 = { type: "literal", value: "<", description: "\"<\"" },
-        peg$c127 = ">>",
-        peg$c128 = { type: "literal", value: ">>", description: "\">>\"" },
-        peg$c129 = function() {return ">";},
-        peg$c130 = /^[^>]/,
-        peg$c131 = { type: "class", value: "[^>]", description: "[^>]" },
-        peg$c132 = ">",
-        peg$c133 = { type: "literal", value: ">", description: "\">\"" },
-        peg$c134 = function(val) {
+        peg$c124 = "<",
+        peg$c125 = { type: "literal", value: "<", description: "\"<\"" },
+        peg$c126 = ">>",
+        peg$c127 = { type: "literal", value: ">>", description: "\">>\"" },
+        peg$c128 = function() {return ">";},
+        peg$c129 = /^[^>]/,
+        peg$c130 = { type: "class", value: "[^>]", description: "[^>]" },
+        peg$c131 = ">",
+        peg$c132 = { type: "literal", value: ">", description: "\">\"" },
+        peg$c133 = function(val) {
                              return globals.JSStatementNode._new()
                                     ._position_((line()).__at(column()))
                                     ._source_(val.join(""))
                          },
-        peg$c135 = function(pattern, sequence) {
+        peg$c134 = function(pattern, sequence) {
                               return globals.MethodNode._new()
                                      ._position_((line()).__at(column()))
                                      ._source_(text())
@@ -323,9 +322,9 @@ globals.SmalltalkParser = (function() {
                                      ._arguments_(pattern[1])
                                      ._nodes_([sequence]);
                          },
-        peg$c136 = function(send) { return send._selector() === "->" },
-        peg$c137 = function(send) { return [send._receiver(), send._arguments()[0]]; },
-        peg$c138 = function(first, others) { return first.concat.apply(first, others); },
+        peg$c135 = function(send) { return send._selector() === "->" },
+        peg$c136 = function(send) { return [send._receiver(), send._arguments()[0]]; },
+        peg$c137 = function(first, others) { return first.concat.apply(first, others); },
 
         peg$currPos          = 0,
         peg$reportedPos      = 0,
@@ -1535,7 +1534,7 @@ globals.SmalltalkParser = (function() {
     }
 
     function peg$parseliteralArrayRest() {
-      var s0, s1, s2, s3, s4, s5;
+      var s0, s1, s2, s3, s4;
 
       var key    = peg$currPos * 60 + 19,
           cached = peg$cache[key];
@@ -1546,10 +1545,10 @@ globals.SmalltalkParser = (function() {
       }
 
       s0 = peg$currPos;
-      s1 = peg$parsews();
-      if (s1 !== peg$FAILED) {
-        s2 = [];
-        s3 = peg$currPos;
+      s1 = [];
+      s2 = peg$currPos;
+      s3 = peg$parsews();
+      if (s3 !== peg$FAILED) {
         s4 = peg$parseparseTimeLiteral();
         if (s4 === peg$FAILED) {
           s4 = peg$parsebareLiteralArray();
@@ -1558,22 +1557,22 @@ globals.SmalltalkParser = (function() {
           }
         }
         if (s4 !== peg$FAILED) {
-          s5 = peg$parsews();
-          if (s5 !== peg$FAILED) {
-            peg$reportedPos = s3;
-            s4 = peg$c59(s4);
-            s3 = s4;
-          } else {
-            peg$currPos = s3;
-            s3 = peg$c1;
-          }
+          peg$reportedPos = s2;
+          s3 = peg$c59(s4);
+          s2 = s3;
         } else {
-          peg$currPos = s3;
-          s3 = peg$c1;
+          peg$currPos = s2;
+          s2 = peg$c1;
         }
-        while (s3 !== peg$FAILED) {
-          s2.push(s3);
-          s3 = peg$currPos;
+      } else {
+        peg$currPos = s2;
+        s2 = peg$c1;
+      }
+      while (s2 !== peg$FAILED) {
+        s1.push(s2);
+        s2 = peg$currPos;
+        s3 = peg$parsews();
+        if (s3 !== peg$FAILED) {
           s4 = peg$parseparseTimeLiteral();
           if (s4 === peg$FAILED) {
             s4 = peg$parsebareLiteralArray();
@@ -1582,38 +1581,32 @@ globals.SmalltalkParser = (function() {
             }
           }
           if (s4 !== peg$FAILED) {
-            s5 = peg$parsews();
-            if (s5 !== peg$FAILED) {
-              peg$reportedPos = s3;
-              s4 = peg$c59(s4);
-              s3 = s4;
-            } else {
-              peg$currPos = s3;
-              s3 = peg$c1;
-            }
+            peg$reportedPos = s2;
+            s3 = peg$c59(s4);
+            s2 = s3;
           } else {
-            peg$currPos = s3;
-            s3 = peg$c1;
+            peg$currPos = s2;
+            s2 = peg$c1;
           }
+        } else {
+          peg$currPos = s2;
+          s2 = peg$c1;
         }
+      }
+      if (s1 !== peg$FAILED) {
+        s2 = peg$parsews();
         if (s2 !== peg$FAILED) {
-          s3 = peg$parsews();
+          if (input.charCodeAt(peg$currPos) === 41) {
+            s3 = peg$c60;
+            peg$currPos++;
+          } else {
+            s3 = peg$FAILED;
+            if (peg$silentFails === 0) { peg$fail(peg$c61); }
+          }
           if (s3 !== peg$FAILED) {
-            if (input.charCodeAt(peg$currPos) === 41) {
-              s4 = peg$c60;
-              peg$currPos++;
-            } else {
-              s4 = peg$FAILED;
-              if (peg$silentFails === 0) { peg$fail(peg$c61); }
-            }
-            if (s4 !== peg$FAILED) {
-              peg$reportedPos = s0;
-              s1 = peg$c62(s2);
-              s0 = s1;
-            } else {
-              peg$currPos = s0;
-              s0 = peg$c1;
-            }
+            peg$reportedPos = s0;
+            s1 = peg$c62(s1);
+            s0 = s1;
           } else {
             peg$currPos = s0;
             s0 = peg$c1;
@@ -1959,16 +1952,16 @@ globals.SmalltalkParser = (function() {
       }
 
       s0 = peg$currPos;
-      s1 = peg$parsekeyword();
+      s1 = peg$parsews();
       if (s1 !== peg$FAILED) {
-        s2 = peg$parsews();
+        s2 = peg$parsekeyword();
         if (s2 !== peg$FAILED) {
-          s3 = peg$parsebinarySend();
+          s3 = peg$parsews();
           if (s3 !== peg$FAILED) {
-            s4 = peg$parsews();
+            s4 = peg$parsebinarySend();
             if (s4 !== peg$FAILED) {
               peg$reportedPos = s0;
-              s1 = peg$c82(s1, s3);
+              s1 = peg$c82(s2, s4);
               s0 = s1;
             } else {
               peg$currPos = s0;
@@ -2442,7 +2435,7 @@ globals.SmalltalkParser = (function() {
     }
 
     function peg$parsetemps() {
-      var s0, s1, s2, s3, s4, s5, s6;
+      var s0, s1, s2, s3, s4, s5;
 
       var key    = peg$currPos * 60 + 37,
           cached = peg$cache[key];
@@ -2467,15 +2460,9 @@ globals.SmalltalkParser = (function() {
         if (s4 !== peg$FAILED) {
           s5 = peg$parseidentifier();
           if (s5 !== peg$FAILED) {
-            s6 = peg$parsews();
-            if (s6 !== peg$FAILED) {
-              peg$reportedPos = s3;
-              s4 = peg$c99(s5);
-              s3 = s4;
-            } else {
-              peg$currPos = s3;
-              s3 = peg$c1;
-            }
+            peg$reportedPos = s3;
+            s4 = peg$c99(s5);
+            s3 = s4;
           } else {
             peg$currPos = s3;
             s3 = peg$c1;
@@ -2491,15 +2478,9 @@ globals.SmalltalkParser = (function() {
           if (s4 !== peg$FAILED) {
             s5 = peg$parseidentifier();
             if (s5 !== peg$FAILED) {
-              s6 = peg$parsews();
-              if (s6 !== peg$FAILED) {
-                peg$reportedPos = s3;
-                s4 = peg$c99(s5);
-                s3 = s4;
-              } else {
-                peg$currPos = s3;
-                s3 = peg$c1;
-              }
+              peg$reportedPos = s3;
+              s4 = peg$c99(s5);
+              s3 = s4;
             } else {
               peg$currPos = s3;
               s3 = peg$c1;
@@ -2510,17 +2491,23 @@ globals.SmalltalkParser = (function() {
           }
         }
         if (s2 !== peg$FAILED) {
-          if (input.charCodeAt(peg$currPos) === 124) {
-            s3 = peg$c97;
-            peg$currPos++;
-          } else {
-            s3 = peg$FAILED;
-            if (peg$silentFails === 0) { peg$fail(peg$c98); }
-          }
+          s3 = peg$parsews();
           if (s3 !== peg$FAILED) {
-            peg$reportedPos = s0;
-            s1 = peg$c100(s2);
-            s0 = s1;
+            if (input.charCodeAt(peg$currPos) === 124) {
+              s4 = peg$c97;
+              peg$currPos++;
+            } else {
+              s4 = peg$FAILED;
+              if (peg$silentFails === 0) { peg$fail(peg$c98); }
+            }
+            if (s4 !== peg$FAILED) {
+              peg$reportedPos = s0;
+              s1 = peg$c100(s2);
+              s0 = s1;
+            } else {
+              peg$currPos = s0;
+              s0 = peg$c1;
+            }
           } else {
             peg$currPos = s0;
             s0 = peg$c1;
@@ -2963,7 +2950,7 @@ globals.SmalltalkParser = (function() {
     }
 
     function peg$parseblock() {
-      var s0, s1, s2, s3, s4, s5, s6, s7;
+      var s0, s1, s2, s3, s4, s5, s6;
 
       var key    = peg$currPos * 60 + 43,
           cached = peg$cache[key];
@@ -2982,37 +2969,31 @@ globals.SmalltalkParser = (function() {
         if (peg$silentFails === 0) { peg$fail(peg$c108); }
       }
       if (s1 !== peg$FAILED) {
-        s2 = peg$parsews();
+        s2 = peg$parseblockParamList();
+        if (s2 === peg$FAILED) {
+          s2 = peg$c41;
+        }
         if (s2 !== peg$FAILED) {
-          s3 = peg$parseblockParamList();
-          if (s3 === peg$FAILED) {
-            s3 = peg$c41;
-          }
+          s3 = peg$parsews();
           if (s3 !== peg$FAILED) {
-            s4 = peg$parsews();
+            s4 = peg$parsesequence();
+            if (s4 === peg$FAILED) {
+              s4 = peg$c41;
+            }
             if (s4 !== peg$FAILED) {
-              s5 = peg$parsesequence();
-              if (s5 === peg$FAILED) {
-                s5 = peg$c41;
-              }
+              s5 = peg$parsews();
               if (s5 !== peg$FAILED) {
-                s6 = peg$parsews();
+                if (input.charCodeAt(peg$currPos) === 93) {
+                  s6 = peg$c109;
+                  peg$currPos++;
+                } else {
+                  s6 = peg$FAILED;
+                  if (peg$silentFails === 0) { peg$fail(peg$c110); }
+                }
                 if (s6 !== peg$FAILED) {
-                  if (input.charCodeAt(peg$currPos) === 93) {
-                    s7 = peg$c109;
-                    peg$currPos++;
-                  } else {
-                    s7 = peg$FAILED;
-                    if (peg$silentFails === 0) { peg$fail(peg$c110); }
-                  }
-                  if (s7 !== peg$FAILED) {
-                    peg$reportedPos = s0;
-                    s1 = peg$c111(s3, s5);
-                    s0 = s1;
-                  } else {
-                    peg$currPos = s0;
-                    s0 = peg$c1;
-                  }
+                  peg$reportedPos = s0;
+                  s1 = peg$c111(s2, s4);
+                  s0 = s1;
                 } else {
                   peg$currPos = s0;
                   s0 = peg$c1;
@@ -3332,7 +3313,7 @@ globals.SmalltalkParser = (function() {
     }
 
     function peg$parsekeywordMessage() {
-      var s0, s1, s2, s3, s4, s5;
+      var s0, s1, s2;
 
       var key    = peg$currPos * 60 + 51,
           cached = peg$cache[key];
@@ -3343,60 +3324,21 @@ globals.SmalltalkParser = (function() {
       }
 
       s0 = peg$currPos;
-      s1 = peg$parsews();
-      if (s1 !== peg$FAILED) {
-        s2 = [];
-        s3 = peg$currPos;
-        s4 = peg$parsekeywordPair();
-        if (s4 !== peg$FAILED) {
-          s5 = peg$parsews();
-          if (s5 !== peg$FAILED) {
-            peg$reportedPos = s3;
-            s4 = peg$c118(s4);
-            s3 = s4;
-          } else {
-            peg$currPos = s3;
-            s3 = peg$c1;
-          }
-        } else {
-          peg$currPos = s3;
-          s3 = peg$c1;
-        }
-        if (s3 !== peg$FAILED) {
-          while (s3 !== peg$FAILED) {
-            s2.push(s3);
-            s3 = peg$currPos;
-            s4 = peg$parsekeywordPair();
-            if (s4 !== peg$FAILED) {
-              s5 = peg$parsews();
-              if (s5 !== peg$FAILED) {
-                peg$reportedPos = s3;
-                s4 = peg$c118(s4);
-                s3 = s4;
-              } else {
-                peg$currPos = s3;
-                s3 = peg$c1;
-              }
-            } else {
-              peg$currPos = s3;
-              s3 = peg$c1;
-            }
-          }
-        } else {
-          s2 = peg$c1;
-        }
-        if (s2 !== peg$FAILED) {
-          peg$reportedPos = s0;
-          s1 = peg$c119(s2);
-          s0 = s1;
-        } else {
-          peg$currPos = s0;
-          s0 = peg$c1;
+      s1 = [];
+      s2 = peg$parsekeywordPair();
+      if (s2 !== peg$FAILED) {
+        while (s2 !== peg$FAILED) {
+          s1.push(s2);
+          s2 = peg$parsekeywordPair();
         }
       } else {
-        peg$currPos = s0;
-        s0 = peg$c1;
+        s1 = peg$c1;
+      }
+      if (s1 !== peg$FAILED) {
+        peg$reportedPos = s0;
+        s1 = peg$c118(s1);
       }
+      s0 = s1;
 
       peg$cache[key] = { nextPos: peg$currPos, result: s0 };
 
@@ -3420,7 +3362,7 @@ globals.SmalltalkParser = (function() {
         s2 = peg$parsekeywordMessage();
         if (s2 !== peg$FAILED) {
           peg$reportedPos = s0;
-          s1 = peg$c120(s1, s2);
+          s1 = peg$c119(s1, s2);
           s0 = s1;
         } else {
           peg$currPos = s0;
@@ -3461,7 +3403,7 @@ globals.SmalltalkParser = (function() {
     }
 
     function peg$parsecascade() {
-      var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9;
+      var s0, s1, s2, s3, s4, s5, s6, s7, s8;
 
       var key    = peg$currPos * 60 + 54,
           cached = peg$cache[key];
@@ -3484,26 +3426,20 @@ globals.SmalltalkParser = (function() {
           s5 = peg$parsews();
           if (s5 !== peg$FAILED) {
             if (input.charCodeAt(peg$currPos) === 59) {
-              s6 = peg$c121;
+              s6 = peg$c120;
               peg$currPos++;
             } else {
               s6 = peg$FAILED;
-              if (peg$silentFails === 0) { peg$fail(peg$c122); }
+              if (peg$silentFails === 0) { peg$fail(peg$c121); }
             }
             if (s6 !== peg$FAILED) {
               s7 = peg$parsews();
               if (s7 !== peg$FAILED) {
                 s8 = peg$parsemessage();
                 if (s8 !== peg$FAILED) {
-                  s9 = peg$parsews();
-                  if (s9 !== peg$FAILED) {
-                    peg$reportedPos = s4;
-                    s5 = peg$c123(s8);
-                    s4 = s5;
-                  } else {
-                    peg$currPos = s4;
-                    s4 = peg$c1;
-                  }
+                  peg$reportedPos = s4;
+                  s5 = peg$c122(s8);
+                  s4 = s5;
                 } else {
                   peg$currPos = s4;
                   s4 = peg$c1;
@@ -3527,26 +3463,20 @@ globals.SmalltalkParser = (function() {
               s5 = peg$parsews();
               if (s5 !== peg$FAILED) {
                 if (input.charCodeAt(peg$currPos) === 59) {
-                  s6 = peg$c121;
+                  s6 = peg$c120;
                   peg$currPos++;
                 } else {
                   s6 = peg$FAILED;
-                  if (peg$silentFails === 0) { peg$fail(peg$c122); }
+                  if (peg$silentFails === 0) { peg$fail(peg$c121); }
                 }
                 if (s6 !== peg$FAILED) {
                   s7 = peg$parsews();
                   if (s7 !== peg$FAILED) {
                     s8 = peg$parsemessage();
                     if (s8 !== peg$FAILED) {
-                      s9 = peg$parsews();
-                      if (s9 !== peg$FAILED) {
-                        peg$reportedPos = s4;
-                        s5 = peg$c123(s8);
-                        s4 = s5;
-                      } else {
-                        peg$currPos = s4;
-                        s4 = peg$c1;
-                      }
+                      peg$reportedPos = s4;
+                      s5 = peg$c122(s8);
+                      s4 = s5;
                     } else {
                       peg$currPos = s4;
                       s4 = peg$c1;
@@ -3569,7 +3499,7 @@ globals.SmalltalkParser = (function() {
           }
           if (s3 !== peg$FAILED) {
             peg$reportedPos = s0;
-            s1 = peg$c124(s2, s3);
+            s1 = peg$c123(s2, s3);
             s0 = s1;
           } else {
             peg$currPos = s0;
@@ -3602,72 +3532,72 @@ globals.SmalltalkParser = (function() {
 
       s0 = peg$currPos;
       if (input.charCodeAt(peg$currPos) === 60) {
-        s1 = peg$c125;
+        s1 = peg$c124;
         peg$currPos++;
       } else {
         s1 = peg$FAILED;
-        if (peg$silentFails === 0) { peg$fail(peg$c126); }
+        if (peg$silentFails === 0) { peg$fail(peg$c125); }
       }
       if (s1 !== peg$FAILED) {
         s2 = [];
         s3 = peg$currPos;
-        if (input.substr(peg$currPos, 2) === peg$c127) {
-          s4 = peg$c127;
+        if (input.substr(peg$currPos, 2) === peg$c126) {
+          s4 = peg$c126;
           peg$currPos += 2;
         } else {
           s4 = peg$FAILED;
-          if (peg$silentFails === 0) { peg$fail(peg$c128); }
+          if (peg$silentFails === 0) { peg$fail(peg$c127); }
         }
         if (s4 !== peg$FAILED) {
           peg$reportedPos = s3;
-          s4 = peg$c129();
+          s4 = peg$c128();
         }
         s3 = s4;
         if (s3 === peg$FAILED) {
-          if (peg$c130.test(input.charAt(peg$currPos))) {
+          if (peg$c129.test(input.charAt(peg$currPos))) {
             s3 = input.charAt(peg$currPos);
             peg$currPos++;
           } else {
             s3 = peg$FAILED;
-            if (peg$silentFails === 0) { peg$fail(peg$c131); }
+            if (peg$silentFails === 0) { peg$fail(peg$c130); }
           }
         }
         while (s3 !== peg$FAILED) {
           s2.push(s3);
           s3 = peg$currPos;
-          if (input.substr(peg$currPos, 2) === peg$c127) {
-            s4 = peg$c127;
+          if (input.substr(peg$currPos, 2) === peg$c126) {
+            s4 = peg$c126;
             peg$currPos += 2;
           } else {
             s4 = peg$FAILED;
-            if (peg$silentFails === 0) { peg$fail(peg$c128); }
+            if (peg$silentFails === 0) { peg$fail(peg$c127); }
           }
           if (s4 !== peg$FAILED) {
             peg$reportedPos = s3;
-            s4 = peg$c129();
+            s4 = peg$c128();
           }
           s3 = s4;
           if (s3 === peg$FAILED) {
-            if (peg$c130.test(input.charAt(peg$currPos))) {
+            if (peg$c129.test(input.charAt(peg$currPos))) {
               s3 = input.charAt(peg$currPos);
               peg$currPos++;
             } else {
               s3 = peg$FAILED;
-              if (peg$silentFails === 0) { peg$fail(peg$c131); }
+              if (peg$silentFails === 0) { peg$fail(peg$c130); }
             }
           }
         }
         if (s2 !== peg$FAILED) {
           if (input.charCodeAt(peg$currPos) === 62) {
-            s3 = peg$c132;
+            s3 = peg$c131;
             peg$currPos++;
           } else {
             s3 = peg$FAILED;
-            if (peg$silentFails === 0) { peg$fail(peg$c133); }
+            if (peg$silentFails === 0) { peg$fail(peg$c132); }
           }
           if (s3 !== peg$FAILED) {
             peg$reportedPos = s0;
-            s1 = peg$c134(s2);
+            s1 = peg$c133(s2);
             s0 = s1;
           } else {
             peg$currPos = s0;
@@ -3688,7 +3618,7 @@ globals.SmalltalkParser = (function() {
     }
 
     function peg$parsemethod() {
-      var s0, s1, s2, s3, s4, s5;
+      var s0, s1, s2, s3, s4;
 
       var key    = peg$currPos * 60 + 56,
           cached = peg$cache[key];
@@ -3699,32 +3629,26 @@ globals.SmalltalkParser = (function() {
       }
 
       s0 = peg$currPos;
-      s1 = peg$parsews();
-      if (s1 !== peg$FAILED) {
-        s2 = peg$parsekeywordPattern();
-        if (s2 === peg$FAILED) {
-          s2 = peg$parsebinaryPattern();
-          if (s2 === peg$FAILED) {
-            s2 = peg$parseunaryPattern();
-          }
+      s1 = peg$parsekeywordPattern();
+      if (s1 === peg$FAILED) {
+        s1 = peg$parsebinaryPattern();
+        if (s1 === peg$FAILED) {
+          s1 = peg$parseunaryPattern();
         }
+      }
+      if (s1 !== peg$FAILED) {
+        s2 = peg$parsews();
         if (s2 !== peg$FAILED) {
-          s3 = peg$parsews();
+          s3 = peg$parsesequence();
+          if (s3 === peg$FAILED) {
+            s3 = peg$c41;
+          }
           if (s3 !== peg$FAILED) {
-            s4 = peg$parsesequence();
-            if (s4 === peg$FAILED) {
-              s4 = peg$c41;
-            }
+            s4 = peg$parsews();
             if (s4 !== peg$FAILED) {
-              s5 = peg$parsews();
-              if (s5 !== peg$FAILED) {
-                peg$reportedPos = s0;
-                s1 = peg$c135(s2, s4);
-                s0 = s1;
-              } else {
-                peg$currPos = s0;
-                s0 = peg$c1;
-              }
+              peg$reportedPos = s0;
+              s1 = peg$c134(s1, s3);
+              s0 = s1;
             } else {
               peg$currPos = s0;
               s0 = peg$c1;
@@ -3762,7 +3686,7 @@ globals.SmalltalkParser = (function() {
       s1 = peg$parsebinarySend();
       if (s1 !== peg$FAILED) {
         peg$reportedPos = peg$currPos;
-        s2 = peg$c136(s1);
+        s2 = peg$c135(s1);
         if (s2) {
           s2 = peg$c112;
         } else {
@@ -3770,7 +3694,7 @@ globals.SmalltalkParser = (function() {
         }
         if (s2 !== peg$FAILED) {
           peg$reportedPos = s0;
-          s1 = peg$c137(s1);
+          s1 = peg$c136(s1);
           s0 = s1;
         } else {
           peg$currPos = s0;
@@ -3859,7 +3783,7 @@ globals.SmalltalkParser = (function() {
         }
         if (s2 !== peg$FAILED) {
           peg$reportedPos = s0;
-          s1 = peg$c138(s1, s2);
+          s1 = peg$c137(s1, s2);
           s0 = s1;
         } else {
           peg$currPos = s0;

+ 7 - 8
support/parser.pegjs

@@ -41,7 +41,7 @@ integer        = neg:"-"?digits:[0-9]+ {return (parseInt((neg || '') +digits.joi
 
 literalArray   = "#(" rest:literalArrayRest {return rest;}
 bareLiteralArray   = "(" rest:literalArrayRest {return rest;}
-literalArrayRest   = ws lits:(lit:(parseTimeLiteral / bareLiteralArray / bareSymbol) ws {return lit._value();})* ws ")" {
+literalArrayRest   = lits:(ws lit:(parseTimeLiteral / bareLiteralArray / bareSymbol) {return lit._value();})* ws ")" {
                      return globals.ValueNode._new()
                             ._position_((line()).__at(column()))
                             ._source_(text())
@@ -82,7 +82,7 @@ variable       = identifier:identifier {
 
 reference      = variable
 
-keywordPair    = key:keyword ws arg:binarySend ws {return {key:key, arg: arg};}
+keywordPair    = ws key:keyword ws arg:binarySend {return {key:key, arg: arg};}
 
 binarySelector = bin:[\\+*/=><,@%~|&-]+ {return bin.join("");}
 unarySelector  = identifier
@@ -122,7 +122,7 @@ ret            = '^' ws expression:expression ws '.'? {
                             ._nodes_([expression]);
                  }
   
-temps          = "|" vars:(ws variable:identifier ws {return variable;})* "|" {return vars;}
+temps          = "|" vars:(ws variable:identifier {return variable;})* ws "|" {return vars;}
 
 blockParamList = params:((ws ":" ws param:identifier {return param;})+) ws "|" {return params;}
 
@@ -150,7 +150,7 @@ stSequence     = temps:temps? ws statements:statements? ws {
 
 jsSequence     = jsStatement
 
-block          = '[' ws params:blockParamList? ws sequence:sequence? ws ']' {
+block          = '[' params:blockParamList? ws sequence:sequence? ws ']' {
                      return globals.BlockNode._new()
                             ._position_((line()).__at(column()))
                             ._source_(text())
@@ -214,7 +214,7 @@ binarySend     = receiver:unarySend tail:binaryTail? {
                  }
 
 
-keywordMessage = ws pairs:(pair:keywordPair ws {return pair;})+ {
+keywordMessage = pairs:keywordPair+ {
                      var selector = [];
                      var args = [];
                       for(var i = 0; i < pairs.length; i++) {
@@ -234,7 +234,7 @@ keywordSend    = receiver:binarySend tail:keywordMessage {
 
 message        = binaryMessage / unaryMessage / keywordMessage
 
-cascade        = ws send:(keywordSend / binarySend) messages:(ws ";" ws mess:message ws {return mess;})+ {
+cascade        = ws send:(keywordSend / binarySend) messages:(ws ";" ws mess:message {return mess;})+ {
                      var cascade = [];
                      cascade.push(send);
                      for(var i = 0; i < messages.length; i++) {
@@ -254,7 +254,7 @@ jsStatement    = "<" val:((">>" {return ">";} / [^>])*) ">" {
                  }
 
 
-method         = ws pattern:(keywordPattern / binaryPattern / unaryPattern) ws sequence:sequence? ws {
+method         = pattern:(keywordPattern / binaryPattern / unaryPattern) ws sequence:sequence? ws {
                       return globals.MethodNode._new()
                              ._position_((line()).__at(column()))
                              ._source_(text())
@@ -268,4 +268,3 @@ associationSend     = send:binarySend & { return send._selector() === "->" } { r
 
 associationList = ws "." ws expression:associationSend {return expression;}
 associations    = first:associationSend others:associationList* { return first.concat.apply(first, others); }
-