djspiewak / parseback

A Scala implementation of parsing with derivatives
http://parseback.io
Apache License 2.0
197 stars 22 forks source link

String literals can't be combined with the pipe operator #4

Closed dcsobral closed 7 years ago

dcsobral commented 7 years ago

Things like def op: Parser[String] = "+" | "-" are not accepted.

djspiewak commented 7 years ago

The solution to this is something like this: https://github.com/djspiewak/gll-combinators/blob/master/src/main/scala/com/codecommit/gll/Parsers.scala#L46