[Swift-commit] r2586 - trunk/resources

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Sun Feb 22 12:59:26 CST 2009


Author: benc
Date: 2009-02-22 12:59:26 -0600 (Sun, 22 Feb 2009)
New Revision: 2586

Modified:
   trunk/resources/swiftscript.g
Log:
Remove type tokens from the lexer, as they can all be caught by the
general ID case.

Modified: trunk/resources/swiftscript.g
===================================================================
--- trunk/resources/swiftscript.g	2009-02-22 17:27:01 UTC (rev 2585)
+++ trunk/resources/swiftscript.g	2009-02-22 18:59:26 UTC (rev 2586)
@@ -453,20 +453,12 @@
         }
     ;
 
-// TODO unnecessary complexity here - this should work ok matching
-// only ID
 type returns [StringTemplate code=null]
-{String s = null;}
     :
-     ( ( "int" {s="int"; } )
-     | ( "float" {s="float"; } )
-     | ( "string" {s="string"; } )
-     | ( "boolean" {s="boolean"; } )
-     | ( id:ID {s=id.getText();} )
-     ) 
+     id:ID 
         {
         code=template("type");
-        code.setAttribute("name", s);
+        code.setAttribute("name", id.getText());
         }
     ;
 




More information about the Swift-commit mailing list