lang: ast: fix incorrect return types; add function to determine expression tokens

This commit is contained in:
2024-11-27 12:56:10 +00:00
parent cd89c20beb
commit ad25b89af0
6 changed files with 127 additions and 21 deletions

View File

@@ -9,8 +9,8 @@
struct parser_state;
#define PARSE_RESULT(status, flags) \
((struct token_parse_result) {.r_status = (status), .r_flags = (flags) })
#define PARSE_RESULT(status, flags) \
((struct token_parse_result) {.r_status = (status), .r_flags = (flags)})
enum token_parse_flags {
PARSE_REPEAT_TOKEN = 0x01u,
@@ -38,6 +38,7 @@ struct ast_node_type {
token_parse_function n_token_parsers[IVY_TOK_TYPE_COUNT];
token_parse_function n_keyword_parsers[IVY_KW_TYPE_COUNT];
token_parse_function n_symbol_parsers[IVY_SYM_TYPE_COUNT];
token_parse_function n_expr_parser;
};
extern const struct ast_node_type *get_ast_node_type(enum ivy_ast_node_type type);