grammaer: more changes

i cant make sense of the errors lmao help
This commit is contained in:
Luna 2019-03-09 20:05:03 -03:00
parent abdff4f65c
commit 9fda0b31c3

View file

@ -18,13 +18,14 @@ QUOTE: "\\""
identifier: WHITESPACE* ANY WHITESPACE* identifier: WHITESPACE* ANY WHITESPACE*
single_comment: "//" ANY* NEWLINE single_comment: SINGLE_COMMENT ANY* NEWLINE
multi_comment: COM_START ANY* COM_END multi_comment: COM_START ANY* COM_END
import_stmt: IMPORT identifier NEWLINE import_stmt: IMPORT identifier NEWLINE
fn_arg: identifier identifier fn_arg: identifier identifier
fn_stmt: FN identifier? "(" [fn_arg COMMA] ")" [ARROW identifier] "{" [stmt NEWLINE]* "}" parameters: fn_arg (COMMA fn_arg)
fn_stmt: FN identifier? "(" parameters? ")" [ARROW identifier] "{" NEWLINE? [stmt NEWLINE]* "}"
sign_int: "+" | "-" sign_int: "+" | "-"
string: QUOTE ANY* QUOTE string: QUOTE ANY* QUOTE
@ -32,9 +33,9 @@ value: (sign_int* INTEGER) | string
call_stmt: [identifier DOT] identifier "(" [value COMMA]* ")" call_stmt: [identifier DOT] identifier "(" [value COMMA]* ")"
stmt: (NEWLINE*) | import_stmt | fn_stmt | call_stmt stmt: value | import_stmt | fn_stmt | call_stmt
start: (stmt NEWLINE)* start: (NEWLINE | stmt)*
""" """
def parse(string: str): def parse(string: str):