summaryrefslogtreecommitdiff
path: root/lexer.c
diff options
context:
space:
mode:
authorPeter Mikkelsen <petermikkelsen10@gmail.com>2022-01-30 13:26:56 +0000
committerPeter Mikkelsen <petermikkelsen10@gmail.com>2022-01-30 13:26:56 +0000
commitea73563aeab96d8ed41336279a6e8df1180d7fb9 (patch)
treebbfe242f57454a6a236a25f979eee713563d2ff8 /lexer.c
parent1ab8746ade35fad828837b44e9c840de00aa5967 (diff)
Lex comments correctly
Diffstat (limited to 'lexer.c')
-rw-r--r--lexer.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lexer.c b/lexer.c
index f8a6ae1..dd6888e 100644
--- a/lexer.c
+++ b/lexer.c
@@ -74,7 +74,11 @@ lexline(InputStream *input, int toplevel)
else
stmt->next = lexline(input, toplevel);
goto end;
- case L'⍝': goto end;
+ case L'⍝':
+ while(peek != '\n' && !inputEOF(input))
+ peek = getrune(input);
+ ungetrune(input);
+ goto end;
case L'⍬':
stmt->toks[stmt->ntoks].tag = ArrayTag;
stmt->toks[stmt->ntoks].array = allocarray(AtypeInt, 1, 0);