lang: ast: implement parsing of atoms
This commit is contained in:
@@ -79,6 +79,14 @@ enum ivy_status arith_push_operand(
|
||||
b_queue_push_back(&state->s_output_queue, &v->n_base.n_entry);
|
||||
break;
|
||||
}
|
||||
case IVY_TOK_ATOM: {
|
||||
struct ivy_ast_atom_node *v
|
||||
= (struct ivy_ast_atom_node *)ast_node_create(
|
||||
IVY_AST_ATOM);
|
||||
v->n_content = tok;
|
||||
b_queue_push_back(&state->s_output_queue, &v->n_base.n_entry);
|
||||
break;
|
||||
}
|
||||
case IVY_TOK_STRING: {
|
||||
struct ivy_ast_string_node *v
|
||||
= (struct ivy_ast_string_node *)ast_node_create(
|
||||
|
||||
@@ -24,6 +24,7 @@ struct ast_node_type expr_node_ops = {
|
||||
TOK_PARSER(IDENT, arith_parse_ident),
|
||||
TOK_PARSER(INT, arith_parse_operand),
|
||||
TOK_PARSER(DOUBLE, arith_parse_operand),
|
||||
TOK_PARSER(ATOM, arith_parse_operand),
|
||||
TOK_PARSER(STRING, arith_parse_operand),
|
||||
TOK_PARSER(SYMBOL, arith_parse_operator),
|
||||
TOK_PARSER(LABEL, arith_parse_label),
|
||||
|
||||
Reference in New Issue
Block a user