Author: dda
Date: 2007-12-10 16:01:11 -0800 (Mon, 10 Dec 2007)
New Revision: 7499

Modified:
   openlaszlo/trunk/WEB-INF/lps/server/sc/src/org/openlaszlo/sc/Parser.jjt
Log:
Change 20071210-dda-l by [EMAIL PROTECTED] on 2007-12-10 16:16:47 EST
    in /Users/dda/laszlo/src/svn/openlaszlo/trunk
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: Allow certain new keywords to be identifiers

New Features: none

Bugs Fixed: LPP-5226, LPP-5178

Technical Reviewer: ptw
QA Reviewer: hminsky
Doc Reviewer: (pending)

Documentation: none

Release Notes: none

Details:
   New keywords: internal, final, override, dynamic, static can be identifiers.
   Confirmed with SWF9 third party compiler that these are allowed, and also 
that
   public/private/protected are not allowed (oddly enough).

   Made a common shared function in the grammar to get maximal code sharing.

   This change fixes a problem exposed by the addition of the new keywords.
   We need the keywords to make changes to LFC files that will be shared
   among runtimes.

Tests:
  http://localhost:8080/trunk/examples/components/style_example.lzx
     with SWF7 (the reported test case), also SWF8 and DHTML.
  smokecheck SWF8, DHTML
  Tried some .lzs files mentioned in LPP-5178 to verify that the
     new keywords are still accepted in the appropriate places.



Modified: 
openlaszlo/trunk/WEB-INF/lps/server/sc/src/org/openlaszlo/sc/Parser.jjt
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/server/sc/src/org/openlaszlo/sc/Parser.jjt     
2007-12-10 22:47:57 UTC (rev 7498)
+++ openlaszlo/trunk/WEB-INF/lps/server/sc/src/org/openlaszlo/sc/Parser.jjt     
2007-12-11 00:01:11 UTC (rev 7499)
@@ -354,24 +354,39 @@
      {jjtThis.setFloatingPointValue(t.image);}
 }
 
+Token IdentifierOrAS3Keyword() #void : {Token t;}
+{
+  // Newer AS3 keywords are allowed as identifiers, other
+  // keywords (like public, private, protected) apparently are not
+  ( t=<IDENTIFIER>
+  | t=<INTERNAL>
+  | t=<FINAL>
+  | t=<STATIC>
+  | t=<OVERRIDE>
+  | t=<DYNAMIC>
+  )
+    {return t;}
+}
+
 ASTIdentifier Identifier() #Identifier : {Token t;}
 {
-  t=<IDENTIFIER>
+  ( t=IdentifierOrAS3Keyword() )
     {jjtThis.setName(t.image); return jjtThis;}
 }
 
 void IdentifierOrKeyword() #Identifier : {Token t;}
 {
-  t=<IDENTIFIER>
+  ( t=IdentifierOrAS3Keyword()
+  | t=<CLASS>
+  | t=<EXTENDS>
+  | t=<IMPLEMENTS>
+  | t=<INHERITS>
+  | t=<WITH>
+  | t=<INTERFACE>
+  | t=<TRAIT>
+  | t=<MIXIN>
+  )
     {jjtThis.setName(t.image);}
-| "class" {jjtThis.setName("class");}
-| "extends" {jjtThis.setName("extends");}
-| "implements" {jjtThis.setName("implements");}
-| "inherits" {jjtThis.setName("inherits");}
-| "with" {jjtThis.setName("with");}
-| "interface" {jjtThis.setName("interface");}
-| "trait" {jjtThis.setName("trait");}
-| "mixin" {jjtThis.setName("mixin");}
 }
 
 


_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins

Reply via email to