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

Method matchNone

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

Source from the content-addressed store, hash-verified

248}
249
250func (p *Parser) matchNone() (*ast.None, error) {
251 l := p.lexer
252 if ok, err := l.match('_'); !ok || err != nil {
253 return nil, noEOF(err)
254 }
255 if ok, err := l.match(':'); !ok || err != nil {
256 if err == nil {
257 err = p.error("none value (_) must include type decorator")
258 }
259 return nil, err
260 }
261 if ok, err := l.match(':'); !ok || err != nil {
262 if err == nil {
263 err = p.error("none value (_) followed by malformed type decorator")
264 }
265 return nil, err
266 }
267 typ, err := p.matchTypeComponent()
268 if err != nil {
269 return nil, err
270 }
271 return &ast.None{
272 Kind: "None",
273 Type: typ,
274 }, nil
275}
276
277func (p *Parser) matchRecord() (*ast.Record, error) {
278 l := p.lexer

Callers 1

matchFieldMethod · 0.95

Calls 4

errorMethod · 0.95
matchTypeComponentMethod · 0.95
noEOFFunction · 0.70
matchMethod · 0.45

Tested by

no test coverage detected