mirror of
https://github.com/prometheus/prometheus
synced 2025-01-12 18:01:36 +00:00
8155cc4992
* Expose lexer item types We have generally agreed to expose AST types / values that are necessary to make sense of the AST outside of the promql package. Currently the `UnaryExpr`, `BinaryExpr`, and `AggregateExpr` AST nodes store the lexer item type to indicate the operator type, but since the individual item types aren't exposed, an external user of the package cannot determine the operator type. So this PR exposes them. Although not all item types are required to make sense of the AST (some are really only used in the lexer), I decided to expose them all here to be somewhat more consistent. Another option would be to not use lexer item types at all in AST nodes. The concrete motivation is my work on the PromQL->Flux transpiler, but this ought to be useful for other cases as well. Signed-off-by: Julius Volz <julius.volz@gmail.com> * Fix item type names in tests Signed-off-by: Julius Volz <julius.volz@gmail.com> |
||
---|---|---|
.. | ||
fuzz-data | ||
testdata | ||
ast.go | ||
bench_test.go | ||
engine_test.go | ||
engine.go | ||
functions_test.go | ||
functions.go | ||
fuzz.go | ||
lex_test.go | ||
lex.go | ||
parse_test.go | ||
parse.go | ||
printer_test.go | ||
printer.go | ||
promql_test.go | ||
quantile.go | ||
test_test.go | ||
test.go | ||
value.go |