AF3 compiler compiles also invalid expressions
test.org.fortiss.af3.expression.compiler.CompilerTest contains a test that fails
The compiler compiles: "aVar aFunCall() & anotherVar anotherFunCall()" even if it shouldn't.
#1 Updated by Anonymous almost 8 years ago
- Status changed from New to Resolved
- Assignee changed from Anonymous to Anonymous
- % Done changed from 0 to 90
The problem is caused by lexer and parser.
First the lexer doesn't recognize the "&" token, so the parser only sees
aVar == aFunCall() anotherVar == anotherFunCall()
Second the parser tries to match the string with rule "term EOF", which causes a missing token error. This error is however not thrown by parser.
I modified the compileTerm() method to recognize the second case. The first case must be further investigated.