From 6ff31c0dbf2f5485604936de3e6457794554fb75 Mon Sep 17 00:00:00 2001 From: Quinn Stephens Date: Mon, 9 Jun 2025 21:17:22 -0400 Subject: parser: Introduce parser context struct Signed-off-by: Quinn Stephens --- include/parser.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include/parser.h') 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 */ -- cgit v1.2.3