-
Notifications
You must be signed in to change notification settings - Fork 159
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 error within macro using $(expr)
#26
Comments
As a test I tried changing it to |
The workaround doesn't seem to always work, not sure exactly what triggers the error but when I tried using it in some more complicated macros I would sometimes get I guess the best fix would be very similar to the fix for #21. Although with this it has the additional problem that it's in the usage of the macro, rather than the definition that you'd have to stop using let s = to_string!(p { "Hi, " #splice (name) "!" }); in the above example. Maybe it would be worth dropping |
I tried a basic replacement let (animal, call) = ("cow", "moo");
let s = to_string!(p {
"The " #animal " says " #call
} it would fail to parse (or potentially parse with an incorrect output depending on the exact context). I think this is probably ok as it can be worked around with let (animal, call) = ("cow", "moo");
let s = to_string!(p {
"The " #animal " says " #(call)
} and I assume there won't be many special cases added. Any special case where it uses a keyword (like |
To be honest the only reason why I used Without that constraint, I think it's better to use Actually it would be cool to have What do you think about these ideas? |
Those both sound good to me, I could open a PR with the changes in a couple of hours if you want (unless you wish to do it yourself)? |
Just encountered a bug very similar to #23, just using
$(expr)
inside the html instead.gives
The text was updated successfully, but these errors were encountered: