|
|
|
r7402 | ptw | 2007-11-28 11:10:45 -0500 (Wed, 28 Nov 2007) | 38 lines
Changed paths: M /openlaszlo/trunk/WEB-INF/lps/server/sc/src/org/openlaszlo/sc/Parser.jjt M /openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/sc/ASTVisitor.java M /openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/sc/CodeGenerator.java M /openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/sc/CommonGenerator.java M /openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/sc/Compiler.java M /openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/sc/JavascriptGenerator.java Change 20071127-ptw-C by ptw@dueling-banjos.local on 2007-11-27 16:41:07 EST in /Users/ptw/OpenLaszlo/ringding-2 for http://svn.openlaszlo.org/openlaszlo/trunk Summary: Correct handling of comma-separated var expressions Bugs Fixed: Technical Reviewer: dda@ddanderson.com (Message-Id: <6C1DA5CA-369A-4F4A-AE69-4428513AAACB@ddanderson.com>) QA Reviewer: hminsky (pending) Details: JavascriptGenerator: Handle variableStatement, consolidate isExpression CommonGenerator: Handle new AST type VariableDeclarationList, mov base isExpression here ASTVisitor: Add interfaces for VariableDeclaration and VariableDeclarationList Compiler: A VariableStatement cannot be handled as a Statement. Implement correct unparsing of VariableStatement, VariableDeclarationList, and VariableDeclaration. CodeGenerator: consolidate isExpression Parser: Parse comma-separated variable declarations into new AST VariableDeclarationList Tests: smokecheck observed that test case in bug report is correctly passed through for dhtml (pagan-deities build r7956 - from legals -> trunk -> pagan-deities)
Successfully ran test/smoke/smokecheck.lzx in swf/dhtml in debug and non-debug as suggested in ptw's checkin comments. |
||||||||||||||||||||||||||||||||||||||||||||||||||||
This is because the parser parses the variable declaration as VarDeclList, but turns it into a StatementList in the AST. That works fine in most places, but not in a for expression (where it needs to be treated as an ExpressionList not a StatementList. The unparser is unparsing it with ;'s as the list separator, which is broken.