Repository navigation
Prune affix template partials whose required slot cannot find its material #575
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -83,6 +83,26 @@ public ITraceManager TraceManager | |
|
|
||
| public int DeletionReapplications { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Whether affix template walks drop partials in which a required slot can no longer unapply because | ||
| /// the material it inserts is absent. See <see cref="RequiredSlotMaterial"/>. | ||
| /// </summary> | ||
| internal RequiredSlotLookaheadMode RequiredSlotLookahead { get; set; } = RequiredSlotLookaheadMode.On; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Minor: F3. Consumers of the package have no way to turn the prune off: it changes analysis for every one of them, defaults to |
||
|
|
||
| /// <summary> | ||
| /// Called in <see cref="RequiredSlotLookaheadMode.Shadow"/> with a kind and the template and slot it is about: | ||
| /// "fired" (the test is true for a required slot), "violated" (a rule of a fired slot then unapplied under | ||
| /// that partial) and "completed-under-fired" (the template walk completed with a fired slot on its path). | ||
| /// Any "violated" or "completed-under-fired" is a soundness failure. | ||
| /// </summary> | ||
| internal Action<string, AffixTemplate, int> RequiredSlotShadow { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Called after each required-slot check that unified, with the number of unifications it performed. | ||
| /// Null unless a diagnostic sets it; it may be called from several threads. | ||
| /// </summary> | ||
| internal Action<long> RequiredSlotCheckObserver { get; set; } | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FYI: F4. |
||
|
|
||
| public int MaxStemCount { get; set; } | ||
|
|
||
| /// <summary> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: F1. Tracing loses the failure reason: with the prune on by default, a pruned template now traces as
TemplateAnalysisInputthen a null output withFailureReason.None, and the per-rule not-unapplied entries that showed which slot failed are gone.Apply_Tracing_ShowsAPrunedTemplateAsAFailedOutputlocks this in forsagufz. Skip the prune whileTraceManager.IsTracing, or give it its ownFailureReason.