jido commented on code in PR #106:
URL: https://github.com/apache/freemarker/pull/106#discussion_r1488333855
##########
freemarker-core/src/main/javacc/freemarker/core/FTL.jj:
##########
@@ -3892,18 +3895,50 @@ SwitchBlock Switch() :
}
[
(
- 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);
- }
- )+
+ (
+ 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);
+ }
+ )+
+ |
+ (
+ {
+ // A Switch with Case supports break, but not one with On.
+ // Do it this way to ensure backwards compatibility.
+ breakableDirectiveNesting--;
Review Comment:
Will that also work when switch-case is nested inside switch-on?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]