Neat-Lang / neat

The Neat Language compiler. Early beta?
BSD 3-Clause "New" or "Revised" License
111 stars 9 forks source link

Allow suppressing end-of-line newline in string literals with a trailing backslash #66

Closed rsaarelm closed 6 months ago

rsaarelm commented 6 months ago

Same behavior as in Rust.

print("xyzzy

plugh");

should be same as

print("\
xyzzy

plugh\
");
FeepingCreature commented 6 months ago

How's the indentation work on that?

FeepingCreature commented 6 months ago

when an unescaped U+005C character (\) occurs immediately before a line break, then the line break character(s), and all immediately following ' '(U+0020), \t (U+0009), \n (U+000A) and \r (U+0000D) characters are ignored

I'll probably not skip newlines there, since Rust call it out as confusing.

FeepingCreature commented 6 months ago

Implemented https://github.com/Neat-Lang/neat/commit/34d46aa7745b7cf506e9eefc28bbcc32f06d2520