Skip to content

Add original_node and controller_expressions bindings - #9

Merged
DavidSagan merged 2 commits into
mainfrom
original-node
Nov 12, 2026
Merged

DavidSagan merged 2 commits into
mainfrom
original-node

Conversation

@DavidSagan

@DavidSagan DavidSagan commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Python bindings for original_node and controller_expressions from pals-project/PALSParserCpp#99.

original_node(lat, node) returns the node of lat.original that one node of lat.expanded, lat.full_expanded, lat.adjunct or lat.combined came from. It returns None for a value the parser computed and for one an ABSOLUTE controller drives. Every expanded value is a number; this leads back to the expression it was written as, so a program can tell whether it was delayed (expr(...)). A value written by a set leads to that set's value.

Documented in docs/src/guide/lattices.md and listed in docs/src/api.md.

controller_expressions(lat, node) lists every controller driving a parameter, ABSOLUTE or RELATIVE: each controls entry's expression node in lat.original, in evaluation order. Several controllers may drive one parameter, so this is a list. Three get_parent steps from an expression reach its controller.

Tests: 124 pass (5 new) against PALSParserCpp main.

🤖 Generated with Claude Code

@github-actions

Copy link
Copy Markdown
Contributor

📖 Documentation preview for this PR: https://pals-project.github.io/PALSParserPy/previews/PR9/

Rebuilt on every push; removed automatically when the PR closes.

@DavidSagan DavidSagan changed the title Add original_node: the original text behind one value Add original_node and controller_expressions bindings Nov 12, 2026
@DavidSagan
DavidSagan deleted the branch spec-sync-nov2026 November 12, 2026 03:20
@DavidSagan DavidSagan closed this Nov 12, 2026
DavidSagan and others added 2 commits November 11, 2026 22:21
original_node(lat, node) wraps PALSParserCpp's original_node: the node of
lat.original a node of expanded, full_expanded, adjunct or combined came
from, or None for a computed or controller-driven value. A program reads it
to see the expression behind a number, for instance whether it was delayed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
controller_expressions(lat, node) wraps PALSParserCpp's call of that name:
for each controls entry reaching a parameter, ABSOLUTE or RELATIVE, its
`expression` node in lat.original, in evaluation order. A parameter may be
driven by several controllers, hence a list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@DavidSagan DavidSagan reopened this Nov 12, 2026
@DavidSagan
DavidSagan changed the base branch from spec-sync-nov2026 to main November 12, 2026 03:21
@DavidSagan
DavidSagan merged commit 91752df into main Nov 12, 2026
5 checks passed
@DavidSagan
DavidSagan deleted the original-node branch November 12, 2026 03:22
github-actions Bot added a commit that referenced this pull request Nov 12, 2026
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