I am trying to define an external DSL using the scala parser combinators. I see that the ‘stringLit’ token parser does not accomodate multi line strings using the triple quotes. Is there something similar to a multiLineStringLit in the scala parser combinator world?
Thanks in advance,
Kishore
Not that I’m aware of, but it’s not too hard to write your own:
This is just
stringLiteralwith a couple of minor edits: I’ve changed the delimiter from"to"""and added\nto the character match.It’s not an exact match for Scala’s implementation of multi-line string literals (you can’t have an unescaped
"in the string, for example), but it can easily be tweaked, and may work for you as it is.