I guess I was complaining about the use of 2 booleans to store 3 states, rather than an enumeration. Not a big deal.

I'm more upset that the committee slacked and let class declarations be nullable by default. I guess they had to for backward compatibility. If they didn't have to do that, you wouldn't need the non-nullable state at all, since that would be the default.

On 2007-12-07, at 15:03 EST, Donald Anderson wrote:

The grammar should not accept both '!' '?' at once.
We do track the presence of each independently, so we
can emit precisely the same as was input.

On Dec 7, 2007, at 2:30 PM, P T Withington wrote:

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 [EMAIL PROTECTED] 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:  [EMAIL PROTECTED]
WWW:    http://www.ddanderson.com




--

Don Anderson
Java/C/C++, Berkeley DB, systems consultant

Voice:  617-547-7881
Email:  [EMAIL PROTECTED]
WWW:    http://www.ddanderson.com


Reply via email to