Skip to content

Commit e2537cc

Browse files
committed
Fixed operators starting with /
1 parent a81313e commit e2537cc

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/lj_lex.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,9 @@ static LexToken lex_scan_luar(LexState *ls, TValue *tv)
585585
lex_next(ls);
586586
continue;
587587
}
588-
goto oper_encode;
588+
if (luar_char_oper_toident(ls->c))
589+
goto oper_scan;
590+
return '/';
589591
case '[': {
590592
int isc, sep = lex_skipeq_luar(ls, &isc);
591593
if (sep >= 0) {
@@ -646,7 +648,7 @@ static LexToken lex_scan_luar(LexState *ls, TValue *tv)
646648
lj_buf_reset(&ls->sb);
647649
return '=';
648650
}
649-
while (luar_char_oper_toident(c = lex_savenext(ls)));
651+
oper_scan: while (luar_char_oper_toident(c = lex_savenext(ls)));
650652
oper_encode: {
651653
/* Encode operator chars into identifier symbols */
652654
/* Max symbols count written in below loop (31)

src/lj_parse.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2108,6 +2108,7 @@ static int parse_infix_isend(LexToken tok)
21082108
case TK_ne:
21092109
case TK_label:
21102110
case TK_eof:
2111+
case ',':
21112112
case ';':
21122113
case '}':
21132114
case ')':

0 commit comments

Comments
 (0)