feat(rules): support multiline or |

treat lines ending with unquoted `|` or `&` as continued
conditions in `do` block headers so nested blocks parse correctly
across line breaks.

update `on` condition splitting to avoid breaking on newlines that
follow an unescaped trailing pipe, while still respecting quotes,
escapes, and bracket nesting.

add coverage for multiline `|`/`&` continuations in `do` parsing,
`splitAnd`, `parseOn`, and HTTP flow nested block behavior.
This commit is contained in:
yusing
2026-02-26 16:38:54 +08:00
parent c002055892
commit a0adc51269
6 changed files with 217 additions and 80 deletions

View File

@@ -456,7 +456,8 @@ func TestHTTPFlow_NestedBlocks_RemoteOverride(t *testing.T) {
err := parseRules(`
header X-Test-Header {
set header X-Remote-Type public
remote 127.0.0.1 | remote 192.168.0.0/16 {
remote 127.0.0.1 |
remote 192.168.0.0/16 {
set header X-Remote-Type private
}
}