Implicit Selector Expressions: .A

This commit is contained in:
gingerBill
2019-03-06 16:19:47 +00:00
parent 1652d5033b
commit ad3b6ab718
6 changed files with 89 additions and 3 deletions
+4
View File
@@ -144,6 +144,10 @@ Selector_Expr :: struct {
field: ^Ident,
}
Implicit_Selector_Expr :: struct {
using node: Expr,
field: ^Ident,
}
Index_Expr :: struct {
using node: Expr,
+7
View File
@@ -2581,6 +2581,13 @@ parse_unary_expr :: proc(p: ^Parser, lhs: bool) -> ^ast.Expr {
ue.expr = expr;
return ue;
case token.Period:
op := advance_token(p);
field := parse_ident(p);
ise := ast.new(ast.Implicit_Selector_Expr, op.pos, field.end);
ise.field = field;
return ise;
}
return parse_atom_expr(p, parse_operand(p, lhs), lhs);
}