Skip to content

Generate contextualValue nodes; align Rust variant names with the derived rule#99

Merged
lorisleiva merged 1 commit into
mainfrom
loris/spec-gen-contextual-value
Jun 10, 2026
Merged

Generate contextualValue nodes; align Rust variant names with the derived rule#99
lorisleiva merged 1 commit into
mainfrom
loris/spec-gen-contextual-value

Conversation

@lorisleiva

Copy link
Copy Markdown
Member

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.

lorisleiva commented Jun 10, 2026

Copy link
Copy Markdown
Member Author

Merge activity

  • Jun 10, 2:13 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jun 10, 2:27 PM UTC: Graphite rebased this pull request as part of a merge.
  • Jun 10, 2:27 PM UTC: @lorisleiva merged this pull request with Graphite.

@lorisleiva lorisleiva changed the base branch from loris/spec-gen-registered-nodes-union to graphite-base/99 June 10, 2026 14:24
@lorisleiva lorisleiva changed the base branch from graphite-base/99 to main June 10, 2026 14:25
…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`.
@lorisleiva lorisleiva force-pushed the loris/spec-gen-contextual-value branch from b8de79f to ed60255 Compare June 10, 2026 14:26
@lorisleiva lorisleiva merged commit f35c0fa into main Jun 10, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant