Skip to content

Commit

Permalink
syntax: Add not ampersand syntax support
Browse files Browse the repository at this point in the history
  • Loading branch information
nhooyr committed Aug 30, 2023
1 parent 0c0c8af commit 04e3351
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@
"watch": "webpack --watch --devtool source-map",
"package": "webpack --mode production --devtool hidden-source-map",
"dev": "code --uninstall-extension terrastruct.d2; yarn gen && yarn pkg && code --install-extension d2.vsix",
"gen": "yq -o=json . syntaxes/d2.tmLanguage.yaml > syntaxes/d2.tmLanguage.json",
"gen": "yq . syntaxes/d2.tmLanguage.yaml > syntaxes/d2.tmLanguage.json",
"pkg": "vsce package --out d2.vsix"
},
"devDependencies": {
Expand Down
4 changes: 4 additions & 0 deletions syntaxes/d2.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,10 @@
"name": "keyword.operator.ampersand.d2",
"match": "&"
},
{
"name": "keyword.operator.not_ampersand.d2",
"match": "!&"
},
{
"name": "entity.name.tag.unquoted.d2",
"begin": "(?=[^[:space:]\\n#;\\[\\]{}|$'\":.<>*&()])(?!-+-)(?!-+>)(?!-+\\*)",
Expand Down
2 changes: 2 additions & 0 deletions syntaxes/d2.tmLanguage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ repository:
match: '\*\*'
- name: keyword.operator.ampersand.d2
match: "&"
- name: keyword.operator.not_ampersand.d2
match: "!&"
- name: entity.name.tag.unquoted.d2
begin: '(?=[^[:space:]\n#;\[\]{}|$''":.<>*&()])(?!-+-)(?!-+>)(?!-+\*)'
end: '(?=\s*[\n#;\[\]{}|$:.<>*&()]|-+-|-+>|-+\*)'
Expand Down

0 comments on commit 04e3351

Please sign in to comment.