@@ -40,22 +40,24 @@ public EndOfStatementResult consumeEndOfStatement() throws AnalysisException {
4040 state = InlineProcessorState .EXPECTING_ELSE_CLAUSE ;
4141 return EndOfStatementResult .CONSUMED ;
4242 }
43- final var nextElement = ctx .lexicalAnalyzer .peek ();
44-
45- // handle multiple statements separated with colon
46- if (nextElement !=null && nextElement .getLexeme ().equals (":" )) {
47- ctx .lexicalAnalyzer .get ();
48- return EndOfStatementResult .CONSUMED ;
49- }
5043
51- if (! nextElement . isLineTerminator () && ! nextElement . getLexeme (). equals ( "'" )
52- && state == InlineProcessorState . EXPECTING_THEN_CLAUSE ) {
53- // only else statement is allowed
54- if (nextElement .isSymbol ( ScriptBasicKeyWords . KEYWORD_ELSE )) {
55- state = InlineProcessorState . EXPECTING_ELSE ;
44+ final var nextElement = ctx . lexicalAnalyzer . peek ();
45+ if ( nextElement != null ) {
46+ // handle multiple statements separated with colon
47+ if (nextElement .getLexeme (). equals ( ":" )) {
48+ ctx . lexicalAnalyzer . get () ;
5649 return EndOfStatementResult .CONSUMED ;
57- }
58- throw new BasicSyntaxException ("Unexpexted element: " +nextElement .getLexeme ());
50+ }
51+
52+ if (!nextElement .isLineTerminator () && !nextElement .getLexeme ().equals ("'" )
53+ && state == InlineProcessorState .EXPECTING_THEN_CLAUSE ) {
54+ // only else statement is allowed
55+ if (nextElement .isSymbol (ScriptBasicKeyWords .KEYWORD_ELSE )) {
56+ state = InlineProcessorState .EXPECTING_ELSE ;
57+ return EndOfStatementResult .CONSUMED ;
58+ }
59+ throw new BasicSyntaxException ("Unexpexted element: " + nextElement .getLexeme ());
60+ }
5961 }
6062
6163 state = InlineProcessorState .CLAUSE_DEFINED ;
0 commit comments