MCPcopy Create free account
hub / github.com/hashintel/hash / parse

Method parse

libs/@local/hashql/compiletest/src/pipeline.rs:120–130  ·  view source on GitHub ↗

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]>,
    )

Source from the content-addressed store, hash-verified

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 ///

Callers

nothing calls this directly

Calls 3

map_errMethod · 0.80
parse_exprMethod · 0.80
as_refMethod · 0.45

Tested by

no test coverage detected