Parse till operators
This commit is contained in:
+15
-1
@@ -1 +1,15 @@
|
||||
alpha = { 'a'..'z' | 'A'..'Z' }
|
||||
operator = @{ "operator" } // TODO
|
||||
operand = @{ "operand" } // TODO
|
||||
|
||||
instruction = { operator ~ (" "+ ~ operand)*}
|
||||
|
||||
loopBlockStart = { "[" }
|
||||
loopBlockEnd = { "]" }
|
||||
loopBlock = { loopBlockStart
|
||||
~ instruction*
|
||||
~ loopBlockEnd
|
||||
}
|
||||
|
||||
statement = _{ instruction | loopBlock }
|
||||
|
||||
file = {SOI ~ (statement ~ ("\n" | "\r\n")+)* ~ EOI}
|
||||
|
||||
Reference in New Issue
Block a user