Extract newline grammar rule
This commit is contained in:
@@ -3,16 +3,17 @@ operand = @{ "operand" } // TODO
|
|||||||
|
|
||||||
instruction = { operator ~ (" "+ ~ operand)? }
|
instruction = { operator ~ (" "+ ~ operand)? }
|
||||||
|
|
||||||
loopBlockStart = { "[" ~ ("\n" | "\r\n") }
|
loopBlockStart = { "[" ~ newline }
|
||||||
loopBlockEnd = { "]" }
|
loopBlockEnd = { "]" }
|
||||||
loopBlock = { loopBlockStart
|
loopBlock = { loopBlockStart
|
||||||
~ statements
|
~ statements
|
||||||
~ ("\n" | "\r\n")
|
~ newline
|
||||||
~ loopBlockEnd
|
~ loopBlockEnd
|
||||||
}
|
}
|
||||||
|
|
||||||
statement = _{ instruction | loopBlock }
|
statement = _{ instruction | loopBlock }
|
||||||
statements = _{ statement* }
|
statements = _{ statement* }
|
||||||
|
|
||||||
|
newline = _{ "\n" | "\r\n" }
|
||||||
|
|
||||||
file = {SOI ~ (statement ~ ("\n" | "\r\n")+)* ~ EOI}
|
file = {SOI ~ (statement ~ newline+)* ~ EOI}
|
||||||
|
|||||||
Reference in New Issue
Block a user