MCPcopy Create free account
hub / github.com/brimdata/super / matchTypeEnumBody

Method matchTypeEnumBody

sup/parser-types.go:355–375  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

353}
354
355func (p *Parser) matchTypeEnumBody() (*ast.TypeEnum, error) {
356 l := p.lexer
357 if ok, err := l.match('('); !ok || err != nil {
358 return nil, errors.New("no opening parenthesis in enum type")
359 }
360 fields, err := p.matchEnumSymbols()
361 if err != nil {
362 return nil, err
363 }
364 ok, err := l.match(')')
365 if err != nil {
366 return nil, err
367 }
368 if !ok {
369 return nil, p.error("mismatched parentheses while parsing enum type")
370 }
371 return &ast.TypeEnum{
372 Kind: "TypeEnum",
373 Symbols: fields,
374 }, nil
375}
376
377func (p *Parser) matchEnumSymbols() ([]*ast.Text, error) {
378 l := p.lexer

Callers 1

matchTypeNameMethod · 0.95

Calls 4

matchEnumSymbolsMethod · 0.95
errorMethod · 0.95
NewMethod · 0.80
matchMethod · 0.45

Tested by

no test coverage detected