From 45b5f113a0cfc2f31e6b1cb19a1ca0b91563d57e Mon Sep 17 00:00:00 2001 From: Sam Vervaeck Date: Thu, 25 Aug 2022 16:12:47 +0200 Subject: [PATCH] Allow line comments in Bolt sources --- src/Scanner.cc | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/Scanner.cc b/src/Scanner.cc index c17403523..c0d42b6f6 100644 --- a/src/Scanner.cc +++ b/src/Scanner.cc @@ -77,9 +77,19 @@ namespace bolt { for (;;) { StartLoc = getCurrentLoc(); C0 = getChar(); - if (!isWhiteSpace(C0)) { - break; + if (isWhiteSpace(C0)) { + continue; } + if (C0 == '#') { + for (;;) { + C0 = getChar(); + if (C0 == '\n' || C0 == EOF) { + break; + } + } + continue; + } + break; } switch (C0) {