@@ -41,25 +41,25 @@ object Parsed{
4141 /**
4242 * The outcome of a failed parse
4343 *
44- * @param failureLabel A hint as to why the parse failed. Defaults to "",
44+ * @param label A hint as to why the parse failed. Defaults to "",
4545 * unless you set `verboseFailures = true` or call
4646 * `.trace()` on an existing failure
4747 * @param index The index at which the parse failed
4848 * @param extra Metadata about the parse; useful for re-running the parse
4949 * to trace out a more detailed error report
5050 */
51- final case class Failure (failureLabel : String ,
51+ final case class Failure (label : String ,
5252 index : Int ,
5353 extra : Extra ) extends Parsed [Nothing ](false ){
5454 def get = throw new Exception (" Parse Error, " + msg)
55- def fold [V ](onFailure : (String , Int , Extra ) => V , onSuccess : (Nothing , Int ) => V ) = onFailure(failureLabel , index, extra)
55+ def fold [V ](onFailure : (String , Int , Extra ) => V , onSuccess : (Nothing , Int ) => V ) = onFailure(label , index, extra)
5656 override def toString () = s " Parsed.Failure( $msg) "
5757
5858 /**
5959 * Displays the failure message excluding the parse stack
6060 */
6161 def msg = {
62- failureLabel match {
62+ label match {
6363 case " " =>
6464 " Position " + extra.input.prettyIndex(index) +
6565 " , found " + Failure .formatTrailing(extra.input, index)
@@ -72,7 +72,7 @@ object Parsed{
7272 */
7373 def longMsg = {
7474 if (extra.stack.nonEmpty) {
75- Failure .formatMsg(extra.input, extra.stack ++ List (failureLabel -> index), index)
75+ Failure .formatMsg(extra.input, extra.stack ++ List (label -> index), index)
7676 } else throw new Exception (
7777 " `.longMsg` requires the parser to be run with `verboseFailures = true`, " +
7878 " or to be called via `.trace().longMsg` or `.trace().longAggregateMsg`"
@@ -154,7 +154,7 @@ object Parsed{
154154 */
155155 case class TracedFailure (failureAggregate : Seq [String ],
156156 failure : Failure ){
157- def failureLabel = failure.failureLabel
157+ def label = failure.label
158158 def index = failure.index
159159 def input = failure.extra.input
160160 def stack = failure.extra.stack
0 commit comments