(which string)
| 295 | } |
| 296 | |
| 297 | func (p *Parser) matchTypeBody(which string) (ast.Type, error) { |
| 298 | l := p.lexer |
| 299 | ok, err := l.match('(') |
| 300 | if !ok { |
| 301 | return nil, p.errorf("no opening parenthesis in %s type", which) |
| 302 | } |
| 303 | if err != nil { |
| 304 | return nil, err |
| 305 | } |
| 306 | typ, err := p.matchType() |
| 307 | if err != nil { |
| 308 | return nil, err |
| 309 | } |
| 310 | ok, err = l.match(')') |
| 311 | if err != nil { |
| 312 | return nil, err |
| 313 | } |
| 314 | if !ok { |
| 315 | return nil, p.errorf("mismatched parentheses while parsing %s type", which) |
| 316 | } |
| 317 | return typ, nil |
| 318 | } |
| 319 | |
| 320 | func (p *Parser) matchTypeUnion(first ast.Type) (*ast.TypeUnion, error) { |
| 321 | l := p.lexer |
no test coverage detected