From b4d7130c8cc5715e19d49019ccb528fd3e8786a4 Mon Sep 17 00:00:00 2001 From: Raymon Zutekouw <40148684+Raymonzut@users.noreply.github.com> Date: Sun, 26 Dec 2021 20:41:59 +0100 Subject: [PATCH] Use built-in NEWLINE Rule --- src/grammars/mblf.pest | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/grammars/mblf.pest b/src/grammars/mblf.pest index f455f3f..296d3f7 100644 --- a/src/grammars/mblf.pest +++ b/src/grammars/mblf.pest @@ -3,7 +3,7 @@ operand = @{ "operand" } // TODO instruction = { operator ~ (spacing+ ~ operand)? } -loopBlockStart = { "[" ~ newline } +loopBlockStart = { "[" ~ NEWLINE } loopBlockEnd = { "]" } loopBlock = { loopBlockStart ~ statements @@ -14,10 +14,9 @@ statement = _{ spacing* ~ (instruction | loopBlock) } -statements = _{ (statement | newline)* } +statements = _{ (statement | NEWLINE)* } -newline = _{ "\n" | "\r\n" } spacing = _{ " " | "\t" } -COMMENT = _{ ";;" ~ (!newline ~ ANY)* ~ newline} +COMMENT = _{ ";;" ~ (!NEWLINE ~ ANY)* ~ NEWLINE} -file = {SOI ~ (statement ~ newline+)* ~ EOI} +file = {SOI ~ (statement ~ NEWLINE+)* ~ EOI}