
Olivier found out the following fact: As stated in sections 2.1 and 2.13.4 of the C++ standard, adjacent string literals must be concatenated during the translation phase. const char* s = "bon" "jour." "\n"; is equivalent to: const char* s = "bonjour.\n"; Here is the difference in the AST: StringLiteral(STRING-LITERAL("\"bon\" \"jour.\" \"\\n\"")) vs StringLiteral(STRING-LITERAL("\"bonjour.\\n\"")) Is it parse-cxx job to perform this concatenation, using a desugaring filter? -- Clement Vasseur -o) [ nitro :: EPITA CSI 2005 ] /\\ "Programming is about being lazy." _\_V

Clement Vasseur <nitro@epita.fr> writes:
Olivier found out the following fact:
As stated in sections 2.1 and 2.13.4 of the C++ standard, adjacent string literals must be concatenated during the translation phase.
const char* s = "bon" "jour." "\n";
is equivalent to:
const char* s = "bonjour.\n";
Here is the difference in the AST: StringLiteral(STRING-LITERAL("\"bon\" \"jour.\" \"\\n\"")) vs StringLiteral(STRING-LITERAL("\"bonjour.\\n\""))
Is it parse-cxx job to perform this concatenation, using a desugaring filter?
No. We can stay with it. It is simple enough. -- Valentin David valentin@lrde.epita.fr
participants (2)
-
Clement Vasseur
-
valentin@lrde.epita.fr