-
Notifications
You must be signed in to change notification settings - Fork 342
Open
Labels
Description
steps
- Open https://www.scala-sbt.org/1.x/docs/Parsing-Input.html#Combining+parsers
- Copy-paste next snippet to sbt console or build.sbt
val color: Parser[String] = literal("blue") | literal("green")
val select: Parser[String] = literal("fg") | literal("bg")
val setColor: Parser[(String, Char, String)] = select ~ ' ' ~ color
problem
error: type mismatch;
found : sbt.internal.util.complete.Parser[((String, Char), String)]
required: sbt.internal.util.complete.Parser[(String, Char, String)]
val setColor: Parser[(String, Char, String)] = select ~ ' ' ~ color
expectation
Parser of type that described in the documentation.
notes
sbt 1.2.8, 1.6.2
scala 2.12.10