Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion velocity-custom-parser-example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
<debugParser>${parser.debug}</debugParser>
<debugLookAhead>${parser.debug}</debugLookAhead>
<debugTokenManager>${parser.debug}</debugTokenManager>
<jdkVersion>${maven.compiler.target}</jdkVersion>
<jdkVersion>1.8</jdkVersion>
<nodeUsesParser>true</nodeUsesParser>
<nodePackage>${parser.package}.node</nodePackage>
<sourceDirectory>${project.build.directory}/parser/org/apache/velocity/runtime/parser</sourceDirectory>
Expand Down
12 changes: 6 additions & 6 deletions velocity-engine-core/src/main/parser/Parser.jjt
Original file line number Diff line number Diff line change
Expand Up @@ -1576,7 +1576,7 @@ boolean Statement(boolean afterNewline) #void :
| LOOKAHEAD( { getToken(1).kind == WORD || getToken(1).kind == BRACKETED_WORD || afterNewline && getToken(1).kind == WHITESPACE && ( getToken(2).kind == WORD || getToken(2).kind == BRACKETED_WORD ) } ) afterNewline = Directive(afterNewline) { return afterNewline; }
| afterNewline = Text() { return afterNewline; }
| (<NEWLINE>) #Text { return true; }
| (((<INLINE_TEXT>) { afterNewline = false; } ) ((<TEXT>) { afterNewline = true; })? ) #Text { return afterNewline; }
| (((<INLINE_TEXT>) { afterNewline = false; } ) (LOOKAHEAD(2) (<TEXT>) { afterNewline = true; })? ) #Text { return afterNewline; }
| (<WHITESPACE>) #Text { return false; }
| (<SUFFIX>) #Text { return true; }
| LOOKAHEAD(2) EndingZeroWidthWhitespace() { return afterNewline; }
Expand Down Expand Up @@ -2113,11 +2113,11 @@ void IntegerRange() : {}
*/
void IndexParameter() #void: {}
{
(<WHITESPACE>|<NEWLINE>)*
(LOOKAHEAD(2) (<WHITESPACE>|<NEWLINE>))*
(
Expression()
)
(<WHITESPACE>|<NEWLINE>)*
(LOOKAHEAD(2) (<WHITESPACE>|<NEWLINE>))*
}


Expand Down Expand Up @@ -2493,7 +2493,7 @@ void MultiplicativeExpression() #void : {}

void UnaryExpression() #void : {}
{
( <WHITESPACE> | <NEWLINE> )*
(LOOKAHEAD(2) (<WHITESPACE> | <NEWLINE>))*
(
<LOGICAL_NOT> UnaryExpression() #NotNode(1)
| <MINUS> PrimaryExpression() #NegateNode(1)
Expand All @@ -2503,7 +2503,7 @@ void UnaryExpression() #void : {}

void PrimaryExpression() #void : {}
{
( <WHITESPACE> | <NEWLINE> )*
(LOOKAHEAD(2) (<WHITESPACE> | <NEWLINE>))*
(
StringLiteral()
| Reference()
Expand All @@ -2516,7 +2516,7 @@ void PrimaryExpression() #void : {}
| False()
| <LPAREN> Expression() <RPAREN>
)
( <WHITESPACE> | <NEWLINE> )*
(LOOKAHEAD(2) (<WHITESPACE> | <NEWLINE>))*
}

/* ======================================================================
Expand Down