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

Function ParsePrimitive

sup/parser-values.go:615–626  ·  view source on GitHub ↗
(typeText, valText string)

Source from the content-addressed store, hash-verified

613}
614
615func ParsePrimitive(typeText, valText string) (super.Value, error) {
616 typ := super.LookupPrimitive(typeText)
617 if typ == nil {
618 return super.Null, fmt.Errorf("no such type: %s", typeText)
619 }
620 var b scode.Builder
621 if err := BuildPrimitive(&b, Primitive{Type: typ, Text: valText}); err != nil {
622 return super.Null, err
623 }
624 it := b.Bytes().Iter()
625 return super.NewValue(typ, it.Next()), nil
626}

Callers 2

exprMethod · 0.92
quoteStringFunction · 0.92

Calls 6

BytesMethod · 0.95
LookupPrimitiveFunction · 0.92
NewValueFunction · 0.92
BuildPrimitiveFunction · 0.85
IterMethod · 0.80
NextMethod · 0.45

Tested by

no test coverage detected