janet-lang / janet-lang.org

Website for janet
https://janet-lang.org
MIT License
92 stars 58 forks source link

double-quoted strings can span multiple lines #162

Closed uvtc closed 2 years ago

sogaiu commented 2 years ago

@uvtc For the multiline string example:

"Hello, this
    is all
one line
here."   # -> "Hello, this    is allone linehere."

have you considered something like:

"Hello, this
    is al
l one lin
e here."   # -> "Hello, this    is all one line here."

?

uvtc commented 2 years ago

Thanks for the input, @sogaiu --- yes, putting the "al" and the "l" on separate lines more clearly shows how they get joined together (and the newline is removed). I kept the "linehere" as-is because this way the example shows three cases all in one string: the 4 spaces preserved, the two word fragments forming a word, and the two words glued together.