diff options
-rw-r--r-- | doc/mylang.ebnf | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/doc/mylang.ebnf b/doc/mylang.ebnf index a28fe80..a082007 100644 --- a/doc/mylang.ebnf +++ b/doc/mylang.ebnf @@ -4,7 +4,6 @@ letter = lowercaseLetter | uppercaseLetter. digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9". nl = "\n". -nls = nl { nl }. ident = letter { letter | digit }. integer = digit { digit }. @@ -21,14 +20,14 @@ factor = "(" bool ")" | ident | integer | "true" | "false". ident_list = ident { "," ident }. expression_list = expression { "," expression }. -program = function { [ nls ] function }. -function = "fun" ident "[" [ ident_list ] "]" [ nls ] statements [ nls ] "end". +program = function { [ nl ] function }. +function = "fun" ident "[" [ ident_list ] "]" [ nl ] statements [ nl ] "end". statement = [ if_statement | while_statement | assign_statement | function_call | return_statement ]. -statements = statement { nls statement }. +statements = statement { nl statement }. -if_statement = "if" expression [ nls ] statements [ nls ] [ "else" statements [ nls ] ] "end". -while_statement = "while" expression [ nls ] statements [ nls ] "end". +if_statement = "if" expression [ nl ] statements [ nl ] [ "else" statements [ nl ] ] "end". +while_statement = "while" expression [ nl ] statements [ nl ] "end". return_statement = "@" expression. assign_statement = ident "=" expression. function_call = ident "[" [ expression_list ] "]". |