aboutsummaryrefslogtreecommitdiff
path: root/src/compiler/lex.zc
diff options
context:
space:
mode:
authorGravatar zinc <zinc@downsta.ir> 2026-10-15 21:44:40 +0330
committerGravatar zinc <zinc@downsta.ir> 2026-10-15 21:44:40 +0330
commitf3dcfd9805e1bd23b002f648d4391ec397122d9c (patch)
tree91acab7da09c9225a2d838791d70e5c2e7db54b9 /src/compiler/lex.zc
parentmerge work/small-oob: bytes test out-of-bounds read (diff)
parentexamples/actors_demo: print the fan-out replies in worker order, not arrival ... (diff)
merge work/known-bugs: constant-expression precedence, local const in constant expressions, duplicate case labels, unterminated strings, droppable cycles in one collection, js vm exit, docs, actors_demo orderHEADmain
Diffstat (limited to 'src/compiler/lex.zc')
-rw-r--r--src/compiler/lex.zc6
1 files changed, 4 insertions, 2 deletions
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;