Allow either spaces or tabs as spacing

This commit is contained in:
2021-12-26 19:47:40 +01:00
committed by Raymon Zutekouw
parent 6eb61ad83d
commit 298513eb7f
+2 -1
View File
@@ -1,7 +1,7 @@
operator = @{ "operator" } // TODO operator = @{ "operator" } // TODO
operand = @{ "operand" } // TODO operand = @{ "operand" } // TODO
instruction = { operator ~ (" "+ ~ operand)? } instruction = { operator ~ (spacing+ ~ operand)? }
loopBlockStart = { "[" ~ newline } loopBlockStart = { "[" ~ newline }
loopBlockEnd = { "]" } loopBlockEnd = { "]" }
@@ -15,5 +15,6 @@ statement = _{ instruction | loopBlock }
statements = _{ statement* } statements = _{ statement* }
newline = _{ "\n" | "\r\n" } newline = _{ "\n" | "\r\n" }
spacing = _{ " " | "\t" }
file = {SOI ~ (statement ~ newline+)* ~ EOI} file = {SOI ~ (statement ~ newline+)* ~ EOI}