Remove debugging mutable state from Regex classes. (#1710)
This commit is contained in:
@@ -71,10 +71,6 @@ internal class Pattern(val pattern: String, flags: Int = 0) {
|
||||
if (flags != 0 && flags or flagsBitMask != flagsBitMask) {
|
||||
throw IllegalArgumentException()
|
||||
}
|
||||
|
||||
// It's for debug purposes.
|
||||
AbstractSet.counter = 1
|
||||
|
||||
startNode = processExpression(-1, this.flags, null)
|
||||
|
||||
if (!lexemes.isEmpty()) {
|
||||
|
||||
@@ -54,9 +54,6 @@ internal abstract class AbstractSet(val type: Int = 0) {
|
||||
const val TYPE_QUANT = 1 shl 3
|
||||
const val TYPE_DOTSET = 0x80000000.toInt() or '.'.toInt()
|
||||
|
||||
/** Counter for debugging purposes, represent unique node index. */
|
||||
var counter = 1
|
||||
|
||||
val dummyNext = object : AbstractSet() {
|
||||
override var next: AbstractSet
|
||||
get() = throw AssertionError("This method is not expected to be called.")
|
||||
@@ -72,11 +69,8 @@ internal abstract class AbstractSet(val type: Int = 0) {
|
||||
var secondPassVisited = false
|
||||
abstract var next: AbstractSet
|
||||
|
||||
// These properties and toString() method are for debug purposes.
|
||||
protected var debugIndex = AbstractSet.counter++.toString()
|
||||
protected open val name: String
|
||||
get() = ""
|
||||
override fun toString(): String = "<$debugIndex:$name>"
|
||||
get() = ""
|
||||
|
||||
/**
|
||||
* Checks if this node matches in given position and recursively call
|
||||
|
||||
Reference in New Issue
Block a user