- Notifications
You must be signed in to change notification settings - Fork131
Open
Description
Whenphrase
is applied to successful parse result which haslastFailure
, it returns only the original failure.
I think it would be better to add a message that indicates the EOF is expected in the same way as it does when lastFailure isNone
.
For example, the followingp
fails because there are trailing spaces afterd
, but error message comes fromc
parse failure which doesn't have any hint for EOF.
val input = "a b d "val p = phase(/* a parser that parses `a b (c or d)`*/)
scala-parser-combinators/shared/src/main/scala/scala/util/parsing/combinator/Parsers.scala
Line 996 in82d8524
defphrase[T](p:Parser[T])=newParser[T] { |
Metadata
Metadata
Assignees
Labels
No labels