MCPcopy Create free account
hub / github.com/araddon/qlbridge / ParseExpression

Function ParseExpression

expr/parse.go:174–181  ·  view source on GitHub ↗

ParseExpression parse a single Expression, returning an Expression Node ParseExpression("5 * toint(item_name)")

(expressionText string)

Source from the content-addressed store, hash-verified

172// ParseExpression("5 * toint(item_name)")
173//
174func ParseExpression(expressionText string) (Node, error) {
175 l := lex.NewLexer(expressionText, lex.LogicalExpressionDialect)
176 pager := NewLexTokenPager(l)
177 t := newTree(pager)
178
179 // Parser panics on unexpected syntax, convert this into an err
180 return t.parse()
181}
182
183// MustParse parse a single Expression, returning an Expression Node
184// and panics if it cannot be parsed

Callers 13

TestParseExpressionsFunction · 0.92
TestNodePbFunction · 0.92
TestExprRoundTripFunction · 0.92
TestNodeJsonFunction · 0.92
TestIdentityNamesFunction · 0.92
TestOneOffsFunction · 0.92
TestValidationFunction · 0.92
TestBuiltinsFunction · 0.92
TestRunExprFunction · 0.92
BenchmarkVmFuncNewFunction · 0.92
parseShowMethod · 0.92
FromExprMethod · 0.85

Calls 4

NewLexerFunction · 0.92
NewLexTokenPagerFunction · 0.85
newTreeFunction · 0.85
parseMethod · 0.45

Tested by 10

TestParseExpressionsFunction · 0.74
TestNodePbFunction · 0.74
TestExprRoundTripFunction · 0.74
TestNodeJsonFunction · 0.74
TestIdentityNamesFunction · 0.74
TestOneOffsFunction · 0.74
TestValidationFunction · 0.74
TestBuiltinsFunction · 0.74
TestRunExprFunction · 0.74
BenchmarkVmFuncNewFunction · 0.74