parser: add incomplete parsing of method functions

This commit is contained in:
Luna 2019-08-26 20:21:39 -03:00
parent e2f7343242
commit 5f8d9da6fa

View file

@ -390,6 +390,23 @@ pub const Parser = struct {
errdefer param_list.deinit(); errdefer param_list.deinit();
_ = try self.consumeSingle(.Fn); _ = try self.consumeSingle(.Fn);
if (self.check(.LeftParen)) {
_ = try self.consume(.LeftParen);
var mutable_ref: bool = false;
const method_var = try self.consume(.Identifier);
if (self.check(.Mut)) {
_ = try self.consume(.Mut);
mutable_ref = true;
}
const method_typ = try self.consume(.Identifier);
_ = try self.consume(.RightParen);
}
const name = try self.consumeSingle(.Identifier); const name = try self.consumeSingle(.Identifier);
_ = try self.consumeSingle(.LeftParen); _ = try self.consumeSingle(.LeftParen);