freemarker-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ddek...@apache.org
Subject incubator-freemarker git commit: (Switch parsing cleanup)
Date Mon, 24 Jul 2017 17:50:46 GMT
Repository: incubator-freemarker
Updated Branches:
  refs/heads/2.3-gae 507ba1f4b -> 3b0340661


(Switch parsing cleanup)


Project: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/commit/3b034066
Tree: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/tree/3b034066
Diff: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/diff/3b034066

Branch: refs/heads/2.3-gae
Commit: 3b0340661d218a77e2422aed1a73bec1e09b8292
Parents: 507ba1f
Author: ddekany <ddekany@apache.org>
Authored: Mon Jul 24 19:50:34 2017 +0200
Committer: ddekany <ddekany@apache.org>
Committed: Mon Jul 24 19:50:34 2017 +0200

----------------------------------------------------------------------
 src/main/javacc/FTL.jj | 31 ++++++++++++++++---------------
 1 file changed, 16 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/3b034066/src/main/javacc/FTL.jj
----------------------------------------------------------------------
diff --git a/src/main/javacc/FTL.jj b/src/main/javacc/FTL.jj
index 385bbea..6bd358e 100644
--- a/src/main/javacc/FTL.jj
+++ b/src/main/javacc/FTL.jj
@@ -3601,21 +3601,22 @@ SwitchBlock Switch() :
         breakableDirectiveNesting++;
         switchBlock = new SwitchBlock(switchExp, ignoredSectionBeforeFirstCase);
     }
-    (
-        LOOKAHEAD(2)
-        caseIns = Case()
-        {
-            if (caseIns.condition == null) {
-                if (defaultFound) {
-                    throw new ParseException(
-                    "You can only have one default case in a switch statement", template,
start);
-                }
-                defaultFound = true;
-            }
-            switchBlock.addCase(caseIns);
-        }
-    )*
-    [<STATIC_TEXT_WS>]
+    [
+	    (
+	        caseIns = Case()
+	        {
+	            if (caseIns.condition == null) {
+	                if (defaultFound) {
+	                    throw new ParseException(
+	                    "You can only have one default case in a switch statement", template,
start);
+	                }
+	                defaultFound = true;
+	            }
+	            switchBlock.addCase(caseIns);
+	        }
+	    )+
+	    [<STATIC_TEXT_WS>]
+    ]
     end = <END_SWITCH>
     {
         breakableDirectiveNesting--;


Mime
View raw message