velocity-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cbris...@apache.org
Subject svn commit: r1871284 - /velocity/engine/trunk/velocity-engine-core/src/main/parser/Parser.jjt
Date Thu, 12 Dec 2019 19:59:12 GMT
Author: cbrisson
Date: Thu Dec 12 19:59:11 2019
New Revision: 1871284

URL: http://svn.apache.org/viewvc?rev=1871284&view=rev
Log:
[engine][VELOCITY-923] Fix parser regression

Modified:
    velocity/engine/trunk/velocity-engine-core/src/main/parser/Parser.jjt

Modified: velocity/engine/trunk/velocity-engine-core/src/main/parser/Parser.jjt
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/velocity-engine-core/src/main/parser/Parser.jjt?rev=1871284&r1=1871283&r2=1871284&view=diff
==============================================================================
--- velocity/engine/trunk/velocity-engine-core/src/main/parser/Parser.jjt (original)
+++ velocity/engine/trunk/velocity-engine-core/src/main/parser/Parser.jjt Thu Dec 12 19:59:11
2019
@@ -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)
 |   (<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; }
 }
 



Mime
View raw message