Skip to content

Commit c686684

Browse files
committed
fix: make as tokenziation more robust
1 parent 34d2de2 commit c686684

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

grammars/julia.cson

+1-1
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ repository:
298298
name: 'keyword.control.using.julia'
299299
}
300300
{
301-
match: '(?<=\\w\\s)\\b(as)\\b(?=\\s\\w)'
301+
match: '(?<=\\S\\s+)\\b(as)\\b(?=\\s+\\S)'
302302
name: 'keyword.control.as.julia'
303303
}
304304
{

grammars/julia.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@
330330
"name": "keyword.control.using.julia"
331331
},
332332
{
333-
"match": "(?<=\\w\\s)\\b(as)\\b(?=\\s\\w)",
333+
"match": "(?<=\\S\\s+)\\b(as)\\b(?=\\s+\\S)",
334334
"name": "keyword.control.as.julia"
335335
},
336336
{

grammars/julia.template.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@
330330
"name": "keyword.control.using.julia"
331331
},
332332
{
333-
"match": "(?<=\\w\\s)\\b(as)\\b(?=\\s\\w)",
333+
"match": "(?<=\\S\\s+)\\b(as)\\b(?=\\s+\\S)",
334334
"name": "keyword.control.as.julia"
335335
},
336336
{

grammars/julia_vscode.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@
330330
"name": "keyword.control.using.julia"
331331
},
332332
{
333-
"match": "(?<=\\w\\s)\\b(as)\\b(?=\\s\\w)",
333+
"match": "(?<=\\S\\s+)\\b(as)\\b(?=\\s+\\S)",
334334
"name": "keyword.control.as.julia"
335335
},
336336
{

test/test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -3273,7 +3273,7 @@ describe('Julia grammar', function () {
32733273
scopes: []
32743274
},
32753275
])
3276-
tokens = tokenize(grammar, 'import Foo: x as y, z as yy')
3276+
tokens = tokenize(grammar, 'import Foo: x as y, z! as yy')
32773277
compareTokens(tokens, [
32783278
{
32793279
value: 'import',
@@ -3304,7 +3304,7 @@ describe('Julia grammar', function () {
33043304
scopes: ["punctuation.separator.comma.julia"]
33053305
},
33063306
{
3307-
value: ' z ',
3307+
value: ' z! ',
33083308
scopes: []
33093309
},
33103310
{

0 commit comments

Comments
 (0)