[−][src]Function promql::parse
pub fn parse(
e: &[u8],
allow_periods: bool
) -> Result<Node, Err<CompleteByteSlice>>
Parse expression string into an AST.
This parser operates on byte sequence instead of &str
because of the fact that PromQL, like Go, allows raw byte sequences to be included in the string literals (e.g. {omg='∞'}
is equivalent to both {omg='\u221e'}
and {omg='\xe2\x88\x9e'}
).
Set allow_periods
to true
to allow vector names with periods (like foo.bar
).