Add lexer API for detecting boundaries of included ranges

Co-Authored-By: Ashi Krishnan <queerviolet@github.com>
This commit is contained in:
Max Brunsfeld 2018-07-17 13:58:26 -07:00
parent d54412266e
commit 87c992a7f0
9 changed files with 88 additions and 44 deletions

View file

@ -25,13 +25,16 @@ typedef struct {
bool named : 1;
} TSSymbolMetadata;
typedef struct {
void (*advance)(void *, bool);
void (*mark_end)(void *);
uint32_t (*get_column)(void *);
typedef struct TSLexer TSLexer;
struct TSLexer {
int32_t lookahead;
TSSymbol result_symbol;
} TSLexer;
void (*advance)(TSLexer *, bool);
void (*mark_end)(TSLexer *);
uint32_t (*get_column)(TSLexer *);
bool (*is_at_included_range_start)(TSLexer *);
};
typedef enum {
TSParseActionTypeShift,