mirror of
https://gitclone.com/github.com/MetaCubeX/Clash.Meta
synced 2024-11-15 13:41:23 +08:00
fix: 类型转换错误导致规则解析错误
This commit is contained in:
parent
6709936a8f
commit
3b038310ab
@ -5,6 +5,7 @@ import (
|
|||||||
"github.com/Dreamacro/clash/common/collections"
|
"github.com/Dreamacro/clash/common/collections"
|
||||||
C "github.com/Dreamacro/clash/constant"
|
C "github.com/Dreamacro/clash/constant"
|
||||||
RC "github.com/Dreamacro/clash/rule/common"
|
RC "github.com/Dreamacro/clash/rule/common"
|
||||||
|
RP "github.com/Dreamacro/clash/rule/provider"
|
||||||
"github.com/Dreamacro/clash/rule/ruleparser"
|
"github.com/Dreamacro/clash/rule/ruleparser"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
@ -70,6 +71,9 @@ func parseRule(tp, payload string, params []string) (parsed C.Rule, parseErr err
|
|||||||
parsed, parseErr = NewOR(payload, "")
|
parsed, parseErr = NewOR(payload, "")
|
||||||
case "NOT":
|
case "NOT":
|
||||||
parsed, parseErr = NewNOT(payload, "")
|
parsed, parseErr = NewNOT(payload, "")
|
||||||
|
case "RULE-SET":
|
||||||
|
noResolve := RC.HasNoResolve(params)
|
||||||
|
parsed, parseErr = RP.NewRuleSet(payload, "", noResolve)
|
||||||
default:
|
default:
|
||||||
parseErr = ruleparser.NewUnsupportedError(tp)
|
parseErr = ruleparser.NewUnsupportedError(tp)
|
||||||
}
|
}
|
||||||
|
@ -62,6 +62,6 @@ func NewUnsupportedError(tp any) *UnsupportedError {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func IsUnsupported(err error) bool {
|
func IsUnsupported(err error) bool {
|
||||||
_, ok := err.(UnsupportedError)
|
_, ok := err.(*UnsupportedError)
|
||||||
return ok
|
return ok
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user