diff options
author | Himbeer <himbeer@disroot.org> | 2024-10-20 19:15:28 +0200 |
---|---|---|
committer | Himbeer <himbeer@disroot.org> | 2024-10-20 19:15:28 +0200 |
commit | 45bd094ceefe590be759993946fb3c9e84eab910 (patch) | |
tree | b553e03ea3e407f778f0fa999ee0c63185d184f1 | |
parent | c67c7082dbc9601b68d80a63f340415e5ceb48c8 (diff) |
Remove terminating semicolons
-rw-r--r-- | doc/grammar.txt | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/doc/grammar.txt b/doc/grammar.txt index 4aff55a..11518d4 100644 --- a/doc/grammar.txt +++ b/doc/grammar.txt @@ -1,4 +1,4 @@ -root := import* toplevel* +root := ( toplevel )\n toplevel := externfunc | function | constant | typedef path := NAME @@ -7,14 +7,14 @@ function := [ COMMENT ] [ "export" ] "func" NAME "(" ( param ), ")" [ type ] block param := NAME type -externfunc := "extern" "func" NAME "(" ( type ), ")" [ type ] ";" +externfunc := "extern" "func" NAME "(" ( type ), ")" [ type ] constant := [ COMMENT ] - "const" NAME "=" ( NUMBER | bool | STRING* ) ";" + "const" NAME "=" ( NUMBER | bool | STRING* ) typedef := [ COMMENT ] "type" NAME type -block := [ ":" NAME ] "{" command* "}" +block := [ ":" NAME ] "{" ( command )\n "}" command := block | statement @@ -24,7 +24,7 @@ statement := ( return | break | continue | declaration - | defer ) ";" + | defer ) if := "if" expression block elseif* else* elseif := "else" "if" expression block @@ -37,9 +37,9 @@ return := "return" [ expression ] break := "break" [ ":" NAME ] [ expression ] continue := "continue" [ ":" NAME ] -declaration := "let" [ "mut" ] NAME "=" expression ";" +declaration := ( "const" | "var" ) NAME "=" expression -assignment := location "=" expression ";" +assignment := location "=" expression location := path ( index | field )* [ "*" ] index := "[" expression "]" field := "." NAME |