From e7fe081efaae893ed46548fdbc3bfa39b2879878 Mon Sep 17 00:00:00 2001 From: zinc Date: Thu, 15 Oct 2026 18:29:55 +0330 Subject: duplicate case labels are an error (b.2.15); unterminated string literal reported where it starts (b.2.11); an unreachable droppable cycle drops whole in one collection (6.15.3) --- src/compiler/lex.zc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/compiler/lex.zc') diff --git a/src/compiler/lex.zc b/src/compiler/lex.zc index 712eff8..95415a6 100644 --- a/src/compiler/lex.zc +++ b/src/compiler/lex.zc @@ -533,8 +533,9 @@ int lex1() { while (isidc(ch)) { n = token_char(n, ch); nextch(); } tbuf[n] = 0; if (n == 1 && tbuf[0] == 'b' && ch == 34) { - n = 0; nextch(); + n = 0; dg = line; nextch(); while (ch >= 0 && ch != 34) { v = escch(); n = token_char(n, v); } + if (ch < 0) { tline = dg; serr("unterminated string literal"); } // spec 1.4.4 nextch(); tbuf[n] = 0; tk = T_BSTR; tv = intern(tbuf); return 0; @@ -556,8 +557,9 @@ int lex1() { return 0; } if (ch == 34) { - nextch(); + dg = line; nextch(); while (ch >= 0 && ch != 34) { v = escch(); n = token_char(n, v); } + if (ch < 0) { tline = dg; serr("unterminated string literal"); } // spec 1.4.4 nextch(); tbuf[n] = 0; tk = T_STR; tv = intern(tbuf); return 0; -- cgit v1.2.3