-
Notifications
You must be signed in to change notification settings - Fork 211
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
in syntax templates don't greedily tokenize dollar before curly brace #732
Comments
So you're saying this should be tokenized as If so, I would find this behavior surprising as it is at odds w/ template literal syntax. |
I also would find that behavior surprising...it's the current behavior :) syntax m = function (ctx) {
return #`foo${x}`;
}
m expands to: foo$;
{
x;
} Sorry for the unclear issue description. Was in a rush the other day. |
Haha! The title is a directive, not a description. I know what's going on and think I have a solution. I'll check it out tonight. |
It's never as easy as I think. The source of the problem is simple. Syntax templates are being lexed as regular source strings, bookended by My first thought was to make Another strategy is to tokenize syntax templates just as we do string templates. Then do a second pass and run the template elements through the reader. This might work as a hack, but source information (line & column number) is gonna be all messed up. The "correct" answer is probably to add multi-character dispatch. It looks like more and more weight is building up to a rewrite of the reader. As soon as things die down a bit at work I plan to prototype something in PureScript using parser combinators. |
eg:
#`foo${...}`
The text was updated successfully, but these errors were encountered: