Merge pull request #2798 from tree-sitter/revert-2482-alt-2454
Revert "Alt #2454"
This commit is contained in:
commit
24e62e5c79
2 changed files with 9 additions and 2 deletions
|
|
@ -766,6 +766,7 @@ impl Generator {
|
|||
indent!(self);
|
||||
|
||||
add_line!(self, "START_LEXER();");
|
||||
add_line!(self, "eof = lexer->eof(lexer);");
|
||||
add_line!(self, "switch (state) {{");
|
||||
|
||||
indent!(self);
|
||||
|
|
|
|||
|
|
@ -129,9 +129,16 @@ struct TSLanguage {
|
|||
* Lexer Macros
|
||||
*/
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#define UNUSED __pragma(warning(suppress : 4101))
|
||||
#else
|
||||
#define UNUSED __attribute__((unused))
|
||||
#endif
|
||||
|
||||
#define START_LEXER() \
|
||||
bool result = false; \
|
||||
bool skip = false; \
|
||||
UNUSED \
|
||||
bool eof = false; \
|
||||
int32_t lookahead; \
|
||||
goto start; \
|
||||
|
|
@ -139,8 +146,7 @@ struct TSLanguage {
|
|||
lexer->advance(lexer, skip); \
|
||||
start: \
|
||||
skip = false; \
|
||||
lookahead = lexer->lookahead; \
|
||||
eof = lexer->eof(lexer);
|
||||
lookahead = lexer->lookahead;
|
||||
|
||||
#define ADVANCE(state_value) \
|
||||
{ \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue