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

Method parseEntry

sup/parser-values.go:516–541  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

514}
515
516func (p *Parser) parseEntry() (*ast.Entry, error) {
517 key, err := p.matchValue()
518 if err != nil {
519 return nil, err
520 }
521 if key == nil {
522 // no match
523 return nil, nil
524 }
525 ok, err := p.lexer.match(':')
526 if err != nil {
527
528 return nil, err
529 }
530 if !ok {
531 return nil, p.error("no colon found after map key while parsing map entry")
532 }
533 val, err := p.ParseValue()
534 if err != nil {
535 return nil, err
536 }
537 return &ast.Entry{
538 Key: key,
539 Value: val,
540 }, nil
541}
542
543func (p *Parser) matchError(name string) (*ast.Error, error) {
544 if name != "error" {

Callers 1

matchMapEntriesMethod · 0.95

Calls 4

matchValueMethod · 0.95
errorMethod · 0.95
ParseValueMethod · 0.95
matchMethod · 0.45

Tested by

no test coverage detected