forked from luna/jorts
grammaer: more changes
i cant make sense of the errors lmao help
This commit is contained in:
parent
abdff4f65c
commit
9fda0b31c3
1 changed files with 5 additions and 4 deletions
|
@ -18,13 +18,14 @@ QUOTE: "\\""
|
|||
|
||||
identifier: WHITESPACE* ANY WHITESPACE*
|
||||
|
||||
single_comment: "//" ANY* NEWLINE
|
||||
single_comment: SINGLE_COMMENT ANY* NEWLINE
|
||||
multi_comment: COM_START ANY* COM_END
|
||||
|
||||
import_stmt: IMPORT identifier NEWLINE
|
||||
|
||||
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: "+" | "-"
|
||||
string: QUOTE ANY* QUOTE
|
||||
|
@ -32,9 +33,9 @@ value: (sign_int* INTEGER) | string
|
|||
|
||||
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):
|
||||
|
|
Loading…
Reference in a new issue