lift restraint on Calls being only made to Variables

This commit is contained in:
Luna 2019-08-26 13:17:25 -03:00
parent 0ecfb75081
commit d55137a7c7
2 changed files with 1 additions and 6 deletions

View File

@ -46,5 +46,5 @@ fn main(a int) int {
y: 20 y: 20
} }
println(p.x) println(egg.scramble(3).with(cheddar))
} }

View File

@ -731,11 +731,6 @@ pub const Parser = struct {
printer.printExpr(expr); printer.printExpr(expr);
if (self.check(.LeftParen)) { if (self.check(.LeftParen)) {
if (ast.ExprType(expr.*) != .Variable) {
self.doError("cannot call non-variable {}", ast.ExprType(expr.*));
return Result.CompileError;
}
_ = try self.consumeSingle(.LeftParen); _ = try self.consumeSingle(.LeftParen);
expr = try self.finishCall(expr); expr = try self.finishCall(expr);
} else if (self.check(.Dot)) { } else if (self.check(.Dot)) {