-
Notifications
You must be signed in to change notification settings - Fork 50
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
Unterminated string literals should be rejected by the lexer #228
Comments
Would it be possible to have a mode that still accepts multiline strings like your AB example? |
Maybe? But think a bit about what this means... we would have a mode whose behavior was basically undefined, as we will be unwilling to fix any issues involving the multiline strings. Your bug #225, for example. We definitely would not sign up to maintain the current behavior in any particular way beyond not throwing an exception when the mode was turned on. I think a script to convert the multiline strings to raw string literals might be doable. You could even write something using Wave! |
You might not even need raw string literals given string concatenation. Just turn:
into
|
Unfortunately, our custom DSLs don't support string concatenation (nor C++-style raw string literals) at the moment. I can't imagine it would be too difficult to add, but it certainly complicates my issue. |
I wouldn't reject the idea of maintaining a custom fork of Wave, actually. You wouldn't have to pin yourself to 1.86 overall, thanks to the Modular Boost project. And you could fix #225 your way, if you wanted to. @hkaiser any thoughts about a super-secret disabling switch for the exception? |
? |
At the moment Wave accepts text like this:
which a user might accidentally write, intending to create a multi-line string literal with an embedded newline. In fact these "classic" (pre C++11) string literals disallow newlines.
Unfortunately, Wave has been turning these into a series of tokens:
It can then go on to do work on these tokens, like directive evaluation, as described in bug #225.
Wave should produce a lexer exception in this case instead.
The text was updated successfully, but these errors were encountered: