Parses J-Expr source bytes into an AST expression. # Errors Returns a diagnostic if the input is not valid J-Expr syntax.
(
&mut self,
content: impl AsRef<[u8]>,
)
| 118 | /// |
| 119 | /// Returns a diagnostic if the input is not valid J-Expr syntax. |
| 120 | pub fn parse( |
| 121 | &mut self, |
| 122 | content: impl AsRef<[u8]>, |
| 123 | ) -> Result<hashql_ast::node::expr::Expr<'heap>, BoxedDiagnostic<'static, SpanId>> { |
| 124 | let mut parser = hashql_syntax_jexpr::Parser::new(self.heap, &mut self.spans); |
| 125 | |
| 126 | parser |
| 127 | .parse_expr(content.as_ref()) |
| 128 | .map_err(Diagnostic::generalize) |
| 129 | .map_err(Diagnostic::boxed) |
| 130 | } |
| 131 | |
| 132 | /// Lowers an AST expression through HIR into MIR. |
| 133 | /// |
nothing calls this directly
no test coverage detected