You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e9de618
Browse filesBrowse the repository at this point in the historyBrowse files
@@ -600,14 +585,10 @@ let lang = simple::LanguageSpec {
600
585
A single-phase config is just `.add_phase(...)` called once. Phase names
601
586
appear in error messages so you can tell which phase failed.
602
587
603
-
There are two kinds of phases:
604
-
-**Repeating**:
605
-
Each node is re-processed until none of the rules in the phase matches.
606
-
When a node no longer matches any rules, its children are recursively processed. In practice this is used to desugar or simplify an AST, while staying mostly within the same schema.
607
-
-**One-shot**:
608
-
Each node is processed by the first matching rule, and the engine panics if no rule matches.
609
-
Rules are then recursively applied to every captured node.
610
-
In practice this is used when translating from one AST schema to another, where an exhaustive match is required.
588
+
Every phase uses one-shot translation: each visited input node is processed by
589
+
the first matching rule, captured nodes are recursively translated, and the
590
+
phase errors if no rule matches. Output nodes are not reprocessed in the same
591
+
phase.
611
592
612
593
The same YAML node-types is used for both the runtime yeast `Schema` (so
613
594
rules can refer to output-only kinds and fields) and TRAP validation (it
@@ -645,8 +626,7 @@ let translation_rules: Vec<yeast::Rule> = yeast::rules! {
645
626
Each comma-separated item in the bracketed list may be:
646
627
647
628
- A **bare rule body**`(query) => (template)` — no `rule!(...)` wrapper.
648
-
- An explicit `rule!(...)` invocation, with optional postfix calls such
649
-
as `rule!(...).repeated()`.
629
+
- An explicit `rule!(...)` invocation.
650
630
- Any other expression returning a `Rule` (helper functions, etc.).
651
631
652
632
Schema paths are resolved relative to the consuming crate's
0 commit comments