You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
592 B
22 lines
592 B
operator = @{ "operator" } // TODO
|
|
operand = @{ "operand" } // TODO
|
|
|
|
instruction = { operator ~ (spacing+ ~ operand)? }
|
|
|
|
loopBlockStart = { "[" ~ NEWLINE }
|
|
loopBlockEnd = { "]" }
|
|
loopBlock = { loopBlockStart
|
|
~ statements
|
|
~ loopBlockEnd
|
|
}
|
|
|
|
statement = _{ spacing*
|
|
~ (instruction | loopBlock)
|
|
}
|
|
|
|
statements = _{ (statement | NEWLINE)* }
|
|
|
|
spacing = _{ " " | "\t" }
|
|
COMMENT = _{ ";;" ~ (!NEWLINE ~ ANY)* ~ NEWLINE}
|
|
|
|
file = {SOI ~ (statement ~ NEWLINE+)* ~ EOI}
|
|
|