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

Method matchArray

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

Source from the content-addressed store, hash-verified

383}
384
385func (p *Parser) matchArray() (*ast.Array, error) {
386 l := p.lexer
387 if ok, err := l.match('['); !ok || err != nil {
388 return nil, noEOF(err)
389 }
390 vals, err := p.matchValueList()
391 if err != nil {
392 return nil, err
393 }
394 ok, err := l.match(']')
395 if err != nil {
396 return nil, err
397 }
398 if !ok {
399 return nil, p.error("mismatched brackets while parsing array type")
400 }
401 return &ast.Array{
402 Kind: "Array",
403 Elements: vals,
404 }, nil
405}
406
407func (p *Parser) matchValueList() ([]ast.Value, error) {
408 l := p.lexer

Callers 1

matchValueMethod · 0.95

Calls 4

matchValueListMethod · 0.95
errorMethod · 0.95
noEOFFunction · 0.70
matchMethod · 0.45

Tested by

no test coverage detected