From 6921aabf2a8b4ae360373cc7aa18b928e9e64f2c Mon Sep 17 00:00:00 2001 From: Sam Vervaeck Date: Mon, 24 Feb 2020 18:35:07 +0100 Subject: [PATCH] Fix punctuation parsing --- src/scanner.ts | 5 +++++ test/001-punct-depth-1.bolt | 3 +++ 2 files changed, 8 insertions(+) create mode 100644 test/001-punct-depth-1.bolt diff --git a/src/scanner.ts b/src/scanner.ts index 5af74434d..fcbcf76bd 100644 --- a/src/scanner.ts +++ b/src/scanner.ts @@ -196,6 +196,11 @@ export class Scanner { const c1 = this.peekChar(); + if (isWhiteSpace(c1)) { + this.getChar() + continue; + } + if (c1 === EOF) { throw new ScanError(this.file, this.currPos.clone(), EOF) } diff --git a/test/001-punct-depth-1.bolt b/test/001-punct-depth-1.bolt new file mode 100644 index 000000000..ef5665f11 --- /dev/null +++ b/test/001-punct-depth-1.bolt @@ -0,0 +1,3 @@ +{ foo baz bar } +( foo baz bar ) +[ foo baz bar ]