Skip to content

Commit

Permalink
Fix #26 - improve performance
Browse files Browse the repository at this point in the history
  • Loading branch information
ameshkov committed May 16, 2019
1 parent 131aa5f commit c43d1df
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 34 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Change Log

- Improved the $domain modifier performance: #26

## 0.0.15
- Added ABP snippets syntax support: #14
- Fixed regex highlighting issue: #18
Expand Down
40 changes: 6 additions & 34 deletions syntaxes/adblock.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -601,29 +601,15 @@
"domainListCommaSeparated": {
"patterns": [
{
"match": "((~?)(([a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9]?\\.?)+\\.([a-zA-Z0-9-]{2,}|\\*))(,?))",
"match": "(~?)([a-zA-Z0-9.*]+)(,?)",
"captures": {
"2": {
"1": {
"name": "keyword.other.adblock"
},
"3": {
"name": "string.unquoted.adblock"
},
"5": {
"name": "punctuation.definition.adblock"
}
}
},
{
"match": "((~?)(([0-9]{1,3}\\.?){4})(,?))",
"captures": {
"2": {
"name": "keyword.other.adblock"
},
"3": {
"name": "string.unquoted.adblock"
},
"5": {
"3": {
"name": "punctuation.definition.adblock"
}
}
Expand All @@ -637,29 +623,15 @@
"domainListPipeSeparated": {
"patterns": [
{
"match": "((~?)(([a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9]?\\.?)+\\.([a-zA-Z0-9-]{2,}|\\*))(\\|?))",
"match": "(~?)([a-zA-Z0-9.*]+)(\\|?)",
"captures": {
"2": {
"1": {
"name": "keyword.other.adblock"
},
"3": {
"name": "string.unquoted.adblock"
},
"5": {
"name": "punctuation.definition.adblock"
}
}
},
{
"match": "((~?)(([0-9]{1,3}\\.?){4})(\\|?))",
"captures": {
"2": {
"name": "keyword.other.adblock"
},
"3": {
"name": "string.unquoted.adblock"
},
"5": {
"3": {
"name": "punctuation.definition.adblock"
}
}
Expand Down
3 changes: 3 additions & 0 deletions test_rules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ example.org
||example.org$domain=j.gs
||example.org$domain=google.*

! Domain invalid: https://github.com/ameshkov/VscodeAdblockSyntax/issues/26
||parajumpersnettbutikk.com^$document,domain=~ Advarselen vises grunnet: En grovt falsk nettbutikksvindel som er svartelistet av Forbrukertilsynet.

! No URL
$websocket,domain=example.org

Expand Down

0 comments on commit c43d1df

Please sign in to comment.