Skip to content

Commit a9d3247

Browse files
committed
fix: empty newlines no longer break a block (and hence syntax highlighting)
format yaml grammar file to match workspace standard
1 parent ec5fc8e commit a9d3247

File tree

2 files changed

+78
-41
lines changed

2 files changed

+78
-41
lines changed
Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# yaml-language-server: $schema=../../../.vscode/tmLanguage.json
22

3-
name: 'INI (Cortex Command)'
3+
name: "INI (Cortex Command)"
44
scopeName: source.ccini
55
patterns:
6-
- { include: '#comments' }
7-
- { include: '#moduleDeclarations' }
8-
- { include: '#definitions' }
6+
- { include: "#comments" }
7+
- { include: "#moduleDeclarations" }
8+
- { include: "#definitions" }
99
# - { include: '#assignments' }
1010
# - { include: "#presetDefinition" }
1111
# - { include: "#numbers" }
@@ -16,34 +16,34 @@ repository:
1616
name: meta.definition.module
1717
begin: ^(DataModule)$
1818
beginCaptures:
19-
'1':
19+
"1":
2020
name: keyword
2121
end: ^(?!\t+)
2222
patterns:
23-
- include: '#comments'
24-
- include: '#assignments'
23+
- include: "#comments"
24+
- include: "#assignments"
2525

2626
definitions:
2727
name: meta.definition.block
2828
begin: ^((\w+)\s+(=)\s+(?:(.+?)(?:\s*?))(?=(?:\/\*(?!.*\*\/))|\/\/|\n))
29-
end: ^(?!\t+)
29+
end: ^(?=\w)
3030
beginCaptures:
31-
'0':
31+
"0":
3232
name: meta.expression.assignment
33-
'2':
33+
"2":
3434
name: support.type.property-name
3535
patterns:
36-
- include: '#presetDeclarations'
37-
'3':
36+
- include: "#presetDeclarations"
37+
"3":
3838
name: keyword.operator.assignment
39-
'4':
39+
"4":
4040
patterns:
41-
- { include: '#comments' }
42-
- { include: '#classNames' }
41+
- { include: "#comments" }
42+
- { include: "#classNames" }
4343

4444
patterns:
45-
- { include: '#comments' }
46-
- { include: '#assignments' }
45+
- { include: "#comments" }
46+
- { include: "#assignments" }
4747

4848
assignments:
4949
match: (?:\t+)((\w+)\s+(=)\s+(?:(.+?)(?:\s*?))(?=(?:\/\*(?!.*\*\/))|\/\/|\n))
@@ -60,57 +60,57 @@ repository:
6060
# )
6161
# )
6262
captures:
63-
'0':
63+
"0":
6464
name: meta.expression.assignment
65-
'2':
65+
"2":
6666
name: support.type.property-name
6767
patterns:
68-
- include: '#presetDeclarations'
69-
'3':
68+
- include: "#presetDeclarations"
69+
"3":
7070
name: keyword.operator.assignment
71-
'4':
71+
"4":
7272
patterns:
73-
- { include: '#comments' }
74-
- { include: '#classNames' }
75-
- { include: '#numbers' }
76-
- { include: '#strings' }
73+
- { include: "#comments" }
74+
- { include: "#classNames" }
75+
- { include: "#numbers" }
76+
- { include: "#strings" }
7777

7878
commentBlock:
7979
patterns:
8080
- name: comment.block
8181
begin: \/\*
8282
end: \*\/
8383
patterns:
84-
- include: '#commentBlock'
84+
- include: "#commentBlock"
8585

8686
comments:
8787
patterns:
88-
- include: '#commentBlock'
88+
- include: "#commentBlock"
8989

9090
# - name: comment.block.inline
9191
# match: (\/\*).*?(?=\*\/)(\*\/)
9292

