ParseExpression parse a single Expression, returning an Expression Node ParseExpression("5 * toint(item_name)")
(expressionText string)
| 172 | // ParseExpression("5 * toint(item_name)") |
| 173 | // |
| 174 | func 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 |