lang: ast: implement control flags returned by parser functions

This commit is contained in:
2024-11-26 21:30:40 +00:00
parent 740df312a9
commit cd89c20beb
9 changed files with 177 additions and 98 deletions

View File

@@ -9,7 +9,19 @@
struct parser_state;
typedef enum ivy_status (*token_parse_function)(
#define PARSE_RESULT(status, flags) \
((struct token_parse_result) {.r_status = (status), .r_flags = (flags) })
enum token_parse_flags {
PARSE_REPEAT_TOKEN = 0x01u,
};
struct token_parse_result {
enum ivy_status r_status;
enum token_parse_flags r_flags;
};
typedef struct token_parse_result (*token_parse_function)(
struct ivy_parser *, struct ivy_token *);
struct ast_node_type {