pub struct Query<'a> { /* private fields */ }Implementations§
Source§impl<'a> Query<'a>
impl<'a> Query<'a>
Sourcepub fn is_qis_trigger(&self, q: &QuantifiedExpr) -> bool
pub fn is_qis_trigger(&self, q: &QuantifiedExpr) -> bool
Check if a quantified expression triggers QIS.
Sourcepub fn qis_trigger(&self, q: &QuantifiedExpr) -> Option<&QisTrigger<'a>>
pub fn qis_trigger(&self, q: &QuantifiedExpr) -> Option<&QisTrigger<'a>>
Get QIS trigger info for a quantified expression.
Sourcepub fn is_single_capture(&self, def_name: &str, capture_name: &str) -> bool
pub fn is_single_capture(&self, def_name: &str, capture_name: &str) -> bool
Check if this capture is the single propagating capture for its definition. Only that specific capture should unwrap (skip Field effect).
Sourcepub fn is_multi_capture_def(&self, name: &str) -> bool
pub fn is_multi_capture_def(&self, name: &str) -> bool
Check if definition has 2+ propagating captures (needs struct wrapping).
Source§impl<'a> Query<'a>
impl<'a> Query<'a>
Sourcepub fn new(source: &'a str) -> Self
pub fn new(source: &'a str) -> Self
Create a new query from source text.
Call exec to run analysis passes.
Sourcepub fn with_exec_fuel(self, limit: Option<u32>) -> Self
pub fn with_exec_fuel(self, limit: Option<u32>) -> Self
Set execution fuel limit. None = infinite.
Execution fuel never replenishes. It protects against large inputs.
Returns error from exec when exhausted.
Sourcepub fn with_recursion_fuel(self, limit: Option<u32>) -> Self
pub fn with_recursion_fuel(self, limit: Option<u32>) -> Self
Set recursion depth limit. None = infinite.
Recursion fuel restores when exiting recursion. It protects against
deeply nested input. Returns error from exec when exhausted.
Sourcepub fn exec(self) -> Result<Self>
pub fn exec(self) -> Result<Self>
Run all analysis passes.
Returns Err if fuel limits are exceeded.
Syntax/semantic diagnostics are collected and accessible via diagnostics.
Sourcepub fn build_graph(self) -> Self
pub fn build_graph(self) -> Self
Build the transition graph for compilation.
This is an optional step after exec. It detects QIS triggers,
constructs the graph, runs epsilon elimination, and infers types.
Only runs if the query is valid (no errors from previous passes).
Sourcepub fn build_graph_with_pre_opt_dump(
self,
root_kind: Option<&'a str>,
) -> (Self, String)
pub fn build_graph_with_pre_opt_dump( self, root_kind: Option<&'a str>, ) -> (Self, String)
Build graph and return dump of graph before optimization (for debugging).
If root_kind is provided, definitions are wrapped before dumping.
Sourcepub fn graph(&self) -> &BuildGraph<'a>
pub fn graph(&self) -> &BuildGraph<'a>
Access the constructed graph.
Sourcepub fn wrap_with_root(self, root_kind: &'a str) -> Self
pub fn wrap_with_root(self, root_kind: &'a str) -> Self
Wrap definitions that don’t already match the root node kind.
Call this after build_graph() to allow queries like (function_declaration)
to work when the interpreter starts at tree root (e.g., program).
The root_kind should be the language’s root node kind (e.g., “program” for JS).
Sourcepub fn dead_nodes(&self) -> &HashSet<NodeId>
pub fn dead_nodes(&self) -> &HashSet<NodeId>
Access the set of dead nodes (eliminated by optimization).
Sourcepub fn type_info(&self) -> &TypeInferenceResult<'a>
pub fn type_info(&self) -> &TypeInferenceResult<'a>
Access the type inference result.
Sourcepub fn diagnostics_raw(&self) -> Diagnostics
pub fn diagnostics_raw(&self) -> Diagnostics
All diagnostics combined from all passes (unfiltered).
Use this for debugging or when you need to see all diagnostics including cascading errors.
Sourcepub fn diagnostics(&self) -> Diagnostics
pub fn diagnostics(&self) -> Diagnostics
All diagnostics combined from all passes.
Returns diagnostics with cascading errors suppressed.
For raw access, use diagnostics_raw.
Sourcepub fn is_valid(&self) -> bool
pub fn is_valid(&self) -> bool
Query is valid if there are no error-severity diagnostics (warnings are allowed).
Sourcepub fn has_type_errors(&self) -> bool
pub fn has_type_errors(&self) -> bool
Check if graph compilation produced type errors.