Generate contextualValue nodes; align Rust variant names with the derived rule#99
Merged
Merged
Conversation
This was referenced Jun 10, 2026
Merged
Member
Author
This was referenced Jun 10, 2026
Member
Author
Merge activity
|
…ived rule This PR brings the `contextualValue` category into the generator (10 nodes, 6 emittable inline unions, and the `RegisteredContextualValueNode` category union via the `RegisteredNodes` derive). All inline unions flow through the PR #6 derived rule with no per-union config. To keep the generator override-free, the Rust crate is updated to match the derived variant names: `PdaValuePda::{Linked, Nested}` becomes `{PdaLink, Pda}` (`pdaLinkNode` and `pdaNode` share only the `Node` suffix, so that's all the rule can strip), and the 23 `*ValueNode` variants of `InstructionInputValueNode` gain a `Value` suffix while `ProgramLink` stays unchanged (members share only `Node` as a common suffix, since `programLinkNode` mixes with value nodes). The `From<ValueNode>` / `TryFrom<\u2026 > for ValueNode` bridges in `shared/instruction_input_value_node.rs` are preserved and updated for the new variant names; the enum itself moves to `generated/contextual_value_nodes/`. `resolverValueNode.dependsOn` changes from `Option<Vec<ResolverDependency>>` to bare `Vec<ResolverDependency>` to match the optional-array convention every other node uses. Hand-written `contextual_value_nodes/*.rs` files shrink to constructors and `#[cfg(test)] mod tests`. The `RegisteredNodes` renderer is fixed to compute its variant-name strip suffix from the actual leaf members (`ValueNode`) rather than the union's own pascal-case name (`ContextualValueNode`); this was a latent bug that worked by coincidence for `value` but would have produced wrong variant names for `contextualValue`.
b8de79f to
ed60255
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This PR brings the
contextualValuecategory into the generator (10 nodes, 6 emittable inline unions, and theRegisteredContextualValueNodecategory union via theRegisteredNodesderive). All inline unions flow through the PR #6 derived rule with no per-union config. To keep the generator override-free, the Rust crate is updated to match the derived variant names:PdaValuePda::{Linked, Nested}becomes{PdaLink, Pda}(pdaLinkNodeandpdaNodeshare only theNodesuffix, so that's all the rule can strip), and the 23*ValueNodevariants ofInstructionInputValueNodegain aValuesuffix whileProgramLinkstays unchanged (members share onlyNodeas a common suffix, sinceprogramLinkNodemixes with value nodes). TheFrom<ValueNode>/TryFrom<\u2026 > for ValueNodebridges inshared/instruction_input_value_node.rsare preserved and updated for the new variant names; the enum itself moves togenerated/contextual_value_nodes/.resolverValueNode.dependsOnchanges fromOption<Vec<ResolverDependency>>to bareVec<ResolverDependency>to match the optional-array convention every other node uses. Hand-writtencontextual_value_nodes/*.rsfiles shrink to constructors and#[cfg(test)] mod tests. TheRegisteredNodesrenderer is fixed to compute its variant-name strip suffix from the actual leaf members (ValueNode) rather than the union's own pascal-case name (ContextualValueNode); this was a latent bug that worked by coincidence forvaluebut would have produced wrong variant names forcontextualValue.