fixes to grammar file
authoradam <adam@megacz.com>
Sat, 3 Feb 2007 06:59:10 +0000 (07:59 +0100)
committeradam <adam@megacz.com>
Sat, 3 Feb 2007 06:59:10 +0000 (07:59 +0100)
src/edu/berkeley/fleet/assembler/fleet.g

index cf1f9ef..dc36134 100644 (file)
@@ -5,8 +5,8 @@
 // the grammar.  An equivalent lex+yacc grammar and support code would
 // be several times as long.
 
-Comment        = "//" ~[\n]* "\n"
-               | "/*" ~[\n]* "*/"
+Comment        = "//" ~[\n\r]* [\r\n]!
+               | "/*" ~[\n\r]* "*/"
 ws             = ([\r\n ] | Comment)* -> ~[\r\n ]
 
 s               = ws! Program ws!
@@ -17,7 +17,9 @@ Statement       = Fiber::        Source ":" (Instruction +/ ws)     /ws
                 | Literal::      int    ":" "sendto" Port       ";" /ws
                 | NamedCodeBag:: name   ":" "{" CodeBagBody "}"     /ws
 
-Instruction     = Instruction:: (Brack:: "[" (int|(Star::"*"))? ("r")? "]" ws!)? (Command +/ (ws! "," ws!) ws! ";"!)
+Instruction     = Instruction::
+                        (Brack:: "[" (int|(Star::"*"))? ("r")? "]" ws!)?
+                        (Command +/ (ws! "," ws!) ws! ";"!)
 Command         = Nop::     "nop"
                 | Kill::    "kill"
                 | Wait::    "wait"