aboutsummaryrefslogtreecommitdiff
path: root/src/compiler/lex.zc
diff options
context:
space:
mode:
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;