From b71d37fc04a21428152df6d6e46aefbda0ec27f3 Mon Sep 17 00:00:00 2001 From: bushixuanqi <57338301+bushixuanqi@users.noreply.github.com> Date: Mon, 5 Jul 2021 13:03:43 +0800 Subject: [PATCH] Update RuleAnalyzer.kt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 简化规则,并修正两个逻辑错误 --- .../main/java/io/legado/app/model/analyzeRule/RuleAnalyzer.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/legado/app/model/analyzeRule/RuleAnalyzer.kt b/app/src/main/java/io/legado/app/model/analyzeRule/RuleAnalyzer.kt index 197a93005..d90b58a79 100644 --- a/app/src/main/java/io/legado/app/model/analyzeRule/RuleAnalyzer.kt +++ b/app/src/main/java/io/legado/app/model/analyzeRule/RuleAnalyzer.kt @@ -151,7 +151,7 @@ class RuleAnalyzer(data: String) { else -> null } } ): Boolean { - val pos = pos //声明变量记录临时处理位置 + var pos = pos //声明变量记录临时处理位置 var depth = 0 //嵌套深度 var bracketsDepth = 0 //[]嵌套深度 @@ -221,7 +221,7 @@ class RuleAnalyzer(data: String) { */ fun chompRuleBalanced(open: Char = '[', close: Char = ']',f: ((Char) ->Boolean?)? = null ): Boolean { - val pos = pos //声明临时变量记录匹配位置,匹配成功后才同步到类的pos + var pos = pos //声明临时变量记录匹配位置,匹配成功后才同步到类的pos var depth = 0 //嵌套深度 var otherDepth = 0 //其他对称符合嵌套深度