Skip to content

Commit

Permalink
Remove luaX_checkspecial
Browse files Browse the repository at this point in the history
  • Loading branch information
Sainan committed Feb 23, 2024
1 parent e1cc63c commit 62689f3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
8 changes: 0 additions & 8 deletions src/llex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
1 change: 0 additions & 1 deletion src/llex.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
5 changes: 4 additions & 1 deletion src/lparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 62689f3

Please sign in to comment.