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

Method matchValue

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

Source from the content-addressed store, hash-verified

38}
39
40func (p *Parser) matchValue() (ast.Value, error) {
41 if val, err := p.matchRecord(); val != nil || err != nil {
42 return p.decorate(val, err)
43 }
44 if val, err := p.matchArray(); val != nil || err != nil {
45 return p.decorate(val, err)
46 }
47 if val, err := p.matchSetOrMap(); val != nil || err != nil {
48 return p.decorate(val, err)
49 }
50 if val, err := p.matchTypeValue(); val != nil || err != nil {
51 return p.decorate(val, err)
52 }
53 // Primitive comes last as the other matchers short-circuit more
54 // efficiently on sentinel characters.
55 if val, err := p.matchPrimitive(); val != nil || err != nil {
56 return p.decorate(val, err)
57 }
58 name, err := p.matchIdentifier()
59 if err != nil {
60 return nil, noEOF(err)
61 }
62 if val, err := p.matchFusion(name); val != nil || err != nil {
63 return p.decorate(val, err)
64 }
65 if val, err := p.matchError(name); val != nil || err != nil {
66 return p.decorate(val, err)
67 }
68 return nil, nil
69}
70
71func anyAsValue(any ast.Any) *ast.ImpliedValue {
72 return &ast.ImpliedValue{

Callers 5

ParseValueMethod · 0.95
matchValueListMethod · 0.95
parseEntryMethod · 0.95
matchErrorMethod · 0.95
matchFusionMethod · 0.95

Calls 10

matchRecordMethod · 0.95
decorateMethod · 0.95
matchArrayMethod · 0.95
matchSetOrMapMethod · 0.95
matchTypeValueMethod · 0.95
matchPrimitiveMethod · 0.95
matchIdentifierMethod · 0.95
matchFusionMethod · 0.95
matchErrorMethod · 0.95
noEOFFunction · 0.70

Tested by

no test coverage detected