aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaude Brisson <cbrisson@apache.org>2019-12-12 19:59:11 +0000
committerClaude Brisson <cbrisson@apache.org>2019-12-12 19:59:11 +0000
commitd97b65d981348036e13904fd18c32ff2facbe854 (patch)
treedb7b970346374f2c25659e56f90e5bf6ec909b3d
parent61cda43e27f4ccc75887634106be8f33fb441f2a (diff)
downloadapache-velocity-engine-d97b65d981348036e13904fd18c32ff2facbe854.tar.gz
[engine][VELOCITY-923] Fix parser regression
git-svn-id: https://svn.apache.org/repos/asf/velocity/engine/trunk@1871284 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--velocity-engine-core/src/main/parser/Parser.jjt2
1 files changed, 2 insertions, 0 deletions
diff --git a/velocity-engine-core/src/main/parser/Parser.jjt b/velocity-engine-core/src/main/parser/Parser.jjt
index 16a1dae7..0b7e3f50 100644
--- a/velocity-engine-core/src/main/parser/Parser.jjt
+++ b/velocity-engine-core/src/main/parser/Parser.jjt
@@ -771,6 +771,7 @@ TOKEN:
switchTo(REFINDEX);
}
|
+ /* we need to give precedence to the logical 'or' here, it's a hack to avoid multiplying parsing modes */
<LOGICAL_OR_2: "||">
{
stateStackPop();
@@ -1574,6 +1575,7 @@ boolean Statement(boolean afterNewline) #void :
| (<WHITESPACE>) #Text { return false; }
| (<SUFFIX>) #Text { return true; }
| LOOKAHEAD(2) EndingZeroWidthWhitespace() { return afterNewline; }
+| (<LOGICAL_OR_2>) #Text { return afterNewline; } // needed here since it can be triggered in <REFERENCE> mode out of any boolean evaluation
| (<ZERO_WIDTH_WHITESPACE>) #Text { afterNewline = !afterNewline; return false; }
}