lang: ast: implement parsing of subscript operator

This commit is contained in:
2024-12-08 17:08:29 +00:00
parent 753afd7d87
commit 8b8a97c9a6
3 changed files with 23 additions and 2 deletions

View File

@@ -55,6 +55,7 @@ static const struct ivy_operator operators[] = {
OP(UNDERSTANDS, IS, LEFT, INFIX, BINARY),
OP(SELF_ACCESS, SUBSCRIPT, LEFT, INFIX, BINARY),
OP(PKG_ACCESS, SUBSCRIPT, LEFT, INFIX, BINARY),
OP(SUBSCRIPT, SUBSCRIPT, LEFT, INFIX, BINARY),
/* parser-internal pseudo-operators. */
OP(MSG, UNARY_MSG, LEFT, POSTFIX, UNARY),
@@ -201,6 +202,7 @@ const char *ivy_operator_id_to_string(enum ivy_operator_id op)
ENUM_STR(IVY_OP_UNDERSTANDS);
ENUM_STR(IVY_OP_SELF_ACCESS);
ENUM_STR(IVY_OP_PKG_ACCESS);
ENUM_STR(IVY_OP_SUBSCRIPT);
ENUM_STR(IVY_OP_MSG);
ENUM_STR(IVY_OP_LEFT_PAREN);
default: