diff --git a/src/llex.cpp b/src/llex.cpp index 2e8b470f00..86c4946b42 100644 --- a/src/llex.cpp +++ b/src/llex.cpp @@ -1102,11 +1102,3 @@ int luaX_lookahead (LexState *ls) { const Token& luaX_lookbehind (LexState *ls) { return ls->tokens.at(ls->tidx - 1); } - - -void luaX_checkspecial (LexState *ls) { - if (ls->shouldSuggest()) { - SuggestionsState ss(ls); - ss.pushLocals(); - } -} diff --git a/src/llex.h b/src/llex.h index d3b3078e35..6ce0f8cf7a 100644 --- a/src/llex.h +++ b/src/llex.h @@ -556,4 +556,3 @@ LUAI_FUNC l_noret luaX_syntaxerror (LexState *ls, const char *s); LUAI_FUNC const char *luaX_token2str (LexState *ls, int token); LUAI_FUNC const char *luaX_token2str_noq (LexState *ls, int token); LUAI_FUNC const char *luaX_reserved2str (int token); -LUAI_FUNC void luaX_checkspecial (LexState *ls); diff --git a/src/lparser.cpp b/src/lparser.cpp index 97f21a3d33..6151eed78f 100644 --- a/src/lparser.cpp +++ b/src/lparser.cpp @@ -3584,7 +3584,10 @@ static BinOpr subexpr (LexState *ls, expdesc *v, int limit, TypeHint *prop, int static void expr (LexState *ls, expdesc *v, TypeHint *prop, int flags) { - luaX_checkspecial(ls); + if (ls->shouldSuggest()) { + SuggestionsState ss(ls); + ss.pushLocals(); + } subexpr(ls, v, 0, prop, flags); if (testnext(ls, '?')) { /* ternary expression? */ if (prop) prop->clear(); /* we don't care what type the condition is/was */