Skip to content

Fail fast on head identifier in syntax-tree class#810

Open
jackfirth wants to merge 1 commit into
masterfrom
fix-800-flattening-perf
Open

Fail fast on head identifier in syntax-tree class#810
jackfirth wants to merge 1 commit into
masterfrom
fix-800-flattening-perf

Conversation

@jackfirth

Copy link
Copy Markdown
Owner

Fixes #800.

The syntax-tree class parsed every subform recursively before checking the head identifier, so the four flattening rules descended entire subtrees only to reject most forms afterward. Moving the free-identifier=? check ahead of the subtree parse lets non-matching forms fail immediately.

Check the branch identifier before recursively parsing subtrees, so
forms whose head isn't the branch identifier no longer descend the
entire subtree only to be rejected afterward.

Fixes #800

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resyntax analyzed 1 file in this pull request and found no issues.

@github-actions

Copy link
Copy Markdown
Contributor

Docs preview: https://resyntax.notjack.space/preview/810/

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 95.319%. remained the same — fix-800-flattening-perf into master

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.

syntax-tree-based flattening rules dominate rule-checking time

2 participants