9393
- name: comment.line.double-slash
9494
begin: (^[ \t]+)?(?=//)
9595
beginCaptures:
96-
'1':
96+
"1":
9797
name: punctuation.whitespace.comment.leading.ccini
9898
end: "(?!\\G)"
9999
patterns:
100100
- name: comment.line
101101
begin: //
102102
beginCaptures:
103-
'0':
103+
"0":
104104
name: comment.line.double-slash
105105
end: $
106106

107107
classNames:
108108
name: entity.name.class
109109
match: (Vector|Matrix|InputScheme|InputMapping|GenericSavedData|Entity|ContentFile|Color|Box|Atom|Turret|ThrownDevice|TerrainObject|TerrainFrosting|TerrainDebris|TDExplosive|SoundSet|SoundContainer|SLTerrain|SLBackground|SOPlacer|SceneObject|SceneLayer|Area|Scene|Round|PieSlice|PEmitter|MovableObject|MOSRotating|MOSprite|MOSParticle|MOPixel|MetaSave|MetaPlayer|Material|Magazine|Loadout|LimbPath|Leg|Icon|HeldDevice|HDFirearm|GlobalScript|Gib|Emission|Deployment|BunkerAssemblyScheme|BunkerAssembly|Attachable|AtomGroup|Arm|AHuman|AEmitter|ADSensor|ADoor|Actor|Activity|ACRocket|Exit|ACraft|ACrab|ACDropShip|MultiplayerServerLobby|MultiplayerGame|GATutorial|GAScripted|GameActivity)(\s*?\/\*.*?\*\/\s*?)?$
110110
captures:
111-
'0':
111+
"0":
112112
patterns:
113-
- include: '#comments'
113+
- include: "#comments"
114114

115115
presetDeclarations:
116116
name: keyword
@@ -121,26 +121,26 @@ repository:
121121
begin: (?=[\w\-])
122122
end: (?=\n|$|(\/\*(?!.*\*\/))|(\/\/))
123123
patterns:
124-
- include: '#comments'
125-
- include: '#modulePath'
124+
- include: "#comments"
125+
- include: "#modulePath"
126126

127127
modulePath:
128128
match: (([A-Z][A-z0-9 ]*\.rte)(\/[A-z0-9 ]*)*(\/[A-z0-9 ]+\.(wav|flac|png|bmp|ini)))(\s*?\/\*.*?\*\/\s*?)?$
129129
captures:
130-
'1':
130+
"1":
131131
name: markup.underline.link
132-
'6':
132+
"6":
133133
patterns:
134-
- include: '#comments'
134+
- include: "#comments"
135135

136136
numbers:
137137
name: constant.numeric
138138
match: ((-?[0-9]+\.[0-9]+)|(-?[0-9]+))(\s*?\/\*.*?\*\/\s*?)?$
139139
captures:
140-
'2':
140+
"2":
141141
name: constant.numeric.float
142-
'3':
142+
"3":
143143
name: constant.numeric.integer
144-
'4':
144+
"4":
145145
patterns:
146-
- include: '#comments'
146+
- include: "#comments"

tests/Benchmark.ini

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,41 @@ AddScene = Scene
3434
Width = 1002
3535
Height = 60
3636
Name = Benchmark s
37+
38+
AddScene = Scene
39+
PresetName = Benchmark
40+
Description = Scene for benchmarking.
41+
LocationOnPlanet = Vector
42+
X = 167
43+
Y = -7
44+
MetagamePlayable = 0
45+
Revealed = 0
46+
Terrain = SLTerrain
47+
PresetName = Benchmark Terrain
48+
BitmapFile = ContentFile
49+
FilePath = Benchmark.rte/Benchmark.png
50+
WrapX = 1
51+
WrapY = 0
52+
BackgroundTexture = ContentFile
53+
FilePath = Base.rte/Scenes/Textures/DirtDark.png
54+
GlobalAcceleration = Vector
55+
X = 0
56+
Y = 20
57+
AddBackgroundLayer = SLBackground
58+
CopyOf = Base.rte/Default Front
59+
AddBackgroundLayer = SLBackground
60+
CopyOf = Base.rte/Default Middle
61+
AddBackgroundLayer = SLBackground
62+
CopyOf = Base.rte/Clouds Layer A
63+
64+
AddBackgroundLayer = SLBackground
65+
CopyOf = Base.rte/Default Sky Layer
66+
AddArea = Area
67+
AddBox = Box
68+
Corner = Vector
69+
X = 0
70+
Y = 20
71+
Width = 1002
72+
Height = 60
73+
Name = Benchmark s
3774

0 commit comments

Comments
 (0)