Skip to main content

Module rewrite

Module rewrite 

Source
Expand description

AST rewrite phase: scheduling, rule application, and eliminated-form checks.

Re-exports§

pub use level_set::NormalizationLevelSet;
pub use plan::Plan;
pub use plan::PlanBuildError;
pub use plan::RuleAvailabilityFailure;
pub use rule::NormalizationLevel;
pub use rule::RewriteRule;
pub use rule::RuleConsumes;
pub use rule::RuleEffect;
pub use rule::RuleFidelity;
pub use rule::RuleKey;
pub use rule::RuleMeta;
pub use rule::RuleProduces;
pub use rule::RuleTarget;
pub use rule::RuleTargetKey;
pub use rule::RuleTargetKind;
pub use rule_context::CommandView;
pub use rule_context::DeclarativeView;
pub use rule_context::EnvironmentView;
pub use rule_context::InfixView;
pub use rule_context::RuleContext;

Modules§

helpers
Convenience constructors for building AST argument slots and nodes.
level_set
Bitset of rewrite normalization levels. Const-friendly and runtime-mutable.
plan
Compiled rewrite plan: filtered rules and eliminated forms.
rule
Rule trait and metadata for the rewrite phase.
rule_context
Rule context and typed node views for rule matching.
rules
Builtin rewrite rule registry (auto-generated).

Structs§

ContractViolation
A single eliminated-form contract violation found in an AST.
RewriteReport
Accumulates statistics across an entire rewrite pass.
RewriteRuleStat
Tracks how often a specific rule changed the AST or skipped after a scheduling target match.

Enums§

PackageName
RewriteError
Top-level errors produced by the Rewrite phase.
RuleError
Errors reported by individual rules during application.

Functions§

all_rules
Returns every registered rewrite rule.
collect_eliminated_violations
Collects all eliminated-form contract violations currently present in ast.
run
Applies rewrite rules to an AST and records what changed.