pnathan / pp-toml

Paul's Parser for Tom's Own Minimal Language
https://github.com/mojombo/toml
Other
19 stars 3 forks source link

Add multiline strings #10

Open pnathan opened 9 years ago

pnathan commented 9 years ago

snip from the 0.3 spec...

*Multi-line basic strings** are surrounded by three quotation marks on each
+side and allow newlines. If the first character after the opening delimiter is a
+newline (`0x0A`), then it is trimmed. All other whitespace remains intact.

+For writing long strings without introducing extraneous whitespace, end a line
+with a `\`. The `\` will be trimmed along with all whitespace (including
+newlines) up to the next non-whitespace character or closing delimiter. If the
+first two characters after the opening delimiter are a backslash and a newline
+(`0x5C0A`), then they will both be trimmed along with all whitespace (including
+newlines) up to the next non-whitespace character or closing delimiter. All of
+the escape sequences that are valid for basic strings are also valid for
+multi-line basic strings.