Scala External DSL — Multi line string literal
问题 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 回答1: Not that I'm aware of, but it's not too hard to write your own: import scala.util.parsing.combinator._ object myParser extends JavaTokenParsers { def mlStringLiteral: Parser[String] = ( "\"\"\"" + "