Skip to content

Commit

Permalink
Tidy grammar
Browse files Browse the repository at this point in the history
  • Loading branch information
rtoal committed Oct 9, 2024
1 parent 3a3155a commit 7d2a357
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/ekko.ohm
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ Ekko {
Program = Actor+
Actor = actor id Locals? Block
Locals = "[" ListOf<id, ","> "]"
Block = "{" Statement+"}"
Statement = id "=" Exp ";" -- assign
| print Exp ";" -- print
Block = "{" Stmt+"}"
Stmt = id "=" Exp ";" -- assign
| print Exp ";" -- print
| while Exp Block -- while
| loop (Exp times)? Block -- for
| if Exp Block (else (Statement_if | Block))? -- if
| send Exp to id ";" -- send
| receive id ";" -- receive
| back num ";" -- back
| forward num ";" -- forward
| commit ";" -- commit
| abort ";" -- abort
| if Exp Block (else (Stmt_if | Block))? -- if
| send Exp to id ";" -- send
| receive id ";" -- receive
| back num ";" -- back
| forward num ";" -- forward
| commit ";" -- commit
| abort ";" -- abort
Exp = ("-" | "!") Exp7 -- unary
| Exp1 "?" Exp1 ":" Exp -- ternary
| Exp1
Expand Down

0 comments on commit 7d2a357

Please sign in to comment.