Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

syntax/parse: syntax-parse itself does not properly report errors in terms of a different name if it is renamed #1909

Closed
lexi-lambda opened this issue Dec 13, 2017 · 0 comments · Fixed by #1911

Comments

@lexi-lambda
Copy link
Member

If I rename syntax-parse when importing it, then misuse it:

#lang racket
(require (rename-in syntax/parse [syntax-parse syntax-case]))
(syntax-case)

…I get an error in terms of syntax-parse, not my new name:

syntax-parse: bad syntax
  in: (syntax-parse)

This is absolutely super nitpicky. :) But macros defined by syntax-parse explicitly avoid this problem, so it seems like syntax-parse should, too.

lexi-lambda added a commit to lexi-lambda/racket that referenced this issue Dec 13, 2017
The dance that syntax/parse performs to lazily load its implementation
rewrites uses of syntax/parse macros in such a way that their original
names were discarded, which shows up in error messages. This arranges
for users’ names to be preserved.

fixes racket#1909
lexi-lambda added a commit to lexi-lambda/racket that referenced this issue Dec 13, 2017
The dance that syntax/parse performs to lazily load its implementation
rewrites uses of syntax/parse macros in such a way that their original
names were discarded, which shows up in error messages. This arranges
for users’ names to be preserved.

fixes racket#1909
lexi-lambda added a commit to lexi-lambda/racket that referenced this issue Dec 13, 2017
The dance that syntax/parse performs to lazily load its implementation
rewrites uses of syntax/parse macros in such a way that their original
names were discarded, which shows up in error messages. By simply
invoking the underlying transformer directly in the proxy macro instead
of expanding to a rewritten use, users’ names can be preserved.

fixes racket#1909
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 a pull request may close this issue.

1 participant