Skip to content

Commit 75e3b0b

Browse files
committed
Add support for @mapsize, @autovisgroup and fix several bugs in fgd syntax highlighting
1 parent cc95abf commit 75e3b0b

File tree

1 file changed

+32
-5
lines changed

1 file changed

+32
-5
lines changed

syntaxes/fgd.tmLanguage.json

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,36 @@
33
"name": "FGD",
44
"scopeName": "source.fgd",
55
"patterns": [
6+
{ "include": "#mapSize"},
7+
{ "include": "#autoVisgroup"},
68
{ "include": "#classDefinition" },
79
{ "include": "#helper"},
810
{ "include": "#classLabel" },
911
{ "include": "#body" },
1012
{ "include": "source.kv#comment" }
1113
],
1214
"repository": {
15+
"mapSize": {
16+
"begin": "(\\@(?i)mapsize(?-i))\\(",
17+
"beginCaptures": {
18+
"1": { "name": "constant.language.fgd" }
19+
},
20+
"end": "\\)",
21+
"patterns": [
22+
{ "include": "source.kv#number" }
23+
]
24+
},
25+
"autoVisgroup": {
26+
"begin": "(\\@(?i)AutoVisgroup(?-i)) *(=)",
27+
"end": "(\\n)",
28+
"beginCaptures": {
29+
"1": { "name": "constant.language.fgd" },
30+
"2": { "name": "keyword.operator.fgd" }
31+
},
32+
"patterns": [
33+
{ "include": "source.kv#stringQuoted" }
34+
]
35+
},
1336
"classDefinition": {
1437
"match": "(\\@)(\\w+)",
1538
"captures": {
@@ -45,7 +68,7 @@
4568
]
4669
},
4770
"classLabel": {
48-
"match": "(=) *([\\w_]+) *(:) *(\\\"[\\w ]+\\\")",
71+
"match": "(=) *([\\w_]+) *(:) *(\\\".*\\\")",
4972
"captures": {
5073
"1": { "name": "keyword.operator.fgd" },
5174
"2": { "name": "entity.name.function.fgd" },
@@ -59,9 +82,13 @@
5982
"end": "\\]",
6083
"patterns": [
6184
{
62-
"match": "(input|output)",
85+
"match": "(?i)(input|output)(?-i)",
6386
"name": "storage.modifier"
6487
},
88+
{
89+
"match": "readonly",
90+
"name": "constant.language.fgd"
91+
},
6592
{ "include": "#array" },
6693
{ "include": "source.kv#comment" },
6794
{ "include": "source.kv#number" },
@@ -71,11 +98,11 @@
7198
]
7299
},
73100
"keyvalueName": {
74-
"begin": "\\w+",
101+
"begin": "(\\w+)\\(",
75102
"beginCaptures": {
76-
"0": { "name": "entity.name.function.fgd" }
103+
"1": { "name": "entity.name.function.fgd" }
77104
},
78-
"end": "\\((\\w+)\\)",
105+
"end": "(\\w+)\\)",
79106
"endCaptures": {
80107
"1": {
81108
"patterns": [

0 commit comments

Comments
 (0)