From 3d801c8405dd6cd712c6b12b8fe9792369021290 Mon Sep 17 00:00:00 2001 From: scripthunter7 <57285466+scripthunter7@users.noreply.github.com> Date: Mon, 13 Feb 2023 14:33:44 +0100 Subject: [PATCH 1/2] Add support for `from`, `to` and `method` modifiers --- syntaxes/adblock.tmLanguage.json | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/syntaxes/adblock.tmLanguage.json b/syntaxes/adblock.tmLanguage.json index 5aa2b1b..19fbecc 100644 --- a/syntaxes/adblock.tmLanguage.json +++ b/syntaxes/adblock.tmLanguage.json @@ -578,7 +578,7 @@ } }, { - "match": "(domain|denyallow)(=)([^,]+)", + "match": "(domain|denyallow|from|to)(=)([^,]+)", "captures": { "1": { "name": "keyword.other.adblock" @@ -748,6 +748,29 @@ } } }, + { + "match": "(method)(=)([^,]+)", + "captures": { + "1": { + "name": "keyword.other.adblock" + }, + "2": { + "name": "keyword.operator.adblock" + }, + "3": { + "patterns": [ + { + "match": "(?i)(connect|delete|get|head|options|patch|post|put)", + "name": "string.unquoted.adblock" + }, + { + "match": ".+", + "name": "invalid.illegal.method-value" + } + ] + } + } + }, { "match": "(inline-script|inline-font|mp4|empty|badfilter|genericblock|generichide|network|popup|popunder|important|cookie|csp|replace|stealth|removeparam|queryprune)", "name": "keyword.other.adblock" From c6f5ae19c10eaea91f741af544e9370c1ab8c130 Mon Sep 17 00:00:00 2001 From: scripthunter7 <57285466+scripthunter7@users.noreply.github.com> Date: Mon, 13 Feb 2023 16:38:28 +0100 Subject: [PATCH 2/2] Support for operators Handle following cases: ``` ||google.com^$method=post|get ||example.com^$method=~get ``` --- syntaxes/adblock.tmLanguage.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/syntaxes/adblock.tmLanguage.json b/syntaxes/adblock.tmLanguage.json index 19fbecc..d6bcba0 100644 --- a/syntaxes/adblock.tmLanguage.json +++ b/syntaxes/adblock.tmLanguage.json @@ -763,6 +763,10 @@ "match": "(?i)(connect|delete|get|head|options|patch|post|put)", "name": "string.unquoted.adblock" }, + { + "match": "~|\\|", + "name": "keyword.operator.adblock" + }, { "match": ".+", "name": "invalid.illegal.method-value"