** Check that next token is 'what' and skip it. In case of error, ** raise an error that the expected 'what' should match a 'who' ** in line 'where' (if that is not the current line). */
| 128 | ** in line 'where' (if that is not the current line). |
| 129 | */ |
| 130 | static void check_match (LexState *ls, int what, int who, int where) { |
| 131 | if (l_unlikely(!testnext(ls, what))) { |
| 132 | if (where == ls->linenumber) /* all in the same line? */ |
| 133 | error_expected(ls, what); /* do not need a complex message */ |
| 134 | else { |
| 135 | luaX_syntaxerror(ls, luaO_pushfstring(ls->L, |
| 136 | "%s expected (to close %s at line %d)", |
| 137 | luaX_token2str(ls, what), luaX_token2str(ls, who), where)); |
| 138 | } |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | |
| 143 | static TString *str_checkname (LexState *ls) { |
no test coverage detected