Skip to content

Only match syntax-wrapped outputs in define-syntax-parser shortcut#791

Merged
jackfirth merged 1 commit into
masterfrom
fix-define-syntax-parser-syntax-loc
Jul 7, 2026
Merged

Only match syntax-wrapped outputs in define-syntax-parser shortcut#791
jackfirth merged 1 commit into
masterfrom
fix-define-syntax-parser-syntax-loc

Conversation

@jackfirth

@jackfirth jackfirth commented Jul 7, 2026

Copy link
Copy Markdown
Owner

Fixes #759.

The define-syntax-parser-to-define-syntax-parse-rule-simple rule
matched any single-clause define-syntax-parser and stripped a syntax
wrapper from body forms only if one was present. A clause body ending
in (syntax/loc ...) or any other non-template expression got inserted
into the define-syntax-parse-rule output as a raw template, producing
broken code. Now the rule only matches when the last body form is
wrapped in syntax, with preceding forms matched as pattern directives,
mirroring the define-syntax rule in the same module.

Fixes #759.

Co-Authored-By: Claude Fable 5 <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 2 files in this pull request and found no issues.

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 93.885% (+0.007%) from 93.878% — fix-define-syntax-parser-syntax-loc into master

@jackfirth jackfirth merged commit e1402dc into master Jul 7, 2026
7 checks passed
@jackfirth jackfirth deleted the fix-define-syntax-parser-syntax-loc branch July 7, 2026 07:55
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.

define-syntax-parser-to-define-syntax-parse-rule-simple ignores syntax/loc on the output

2 participants