Skip to content

Commit

Permalink
Merge pull request #284 from JuliaEditorSupport/sp/more-robust-as-tok…
Browse files Browse the repository at this point in the history
…enziation

fix: make `as` tokenziation more robust
  • Loading branch information
pfitzseb authored Jul 8, 2024
2 parents 34d2de2 + c686684 commit f98e33a
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion grammars/julia.cson
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ repository:
name: 'keyword.control.using.julia'
}
{
match: '(?<=\\w\\s)\\b(as)\\b(?=\\s\\w)'
match: '(?<=\\S\\s+)\\b(as)\\b(?=\\s+\\S)'
name: 'keyword.control.as.julia'
}
{
Expand Down
2 changes: 1 addition & 1 deletion grammars/julia.json
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@
"name": "keyword.control.using.julia"
},
{
"match": "(?<=\\w\\s)\\b(as)\\b(?=\\s\\w)",
"match": "(?<=\\S\\s+)\\b(as)\\b(?=\\s+\\S)",
"name": "keyword.control.as.julia"
},
{
Expand Down
2 changes: 1 addition & 1 deletion grammars/julia.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@
"name": "keyword.control.using.julia"
},
{
"match": "(?<=\\w\\s)\\b(as)\\b(?=\\s\\w)",
"match": "(?<=\\S\\s+)\\b(as)\\b(?=\\s+\\S)",
"name": "keyword.control.as.julia"
},
{
Expand Down
2 changes: 1 addition & 1 deletion grammars/julia_vscode.json
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@
"name": "keyword.control.using.julia"
},
{
"match": "(?<=\\w\\s)\\b(as)\\b(?=\\s\\w)",
"match": "(?<=\\S\\s+)\\b(as)\\b(?=\\s+\\S)",
"name": "keyword.control.as.julia"
},
{
Expand Down
4 changes: 2 additions & 2 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3273,7 +3273,7 @@ describe('Julia grammar', function () {
scopes: []
},
])
tokens = tokenize(grammar, 'import Foo: x as y, z as yy')
tokens = tokenize(grammar, 'import Foo: x as y, z! as yy')
compareTokens(tokens, [
{
value: 'import',
Expand Down Expand Up @@ -3304,7 +3304,7 @@ describe('Julia grammar', function () {
scopes: ["punctuation.separator.comma.julia"]
},
{
value: ' z ',
value: ' z! ',
scopes: []
},
{
Expand Down

0 comments on commit f98e33a

Please sign in to comment.