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

Function ParseValue

sup/sup.go:71–82  ·  view source on GitHub ↗
(sctx *super.Context, sup string)

Source from the content-addressed store, hash-verified

69}
70
71func ParseValue(sctx *super.Context, sup string) (super.Value, error) {
72 zp := NewParser(strings.NewReader(sup))
73 ast, err := zp.ParseValue()
74 if err != nil {
75 return super.Null, err
76 }
77 val, err := NewAnalyzer().ConvertValue(sctx, ast)
78 if err != nil {
79 return super.Null, err
80 }
81 return Build(scode.NewBuilder(), val)
82}
83
84func MustParseValue(sctx *super.Context, sup string) super.Value {
85 val, err := ParseValue(sctx, sup)

Callers 15

maybeEvalMethod · 0.92
exprMethod · 0.92
compileExprMethod · 0.92
compileSearchMethod · 0.92
noneTypeMethod · 0.92
compileVamExprMethod · 0.92
compileVamSearchMethod · 0.92
CompileBufferFilterFunction · 0.92
isFieldEqualOrInFunction · 0.92
TestBSUPValueFieldFunction · 0.92
TestParseValueErrorsFunction · 0.92

Calls 7

ParseValueMethod · 0.95
NewBuilderFunction · 0.92
NewAnalyzerFunction · 0.85
ConvertValueMethod · 0.80
NewParserFunction · 0.70
BuildFunction · 0.70
NewReaderMethod · 0.45

Tested by 5

TestBSUPValueFieldFunction · 0.74
TestParseValueErrorsFunction · 0.74
runCasesHelperFunction · 0.74
TestCSUPBatchBugFunction · 0.74