lang: change symbols for properties and atoms to -> and $ respectively
This commit is contained in:
@@ -15,7 +15,7 @@ struct class_parser_state {
|
|||||||
int s_prev_token;
|
int s_prev_token;
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct token_parse_result parse_dollar(
|
static struct token_parse_result parse_hyphen_right_angle(
|
||||||
struct ivy_parser *ctx, struct ivy_token *tok)
|
struct ivy_parser *ctx, struct ivy_token *tok)
|
||||||
{
|
{
|
||||||
struct class_parser_state *state
|
struct class_parser_state *state
|
||||||
@@ -146,7 +146,8 @@ static void to_string(struct ivy_ast_node *node, b_string *str)
|
|||||||
{
|
{
|
||||||
struct ivy_ast_class_node *c = (struct ivy_ast_class_node *)node;
|
struct ivy_ast_class_node *c = (struct ivy_ast_class_node *)node;
|
||||||
|
|
||||||
b_string_append_cstrf(str, "%s (%s)", ivy_ast_node_type_to_string(node->n_type),
|
b_string_append_cstrf(
|
||||||
|
str, "%s (%s)", ivy_ast_node_type_to_string(node->n_type),
|
||||||
c->n_ident->t_str);
|
c->n_ident->t_str);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -183,7 +184,7 @@ struct ast_node_type class_node_ops = {
|
|||||||
.n_state_size = sizeof(struct class_parser_state),
|
.n_state_size = sizeof(struct class_parser_state),
|
||||||
.n_node_size = sizeof(struct ivy_ast_class_node),
|
.n_node_size = sizeof(struct ivy_ast_class_node),
|
||||||
.n_symbol_parsers = {
|
.n_symbol_parsers = {
|
||||||
SYM_PARSER(DOLLAR, parse_dollar),
|
SYM_PARSER(HYPHEN_RIGHT_ANGLE, parse_hyphen_right_angle),
|
||||||
SYM_PARSER(HYPHEN, parse_hyphen),
|
SYM_PARSER(HYPHEN, parse_hyphen),
|
||||||
SYM_PARSER(PLUS, parse_plus),
|
SYM_PARSER(PLUS, parse_plus),
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -90,6 +90,7 @@ struct ast_node_type expr_node_ops = {
|
|||||||
|
|
||||||
/* operator/block keywords */
|
/* operator/block keywords */
|
||||||
KW_PARSER(IN, arith_parse_in),
|
KW_PARSER(IN, arith_parse_in),
|
||||||
|
KW_PARSER(IS, arith_parse_operator),
|
||||||
KW_PARSER(DO, arith_parse_do),
|
KW_PARSER(DO, arith_parse_do),
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -149,6 +149,8 @@ extern struct token_parse_result arith_parse_equal_right_angle(
|
|||||||
struct ivy_parser *ctx, struct ivy_token *tok);
|
struct ivy_parser *ctx, struct ivy_token *tok);
|
||||||
extern struct token_parse_result arith_parse_in(
|
extern struct token_parse_result arith_parse_in(
|
||||||
struct ivy_parser *ctx, struct ivy_token *tok);
|
struct ivy_parser *ctx, struct ivy_token *tok);
|
||||||
|
extern struct token_parse_result arith_parse_is(
|
||||||
|
struct ivy_parser *ctx, struct ivy_token *tok);
|
||||||
extern struct token_parse_result arith_parse_do(
|
extern struct token_parse_result arith_parse_do(
|
||||||
struct ivy_parser *ctx, struct ivy_token *tok);
|
struct ivy_parser *ctx, struct ivy_token *tok);
|
||||||
|
|
||||||
|
|||||||
@@ -773,7 +773,7 @@ static enum ivy_status read_symbol(struct ivy_lexer *lex)
|
|||||||
return read_block_comment(lex);
|
return read_block_comment(lex);
|
||||||
case IVY_SYM_DOUBLE_HYPHEN:
|
case IVY_SYM_DOUBLE_HYPHEN:
|
||||||
return read_line_comment(lex);
|
return read_line_comment(lex);
|
||||||
case IVY_SYM_HASH:
|
case IVY_SYM_DOLLAR:
|
||||||
return read_atom(lex);
|
return read_atom(lex);
|
||||||
case IVY_SYM_LEFT_BRACE:
|
case IVY_SYM_LEFT_BRACE:
|
||||||
push_symbol(lex, node->s_id);
|
push_symbol(lex, node->s_id);
|
||||||
|
|||||||
Reference in New Issue
Block a user