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

Method matchRecord

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

Source from the content-addressed store, hash-verified

275}
276
277func (p *Parser) matchRecord() (*ast.Record, error) {
278 l := p.lexer
279 if ok, err := l.match('{'); !ok || err != nil {
280 return nil, noEOF(err)
281 }
282 fields, err := p.matchFields()
283 if err != nil {
284 return nil, err
285 }
286 ok, err := l.match('}')
287 if err != nil {
288 return nil, err
289 }
290 if !ok {
291 return nil, p.error("mismatched braces while parsing record type")
292 }
293 return &ast.Record{
294 Kind: "Record",
295 Fields: fields,
296 }, nil
297}
298
299func (p *Parser) matchFields() ([]ast.Field, error) {
300 l := p.lexer

Callers 1

matchValueMethod · 0.95

Calls 4

matchFieldsMethod · 0.95
errorMethod · 0.95
noEOFFunction · 0.70
matchMethod · 0.45

Tested by

no test coverage detected