From ea73563aeab96d8ed41336279a6e8df1180d7fb9 Mon Sep 17 00:00:00 2001 From: Peter Mikkelsen Date: Sun, 30 Jan 2022 13:26:56 +0000 Subject: Lex comments correctly --- lexer.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lexer.c') 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); -- cgit v1.2.3