aboutsummaryrefslogtreecommitdiff
path: root/llex.c
diff options
context:
space:
mode:
Diffstat (limited to 'llex.c')
-rw-r--r--llex.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/llex.c b/llex.c
index 3518f0da..1c4227ca 100644
--- a/llex.c
+++ b/llex.c
@@ -349,9 +349,14 @@ static int readhexaesc (LexState *ls) {
349} 349}
350 350
351 351
352/*
353** When reading a UTF-8 escape sequence, save everything to the buffer
354** for error reporting in case of errors; 'i' counts the number of
355** saved characters, so that they can be removed if case of success.
356*/
352static unsigned long readutf8esc (LexState *ls) { 357static unsigned long readutf8esc (LexState *ls) {
353 unsigned long r; 358 unsigned long r;
354 int i = 4; /* chars to be removed: '\', 'u', '{', and first digit */ 359 int i = 4; /* number of chars to be removed: start with #"\u{X" */
355 save_and_next(ls); /* skip 'u' */ 360 save_and_next(ls); /* skip 'u' */
356 esccheck(ls, ls->current == '{', "missing '{'"); 361 esccheck(ls, ls->current == '{', "missing '{'");
357 r = cast_ulong(gethexa(ls)); /* must have at least one digit */ 362 r = cast_ulong(gethexa(ls)); /* must have at least one digit */