savi-lang / savi

A fast language for programmers who are passionate about their craft.
BSD 3-Clause "New" or "Revised" License
156 stars 12 forks source link

Add line break escape pattern for string literals. #296

Closed jemc closed 2 years ago

jemc commented 2 years ago

Now a string can be broken onto separate lines without introducing any extra line breaks or whitespace into the content.

When \ appears before a line break, the slash, the line break, and any following indentation will be removed from the string's content.

For example, the following two string literals are equivalent in content:

    string_1 = "\
      Hello, \
      World\
      !\
    "

    string_2 = "Hello, World!"

Resolves #281.