File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff 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 ) ;
Original file line number Diff line number Diff 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 { \
You can’t perform that action at this time.
0 commit comments