-
Notifications
You must be signed in to change notification settings - Fork 26
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
Multiline strings are not accepted in define
#81
Comments
First appearance of the documentation was in 2011: Lines 264 to 273 in 6ce5f43
However, the test suite for the same version requires backslash: Lines 46 to 51 in 6ce5f43
Actually, backslash was required since the test suite was first written in 2009: Lines 39 to 44 in 433bf21
I'd read the documentation as outdated. @mjambon Could you confirm my understanding? |
It's likely that I wasn't careful about this issue when I wrote the code and the documentation at the time. My inclination today is indeed to allow and preserve all "lexical elements" as they exist in OCaml (string literals, comments, ...). This means multiline strings should use the same syntax as in OCaml. If a backslash is present at the end of a line within a string literal, it should not be removed by cppo. e.g.: #define x "hello \
world"
x will be turned by cppo into "hello \
world" not "hello
world" also not "hello world" |
CHANGES: - [bug] Fix multiline string support (ocaml-community/cppo#81)
The docs say they should work. Minimal example:
The text was updated successfully, but these errors were encountered: