| ... | @@ -113,6 +113,7 @@ pub const Tree = struct { | ... | @@ -113,6 +113,7 @@ pub const Tree = struct { |
| 113 | | 113 | |
| 114 | pub const Error = union(enum) { | 114 | pub const Error = union(enum) { |
| 115 | InvalidToken: InvalidToken, | 115 | InvalidToken: InvalidToken, |
| | 116 | InvalidAmpersandAmpersand: InvalidAmpersandAmpersand, |
| 116 | ExpectedContainerMembers: ExpectedContainerMembers, | 117 | ExpectedContainerMembers: ExpectedContainerMembers, |
| 117 | ExpectedStringLiteral: ExpectedStringLiteral, | 118 | ExpectedStringLiteral: ExpectedStringLiteral, |
| 118 | ExpectedIntegerLiteral: ExpectedIntegerLiteral, | 119 | ExpectedIntegerLiteral: ExpectedIntegerLiteral, |
| ... | @@ -161,6 +162,7 @@ pub const Error = union(enum) { | ... | @@ -161,6 +162,7 @@ pub const Error = union(enum) { |
| 161 | switch (self.*) { | 162 | switch (self.*) { |
| 162 | // TODO https://github.com/ziglang/zig/issues/683 | 163 | // TODO https://github.com/ziglang/zig/issues/683 |
| 163 | @TagType(Error).InvalidToken => |*x| return x.render(tokens, stream), | 164 | @TagType(Error).InvalidToken => |*x| return x.render(tokens, stream), |
| | 165 | @TagType(Error).InvalidAmpersandAmpersand => |*x| return x.render(tokens, stream), |
| 164 | @TagType(Error).ExpectedContainerMembers => |*x| return x.render(tokens, stream), | 166 | @TagType(Error).ExpectedContainerMembers => |*x| return x.render(tokens, stream), |
| 165 | @TagType(Error).ExpectedStringLiteral => |*x| return x.render(tokens, stream), | 167 | @TagType(Error).ExpectedStringLiteral => |*x| return x.render(tokens, stream), |
| 166 | @TagType(Error).ExpectedIntegerLiteral => |*x| return x.render(tokens, stream), | 168 | @TagType(Error).ExpectedIntegerLiteral => |*x| return x.render(tokens, stream), |
| ... | @@ -211,6 +213,7 @@ pub const Error = union(enum) { | ... | @@ -211,6 +213,7 @@ pub const Error = union(enum) { |
| 211 | switch (self.*) { | 213 | switch (self.*) { |
| 212 | // TODO https://github.com/ziglang/zig/issues/683 | 214 | // TODO https://github.com/ziglang/zig/issues/683 |
| 213 | @TagType(Error).InvalidToken => |x| return x.token, | 215 | @TagType(Error).InvalidToken => |x| return x.token, |
| | 216 | @TagType(Error).InvalidAmpersandAmpersand => |x| return x.token, |
| 214 | @TagType(Error).ExpectedContainerMembers => |x| return x.token, | 217 | @TagType(Error).ExpectedContainerMembers => |x| return x.token, |
| 215 | @TagType(Error).ExpectedStringLiteral => |x| return x.token, | 218 | @TagType(Error).ExpectedStringLiteral => |x| return x.token, |
| 216 | @TagType(Error).ExpectedIntegerLiteral => |x| return x.token, | 219 | @TagType(Error).ExpectedIntegerLiteral => |x| return x.token, |
| ... | @@ -291,6 +294,7 @@ pub const Error = union(enum) { | ... | @@ -291,6 +294,7 @@ pub const Error = union(enum) { |
| 291 | pub const ExpectedDerefOrUnwrap = SingleTokenError("Expected pointer dereference or optional unwrap, found {}"); | 294 | pub const ExpectedDerefOrUnwrap = SingleTokenError("Expected pointer dereference or optional unwrap, found {}"); |
| 292 | pub const ExpectedSuffixOp = SingleTokenError("Expected pointer dereference, optional unwrap, or field access, found {}"); | 295 | pub const ExpectedSuffixOp = SingleTokenError("Expected pointer dereference, optional unwrap, or field access, found {}"); |
| 293 | | 296 | |
| | 297 | pub const InvalidAmpersandAmpersand = SimpleError("Invalid token '&&', 'and' performs boolean AND"); |
| 294 | pub const ExpectedParamType = SimpleError("Expected parameter type"); | 298 | pub const ExpectedParamType = SimpleError("Expected parameter type"); |
| 295 | pub const ExpectedPubItem = SimpleError("Pub must be followed by fn decl, var decl, or container member"); | 299 | pub const ExpectedPubItem = SimpleError("Pub must be followed by fn decl, var decl, or container member"); |
| 296 | pub const UnattachedDocComment = SimpleError("Unattached documentation comment"); | 300 | pub const UnattachedDocComment = SimpleError("Unattached documentation comment"); |