Remove state argument to Lexer advance method
This commit is contained in:
parent
c16b6b2059
commit
c4fe8ded95
4 changed files with 15 additions and 15 deletions
|
|
@ -23,7 +23,7 @@ typedef struct {
|
|||
} TSSymbolMetadata;
|
||||
|
||||
typedef struct {
|
||||
void (*advance)(void *, TSStateId, bool);
|
||||
void (*advance)(void *, bool);
|
||||
int32_t lookahead;
|
||||
TSSymbol result_symbol;
|
||||
} TSLexer;
|
||||
|
|
@ -92,14 +92,14 @@ typedef struct TSLanguage {
|
|||
|
||||
#define ADVANCE(state_value) \
|
||||
{ \
|
||||
lexer->advance(lexer, state_value, false); \
|
||||
lexer->advance(lexer, false); \
|
||||
state = state_value; \
|
||||
goto next_state; \
|
||||
}
|
||||
|
||||
#define SKIP(state_value) \
|
||||
{ \
|
||||
lexer->advance(lexer, state_value, true); \
|
||||
lexer->advance(lexer, true); \
|
||||
state = state_value; \
|
||||
goto next_state; \
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue