-
-
Notifications
You must be signed in to change notification settings - Fork 175
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
Impossible character escapes in strings #290
Comments
Well, I figured out that the correct answer was |
Well, it makes sense. The Where is the problem in the manual? I agree that the error messages aren't always helpful, but it's quite hard to get the parser to say useful things in some cases... |
Well, the manual states that In retrospect, |
Well, I think I know what's happening.
The parser sees, after the expansion:
As far as I remember, strings can't be split into multiple lines. So yeah, there is an unterminated string there. |
That's also my guess, although the parser actually attempts to escape the line feed, instead of calling it an unterminated string. But that's just nitpicking. |
However, even though this is not a bug, maybe the documentation can be updated. The documentation has an example, actually:
Maybe it's just in the wrong place. |
I think it is. It also feels weird to have to escape everything, because there are no quotes wrapping the argument. Intuitively, it feels like you shouldn't have to escape those... |
Well, that's a macro argument, and macro arguments are a tricky thing... The problem is that the parser isn't great and there are many hacks everywhere. This is a problem that isn't going to go away. The only thing I can do is to change the docs, but I don't know where to put that, so I'm open for suggestions. |
RE: They are tricky things: #63 |
I'm going to close this. If you have a suggestion on how to change the docs feel free to propose it. |
I have a simple macro:
And I pass it this string:
And I get this error:
I then try to pass this string instead:
And I get this error:
I would expect either of these variants to work, since they're right there in the manual!
The text was updated successfully, but these errors were encountered: