Browse Source

parser: remove ? for statement sequence

Herbert Vojčík 7 years ago
parent
commit
07c7c46433
2 changed files with 2 additions and 8 deletions
  1. 0 6
      support/parser.js
  2. 2 2
      support/parser.pegjs

+ 0 - 6
support/parser.js

@@ -3003,9 +3003,6 @@ $globals.SmalltalkParser = (function() {
         }
         if (s2 !== peg$FAILED) {
           s3 = peg$parsewsSequenceWs();
-          if (s3 === peg$FAILED) {
-            s3 = null;
-          }
           if (s3 !== peg$FAILED) {
             if (input.charCodeAt(peg$currPos) === 93) {
               s4 = peg$c100;
@@ -3740,9 +3737,6 @@ $globals.SmalltalkParser = (function() {
       }
       if (s1 !== peg$FAILED) {
         s2 = peg$parsewsSequenceWs();
-        if (s2 === peg$FAILED) {
-          s2 = null;
-        }
         if (s2 !== peg$FAILED) {
           peg$savedPos = s0;
           s1 = peg$c127(s1, s2);

+ 2 - 2
support/parser.pegjs

@@ -200,7 +200,7 @@ wsStSequenceWs = ws temps:temps? statements:wsStatementsWs? {
 
 jsSequence = jsStatement
 
-block = '[' params:wsBlockParamList? sequence:wsSequenceWs? ']' {
+block = '[' params:wsBlockParamList? sequence:wsSequenceWs ']' {
 	return $globals.BlockNode._new()
 		._location_(location())
 		._source_(text())
@@ -283,7 +283,7 @@ pragmaJsStatement = '<' ws 'inlineJS:' ws val:rawString ws '>' {
 
 method =
 	pattern:(wsKeywordPattern / wsBinaryPattern / wsUnaryPattern)
-	sequence:wsSequenceWs? {
+	sequence:wsSequenceWs {
 		return $globals.MethodNode._new()
 			._location_(location())
 			._source_(text())