Problem
When compiling programs that use the CRLF keyword in DISPLAY (and similar), the C++ backend can fail to compile the generated ldpl-temp.cpp.
Observed g++ errors include missing terminating " character: the emitted source effectively splits a string literal across physical lines, e.g. something like:
instead of a single-line escape sequence for carriage return + line feed.
Root cause appears to be in the early token rewrite pass in src/ldpl.cpp (compile loop): the CRLF token is replaced with a string that contains a literal newline inside the C++ fragment, which breaks the generated string literal.
LF does not hit this path in the same way and typically compiles.
Minimal LDPL repro
Use the procedure header form your compiler accepts (see related header/token issue). Example:
procedure
display "Hello" crlf
Expected
Generated C++ should use escaped sequences only (e.g. \\r\\n inside one string), so g++ accepts the file.
Actual
C++ compilation fails with string literal errors.
Environment
LDPL 5.x / reference compiler from https://github.com/Lartu/ldpl — reproducible when building the generated ldpl-temp.cpp.
Problem
When compiling programs that use the CRLF keyword in
DISPLAY(and similar), the C++ backend can fail to compile the generatedldpl-temp.cpp.Observed
g++errors include missing terminating " character: the emitted source effectively splits a string literal across physical lines, e.g. something like:instead of a single-line escape sequence for carriage return + line feed.
Root cause appears to be in the early token rewrite pass in
src/ldpl.cpp(compile loop): the CRLF token is replaced with a string that contains a literal newline inside the C++ fragment, which breaks the generated string literal.LF does not hit this path in the same way and typically compiles.
Minimal LDPL repro
Use the procedure header form your compiler accepts (see related header/token issue). Example:
Expected
Generated C++ should use escaped sequences only (e.g.
\\r\\ninside one string), sog++accepts the file.Actual
C++ compilation fails with string literal errors.
Environment
LDPL 5.x / reference compiler from https://github.com/Lartu/ldpl — reproducible when building the generated
ldpl-temp.cpp.