[Laszlo-dev] For Review: Change 20080226-dda-5 Summary: Support optional and variable arg syntax for SWF8, DHTML
Donald Anderson
dda at ddanderson.com
Wed Feb 27 14:29:15 PST 2008
[Sorry if this is a repeat - it doesn't look like it was sent the
first time]
Change 20080226-dda-5 by dda at lester.local on 2008-02-26 09:02:58 EST
in /Users/dda/laszlo/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Support optional and variable arg syntax for SWF8, DHTML
New Features: JS2 syntax for optional arguments and ...rest syntax for
variable arguments now supported
Bugs Fixed: LPP-5273
Technical Reviewer: ptw (pending)
QA Reviewer: promanik (pending)
Doc Reviewer: (pending)
Documentation: The syntax allowed is according to the Ecmascript 4
draft standard,
which is implemented in ActionScript 3.
Release Notes:
Details:
The grammar aspect of this change is backported from the devildog
branch.
To help future merges, it seemed best to take all grammar changes
except for
the SWF9 'passthrough' work. Which means we get:
- varargs and optional args, with corresponding changes to
ASTIdentifier
- recognition 'const' keyword (treating the same as 'var')
- 'catch' allows a type declaration for argument.
- turn on 'visitor' support in parser, could help with future
work.
The changes to the formal arguments are made just before a
function is translated,
and are designed as a single method. This will allow SWF9 to
provide a
no-op for the method and keep its behavior to pass through the
syntax
to the third party compiler.
The new function is formalArgumentsTransformations and is
expected to be self documenting.
A small fix to 'setRuntime' in JavascriptGenerator spotted and
changed.
Some unneeded code removed from CodeGenerator (this change
already in devildog).
A new file test/optarg.lzx is added. This will supercede test/
optargs.lzx already
in the devildog branch.
Tests:
(smokecheck,weather,lzpix) x (swf8,dhtml)
new test/optarg.lzx (swf8,dhtml)
one-off test: locally, incorporated parts of test/optarg.lzx into
LFC to make
sure syntaxes work within 'class { function foo(args...) }'
syntax.
Files:
A test/optarg.lzx
M WEB-INF/lps/server/src/org/openlaszlo/sc/JavascriptGenerator.java
M WEB-INF/lps/server/src/org/openlaszlo/sc/VariableAnalyzer.java
M WEB-INF/lps/server/src/org/openlaszlo/sc/CommonGenerator.java
M WEB-INF/lps/server/src/org/openlaszlo/sc/Compiler.java
M WEB-INF/lps/server/src/org/openlaszlo/sc/CodeGenerator.java
M WEB-INF/lps/server/sc/src/org/openlaszlo/sc/Parser.jjt
M WEB-INF/lps/server/sc/src/org/openlaszlo/sc/parser/
SimpleNode.java
M WEB-INF/lps/server/sc/src/org/openlaszlo/sc/parser/
ASTModifiedDefinition.java
M WEB-INF/lps/server/sc/src/org/openlaszlo/sc/parser/
ASTOperator.java
M WEB-INF/lps/server/sc/src/org/openlaszlo/sc/parser/
ASTLiteral.java
M WEB-INF/lps/server/sc/src/org/openlaszlo/sc/parser/
ASTIdentifier.java
Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20080226-dda-5.tar
--
Don Anderson
Java/C/C++, Berkeley DB, systems consultant
voice: 617-547-7881
email: dda at ddanderson.com
www: http://www.ddanderson.com
More information about the Laszlo-dev
mailing list