Update RuleAnalyzer.kt

简化规则,并修正两个逻辑错误
pull/1105/head
bushixuanqi 3 years ago committed by GitHub
parent 514dbf4ff9
commit b71d37fc04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      app/src/main/java/io/legado/app/model/analyzeRule/RuleAnalyzer.kt

@ -151,7 +151,7 @@ class RuleAnalyzer(data: String) {
else -> null else -> null
} }
} ): Boolean { } ): Boolean {
val pos = pos //声明变量记录临时处理位置 var pos = pos //声明变量记录临时处理位置
var depth = 0 //嵌套深度 var depth = 0 //嵌套深度
var bracketsDepth = 0 //[]嵌套深度 var bracketsDepth = 0 //[]嵌套深度
@ -221,7 +221,7 @@ class RuleAnalyzer(data: String) {
*/ */
fun chompRuleBalanced(open: Char = '[', close: Char = ']',f: ((Char) ->Boolean?)? = null ): Boolean { fun chompRuleBalanced(open: Char = '[', close: Char = ']',f: ((Char) ->Boolean?)? = null ): Boolean {
val pos = pos //声明临时变量记录匹配位置,匹配成功后才同步到类的pos var pos = pos //声明临时变量记录匹配位置,匹配成功后才同步到类的pos
var depth = 0 //嵌套深度 var depth = 0 //嵌套深度
var otherDepth = 0 //其他对称符合嵌套深度 var otherDepth = 0 //其他对称符合嵌套深度

Loading…
Cancel
Save