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