fix grammar ambiguity
authoradam <adam@megacz.com>
Sun, 4 Mar 2007 11:52:08 +0000 (12:52 +0100)
committeradam <adam@megacz.com>
Sun, 4 Mar 2007 11:52:08 +0000 (12:52 +0100)
src/edu/berkeley/fleet/assembler/fleet.g

index 8262356..1d0041b 100644 (file)
@@ -5,8 +5,8 @@
 // the grammar.  An equivalent lex+yacc grammar and support code would
 // be several times as long.
 
-Comment        = "//" ~[\n\r]* [\r\n]!
-               | "/*" ~[\n\r]* "*/"
+Comment        = "//" (~[\n\r])* [\r\n]!
+               | "/*" (~[\n\r])* "*/"
 ws             = ([\r\n ] | Comment)* -> ~[\r\n ]
 
 s               = ws! Program ws!
@@ -56,7 +56,7 @@ portname            = Name:: [a-z] [A-Za-z0-9\[\]_]**
 name                = Name:: [A-Za-z] [A-Za-z0-9\[\]_]**
 index               = "[" [0-9]+ "]" | [0-9]+
 int                 = [\-0-9]++
-ShipSpecific        = ShipSpecific:: "\"" ~[\"]++ "\""
+ShipSpecific        = ShipSpecific:: "\"" (~[\"])++ "\""
 
 // the following are not part of the official FLEET syntax and are
 // specific to Adam's interpreter.