updated route rules implementation

This commit is contained in:
yusing
2025-01-09 04:27:02 +08:00
parent f906e04581
commit 74828943a6
5 changed files with 117 additions and 44 deletions

View File

@@ -73,6 +73,7 @@ var checkers = map[string]struct {
},
}
// Parse implements strutils.Parser.
func (on *RuleOn) Parse(v string) error {
on.raw = v
@@ -81,6 +82,9 @@ func (on *RuleOn) Parse(v string) error {
errs := E.NewBuilder("rule.on syntax errors")
for i, line := range lines {
if line == "" {
continue
}
parsed, err := parseOn(line)
if err != nil {
errs.Add(err.Subjectf("line %d", i+1))