@@ -11,15 +11,15 @@ import parsley.token.errors.LabelWithExplainConfig
11
11
import parsley .token .predicate
12
12
13
13
import parsley .internal .collection .immutable .Trie
14
- import parsley .internal .errors .ExpectDesc
14
+ import parsley .internal .errors .{ ExpectDesc , ExpectItem }
15
15
import parsley .internal .machine .Context
16
16
import parsley .internal .machine .XAssert ._
17
17
import parsley .internal .machine .instructions .Instr
18
18
19
19
private [token] abstract class Specific extends Instr {
20
20
protected val specific : String
21
21
protected val caseSensitive : Boolean
22
- protected val expected : Iterable [ExpectDesc ]
22
+ protected val expected : Iterable [ExpectItem ]
23
23
protected val reason : Option [String ]
24
24
private [this ] final val strsz = specific.length
25
25
private [this ] final val numCodePoints = specific.codePointCount(0 , strsz)
@@ -66,13 +66,13 @@ private [token] abstract class Specific extends Instr {
66
66
}
67
67
68
68
private [internal] final class SoftKeyword (protected val specific : String , letter : CharPredicate , protected val caseSensitive : Boolean ,
69
- protected val expected : Iterable [ExpectDesc ], protected val reason : Option [String ],
69
+ protected val expected : Iterable [ExpectItem ], protected val reason : Option [String ],
70
70
expectedEnd : Iterable [ExpectDesc ]) extends Specific {
71
71
def this (specific : String , letter : predicate.CharPredicate , caseSensitive : Boolean , expected : LabelWithExplainConfig , expectedEnd : String ) = {
72
72
this (if (caseSensitive) specific else specific.toLowerCase,
73
73
letter.asInternalPredicate,
74
74
caseSensitive,
75
- expected.asExpectDescs , expected.asReason, Some (new ExpectDesc (expectedEnd)))
75
+ expected.asExpectItems(specific) , expected.asReason, Some (new ExpectDesc (expectedEnd)))
76
76
}
77
77
78
78
protected def postprocess (ctx : Context ): Unit = {
@@ -92,10 +92,10 @@ private [internal] final class SoftKeyword(protected val specific: String, lette
92
92
}
93
93
94
94
private [internal] final class SoftOperator (protected val specific : String , letter : CharPredicate , ops : Trie [Unit ],
95
- protected val expected : Iterable [ExpectDesc ], protected val reason : Option [String ],
95
+ protected val expected : Iterable [ExpectItem ], protected val reason : Option [String ],
96
96
expectedEnd : Iterable [ExpectDesc ]) extends Specific {
97
97
def this (specific : String , letter : predicate.CharPredicate , ops : Trie [Unit ], expected : LabelWithExplainConfig , expectedEnd : String ) = {
98
- this (specific, letter.asInternalPredicate, ops, expected.asExpectDescs , expected.asReason, Some (new ExpectDesc (expectedEnd)))
98
+ this (specific, letter.asInternalPredicate, ops, expected.asExpectItems(specific) , expected.asReason, Some (new ExpectDesc (expectedEnd)))
99
99
}
100
100
protected val caseSensitive = true
101
101
private val ends = ops.suffixes(specific)
0 commit comments