diff --git a/examples/hello.v b/examples/hello.v index 5167113..377d337 100644 --- a/examples/hello.v +++ b/examples/hello.v @@ -53,4 +53,4 @@ fn main(a int) int { v()()() } -fn voidfunc() {} +fn (v Typ) voidfunc() {} diff --git a/src/parser.zig b/src/parser.zig index e03a93d..f03682a 100644 --- a/src/parser.zig +++ b/src/parser.zig @@ -392,19 +392,19 @@ pub const Parser = struct { _ = try self.consumeSingle(.Fn); if (self.check(.LeftParen)) { - _ = try self.consume(.LeftParen); + _ = try self.consumeSingle(.LeftParen); var mutable_ref: bool = false; - const method_var = try self.consume(.Identifier); + const method_var = try self.consumeSingle(.Identifier); if (self.check(.Mut)) { - _ = try self.consume(.Mut); + _ = try self.consumeSingle(.Mut); mutable_ref = true; } - const method_typ = try self.consume(.Identifier); + const method_typ = try self.consumeSingle(.Identifier); - _ = try self.consume(.RightParen); + _ = try self.consumeSingle(.RightParen); } const name = try self.consumeSingle(.Identifier);