Approved by QA!
On Tue, Feb 15, 2011 at 12:36 PM, André Bargull wrote:
Change bargull-20110215-h9A by bargull@Bargull02 on 2011-02-15
18:23:36
in /home/anba/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Reduce lookahead complexity to provide better context for
invalid scripts
Bugs Fixed: LPP-9752 (Cryptic compiler error: Expected ';' but got
'class' at line 2, column 30), LPP-9631 (compiler does not report
error for class declarations in statements)
Technical Reviewer: ptw
QA Reviewer: promanik
Details:
Directive(), StatementList() and ClassDirective() used rather complex
syntactic lookaheads requiring the parser to try to parse the next
token sequence as ModifiedDefinition() (and so forth) at once instead
of testing only a few tokens. This led to confusing errors for users,
because the actual error context may be lost during the lookahead. The
change simply reduces the lookahead complexity by requiring less
tokens for the parser to read to decide how to parse the input.
Tests:
see test cases from bug reports
Files:
M WEB-INF/lps/server/sc/src/org/openlaszlo/sc/Parser.jjt
Changeset:
http://svn.openlaszlo.org/openlaszlo/patches/bargull-20110215-h9A.tar