diff options
author | Quinn Stephens <quinn@osmora.org> | 2025-06-09 21:17:22 -0400 |
---|---|---|
committer | Quinn Stephens <quinn@osmora.org> | 2025-06-09 21:17:22 -0400 |
commit | 6ff31c0dbf2f5485604936de3e6457794554fb75 (patch) | |
tree | 641fa03dd65b24776baf49468e1d23c52763b72c /include | |
parent | 750c26fedb02db025bcb86176a7d94cb386b6b18 (diff) |
parser: Introduce parser context struct
Signed-off-by: Quinn Stephens <quinn@osmora.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/parser.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/parser.h b/include/parser.h index 369115b..d0dadbe 100644 --- a/include/parser.h +++ b/include/parser.h @@ -32,6 +32,17 @@ #include "lexer.h" +struct parser { + struct lexer *lexer; + struct token tok; +}; + +static inline bool +parser_advance(struct parser *ctx) +{ + return lexer_next(ctx->lexer, &ctx->tok); +} + bool parser_parse(struct lexer *lexer); #endif /* !_PARSER_H */ |