@@ -41,25 +41,25 @@ object Parsed{
41
41
/**
42
42
* The outcome of a failed parse
43
43
*
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 "",
45
45
* unless you set `verboseFailures = true` or call
46
46
* `.trace()` on an existing failure
47
47
* @param index The index at which the parse failed
48
48
* @param extra Metadata about the parse; useful for re-running the parse
49
49
* to trace out a more detailed error report
50
50
*/
51
- final case class Failure (failureLabel : String ,
51
+ final case class Failure (label : String ,
52
52
index : Int ,
53
53
extra : Extra ) extends Parsed [Nothing ](false ){
54
54
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)
56
56
override def toString () = s " Parsed.Failure( $msg) "
57
57
58
58
/**
59
59
* Displays the failure message excluding the parse stack
60
60
*/
61
61
def msg = {
62
- failureLabel match {
62
+ label match {
63
63
case " " =>
64
64
" Position " + extra.input.prettyIndex(index) +
65
65
" , found " + Failure .formatTrailing(extra.input, index)
@@ -72,7 +72,7 @@ object Parsed{
72
72
*/
73
73
def longMsg = {
74
74
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)
76
76
} else throw new Exception (
77
77
" `.longMsg` requires the parser to be run with `verboseFailures = true`, " +
78
78
" or to be called via `.trace().longMsg` or `.trace().longAggregateMsg`"
@@ -154,7 +154,7 @@ object Parsed{
154
154
*/
155
155
case class TracedFailure (failureAggregate : Seq [String ],
156
156
failure : Failure ){
157
- def failureLabel = failure.failureLabel
157
+ def label = failure.label
158
158
def index = failure.index
159
159
def input = failure.extra.input
160
160
def stack = failure.extra.stack
0 commit comments