lang: ast: implement parsing of f-strings

This commit is contained in:
2024-12-06 13:46:58 +00:00
parent 2bd3e96427
commit 94c10dfbb2
5 changed files with 151 additions and 18 deletions

View File

@@ -26,12 +26,15 @@ struct ast_node_type expr_node_ops = {
TOK_PARSER(DOUBLE, arith_parse_operand),
TOK_PARSER(ATOM, arith_parse_operand),
TOK_PARSER(STRING, arith_parse_operand),
TOK_PARSER(STR_START, arith_parse_fstring),
TOK_PARSER(SYMBOL, arith_parse_operator),
TOK_PARSER(LABEL, arith_parse_label),
},
.n_symbol_parsers = {
SYM_PARSER(LEFT_PAREN, arith_parse_left_paren),
SYM_PARSER(RIGHT_PAREN, arith_parse_right_paren),
SYM_PARSER(LEFT_BRACE, arith_parse_left_brace),
SYM_PARSER(RIGHT_BRACE, arith_parse_right_brace),
SYM_PARSER(SEMICOLON, arith_parse_semicolon),
SYM_PARSER(UNDERSCORE, arith_parse_operand),
SYM_PARSER(CARET, arith_parse_caret),