Skip to content

Commit 02df0f7

Browse files
authored
Merge pull request #295 from JuliaEditorSupport/sp/typegroup
feat: add support for typegroup syntax
2 parents 5121d57 + 25cc285 commit 02df0f7

5 files changed

Lines changed: 29 additions & 4 deletions

File tree

grammars/julia.cson

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ repository:
267267
keyword:
268268
patterns: [
269269
{
270-
match: '\\b(?<![:_\\.])(?:function|mutable\\s+struct|struct|macro|quote|abstract\\s+type|primitive\\s+type|module|baremodule|where)\\b'
270+
match: '\\b(?<![:_\\.])(?:function|mutable\\s+struct|struct|macro|quote|abstract\\s+type|primitive\\s+type|typegroup|module|baremodule|where)\\b'
271271
name: 'keyword.other.julia'
272272
}
273273
{

grammars/julia.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@
299299
"keyword": {
300300
"patterns": [
301301
{
302-
"match": "\\b(?<![:_\\.])(?:function|mutable\\s+struct|struct|macro|quote|abstract\\s+type|primitive\\s+type|module|baremodule|where)\\b",
302+
"match": "\\b(?<![:_\\.])(?:function|mutable\\s+struct|struct|macro|quote|abstract\\s+type|primitive\\s+type|typegroup|module|baremodule|where)\\b",
303303
"name": "keyword.other.julia"
304304
},
305305
{

template/julia.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@
299299
"keyword": {
300300
"patterns": [
301301
{
302-
"match": "\\b(?<![:_\\.])(?:function|mutable\\s+struct|struct|macro|quote|abstract\\s+type|primitive\\s+type|module|baremodule|where)\\b",
302+
"match": "\\b(?<![:_\\.])(?:function|mutable\\s+struct|struct|macro|quote|abstract\\s+type|primitive\\s+type|typegroup|module|baremodule|where)\\b",
303303
"name": "keyword.other.julia"
304304
},
305305
{

test/test.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3786,6 +3786,31 @@ describe('Julia grammar', function () {
37863786
},
37873787
])
37883788
})
3789+
it("tokenizes typegroup", function () {
3790+
const tokens = tokenize(grammar, 'typegroup\nstruct Foo end\nend')
3791+
compareTokens(tokens, [
3792+
{
3793+
value: 'typegroup',
3794+
scopes: ["keyword.other.julia"]
3795+
},
3796+
{
3797+
value: '\n',
3798+
scopes: []
3799+
},
3800+
{
3801+
value: 'struct',
3802+
scopes: ["keyword.other.julia"]
3803+
},
3804+
{
3805+
value: ' Foo ',
3806+
scopes: []
3807+
},
3808+
{
3809+
value: 'end',
3810+
scopes: ["keyword.control.end.julia"]
3811+
},
3812+
])
3813+
})
37893814
})
37903815

37913816
describe('Julia-Console', function () {

variants/julia_vscode.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@
299299
"keyword": {
300300
"patterns": [
301301
{
302-
"match": "\\b(?<![:_\\.])(?:function|mutable\\s+struct|struct|macro|quote|abstract\\s+type|primitive\\s+type|module|baremodule|where)\\b",
302+
"match": "\\b(?<![:_\\.])(?:function|mutable\\s+struct|struct|macro|quote|abstract\\s+type|primitive\\s+type|typegroup|module|baremodule|where)\\b",
303303
"name": "keyword.other.julia"
304304
},
305305
{

0 commit comments

Comments
 (0)