[Laszlo-dev] For Review: Change 20071206-dda-9 Summary: Fixes for [not] nullable syntax, and return type syntax for function.
P T Withington
ptw at pobox.com
Fri Dec 7 11:30:44 PST 2007
Approved.
I wonder if we really need to store nullable and notnullable, or if we
can just make the gammar smarter so that you can't have both?
On 2007-12-06, at 17:58 EST, Donald Anderson wrote:
> Change 20071206-dda-9 by dda at freddie.local on 2007-12-06 17:36:12 EST
> in /Users/dda/laszlo/src/svn/openlaszlo/trunk-b
> for http://svn.openlaszlo.org/openlaszlo/trunk
>
> Summary: Fixes for [not] nullable syntax, and return type syntax for
> function.
>
> New Features: none
>
> Bugs Fixed: LPP-5059
>
> Technical Reviewer: ptw
> QA Reviewer: hminsky
> Doc Reviewer: (pending)
>
> Documentation: none
>
> Release Notes: none - feature is not yet released or used.
>
> Details:
> The grammar fix for nullable is straightforward.
>
> For function return values, given that functions
> can be declared with/or without an identifier (using function
> expressions),
> we cannot put the type information on an ASTIdentifier, since
> there may not be one. The logical place to put the return value
> is on the FormalParameterList, which might now be thought of as
> the function's signature (if it weren't rather disruptive,
> I would have changed the name). Any function whether created
> as a declaration or expression, has a FormalParamterList, so it
> is a convenient place in the grammar. Making this change
> actually cleaned up the grammar slightly, I think.
>
> Tests:
> 1) Run test/typevar.lzx to check nullable syntax, should give no
> errors.
>
> 2) Run lzsc on:
>
> // tests for return types
>
> function f1() { }
> function f2() : void { }
> function f3():Integer? { }
> function f4():Integer! { }
> function f5(x):Integer! { }
> function f6(x:int):Integer! { }
> function f7(x:int,y):Integer! { }
> function f8(x,y:int):Integer! { }
> function f9(x:int,y:int):Integer! { }
> function f10(x:int?,y:int):Integer! { }
> function f11(x:int?,y:int!):Integer! { }
> var x = function (x:int?,y:int!):Integer! { }
>
> Running lzsc is currently the only way to test this, that will
> probably change soon.
>
> 3) Compared binary LFC files from compiler to make sure no
> regressions.
>
> 4) Ran smokecheck.lzx to make sure no regressions.
>
>
> Files:
> M test/typevar.lzx
> M WEB-INF/lps/server/sc/src/org/openlaszlo/sc/Parser.jjt
>
> Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20071206-dda-9.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