From d13e1a238f8ac804e89aa882637bb9ae3d2599c5 Mon Sep 17 00:00:00 2001 From: Drew Galbraith Date: Thu, 9 Nov 2023 11:33:12 -0800 Subject: [PATCH] [Yunq] Add comments to Yunq. --- yunq/parser.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/yunq/parser.py b/yunq/parser.py index 9e9e64d..41b680c 100644 --- a/yunq/parser.py +++ b/yunq/parser.py @@ -65,6 +65,9 @@ def lexer(program: str): while program[current + 1].isalnum() or program[current + 1] == '_': current += 1 tokens.append(Lexeme(LexemeType.NAME, program[start:current + 1])) + elif curr == '/' and program[current + 1] == '/': + while program[current] != '\n': + current += 1 else: sys.exit("Got unexpected token %s on line %s." % (curr, line))