Skip to content

Commit d56b51a

Browse files
authored
Revert "Alt tree-sitter#2454"
1 parent 8456f7e commit d56b51a

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

cli/src/generate/render.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -766,6 +766,7 @@ impl Generator {
766766
indent!(self);
767767

768768
add_line!(self, "START_LEXER();");
769+
add_line!(self, "eof = lexer->eof(lexer);");
769770
add_line!(self, "switch (state) {{");
770771

771772
indent!(self);

lib/include/tree_sitter/parser.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,18 +129,24 @@ struct TSLanguage {
129129
* Lexer Macros
130130
*/
131131

132+
#ifdef _MSC_VER
133+
#define UNUSED __pragma(warning(suppress : 4101))
134+
#else
135+
#define UNUSED __attribute__((unused))
136+
#endif
137+
132138
#define START_LEXER() \
133139
bool result = false; \
134140
bool skip = false; \
141+
UNUSED \
135142
bool eof = false; \
136143
int32_t lookahead; \
137144
goto start; \
138145
next_state: \
139146
lexer->advance(lexer, skip); \
140147
start: \
141148
skip = false; \
142-
lookahead = lexer->lookahead; \
143-
eof = lexer->eof(lexer);
149+
lookahead = lexer->lookahead;
144150

145151
#define ADVANCE(state_value) \
146152
{ \

0 commit comments

Comments
 (0)