@@ -49,43 +49,43 @@ class AcodePlugin {
4949 start : [
5050 {
5151 // a comment
52- token : "comment" ,
52+ token : "comment.mclang " ,
5353 regex : / ( ^ \s * # # .* | \s + # # .* ) $ /
5454 } ,
5555 {
5656 // "=" character
57- token : "keyword" ,
57+ token : "keyword.mclang " ,
5858 regex : / = /
5959 } ,
6060 {
6161 // translation value
62- token : "string" ,
62+ token : "string.mclang " ,
6363 regex : / (?< = = ) / ,
6464 push : [
6565 {
6666 // parameters
67- token : "identifier" ,
67+ token : "identifier.mclang " ,
6868 regex : / % ( % | [ a - z ] | [ 1 - 9 ] \d * (?: \$ [ a - z ] ) ? | \. \d + [ d f \$ ] ) /
6969 } ,
7070 {
7171 // icons
72- token : "storage" ,
72+ token : "storage.mclang " ,
7373 regex : / : [ _ a - z A - Z 0 - 9 . ] + : /
7474 } ,
7575 {
76- defaultToken : "string"
76+ defaultToken : "string.mclang "
7777 } ,
7878 {
7979 // end
80- token : "string" ,
80+ token : "string.mclang " ,
8181 regex : / ( (? = \t + # # ) | $ ) / ,
8282 next : "pop"
8383 }
8484 ]
8585 } ,
8686 {
8787 // translation key
88- token : "variable" ,
88+ token : "variable.mclang " ,
8989 regex : / ^ [ ^ = ] + /
9090 }
9191 ]
@@ -153,10 +153,10 @@ class AcodePlugin {
153153 "exportstats" , "eyes" , "facing" , "feet" , "fill" , "filtered" , "fog" , "give" ,
154154 "if" , "in" , "insert" , "keep" , "kill" , "list" , "listen" , "load" , "loot" ,
155155 "mainhand" , "masked" , "matches" , "objectives" , "offhand" , "on_area_loaded" ,
156- "open" , "operation" , "play" , "pos " , "positioned " , "preload " , "profiler " ,
157- "push" , "queue" , "query" , "rain" , "random" , "remove" , "remove_all" , "replace ",
158- "reset" , "rotated" , "run" , "runset" , "runsetuntilfail" , "runthese" , "runthis ",
159- "save" , "score" , "set" , "setdisplay" , "sidebar" , "spawn" , "start" ,
156+ "open" , "operation" , "play" , "players " , "pos " , "positioned " , "preload " ,
157+ "profiler" , " push", "queue" , "query" , "rain" , "random" , "remove" , "remove_all" ,
158+ "replace" , " reset", "rotated" , "run" , "runset" , "runsetuntilfail" , "runthese" ,
159+ "runthis" , " save", "score" , "set" , "setdisplay" , "sidebar" , "spawn" , "start" ,
160160 "start_riding" , "stop" , "stop_riding" , "stopall" , "subtitle" , "summon_ride" ,
161161 "summon_rider" , "test" , "thunder" , "tickingarea" , "times" , "title" , "unless" ,
162162 "volume" , "watchdog"
@@ -175,85 +175,85 @@ class AcodePlugin {
175175 start : [
176176 {
177177 // a comment
178- token : "comment" ,
178+ token : "comment.mcfunction " ,
179179 regex : / \s * # .* /
180180 } ,
181181 {
182182 // a string (text within double quotes)
183- token : "string" ,
183+ token : "string.mcfunction " ,
184184 regex : / " / ,
185185 push : [
186186 {
187187 // escape characters
188- token : "constant.language.escape" ,
188+ token : "constant.language.escape.mcfunction " ,
189189 regex : escapeRe
190190 } ,
191191 {
192192 // back to parent rules
193- token : "string" ,
193+ token : "string.mcfunction " ,
194194 regex : / " / ,
195195 next : "pop"
196196 } ,
197197 {
198198 // part of the string
199- defaultToken : "string"
199+ defaultToken : "string.mcfunction "
200200 }
201201 ]
202202 } ,
203203 {
204204 // numbers
205- token : "constant.numeric" ,
205+ token : "constant.numeric.mcfunction " ,
206206 regex : / [ - + ] ? ( 0 | [ 1 - 9 ] \d * ) ( \. \d + ) ? /
207207 } ,
208208 {
209209 // boolean
210- token : "constant.language.boolean" ,
211- regex : / ( t r u e | f a l s e ) /
210+ token : "constant.language.boolean.mcfunction " ,
211+ regex : / \b ( t r u e | f a l s e ) \b /
212212 } ,
213213 {
214214 // punctuation operators
215- token : "punctuation.operator" ,
215+ token : "punctuation.operator.mcfunction " ,
216216 regex : / [ ! , . : ] /
217217 } ,
218218 {
219219 // keyword operators
220- token : "keyword.operator" ,
220+ token : "keyword.operator.mcfunction " ,
221221 regex : / [ - + * / = ^ ~ ] /
222222 } ,
223223 {
224224 // selector
225- token : "storage" ,
225+ token : "storage.selector.mcfunction " ,
226226 regex : / @ [ a e r p s v ] /
227227 } ,
228+ {
229+ // variable (like in shell script), for target selectors
230+ token : "variable.mcfunction" ,
231+ regex : / [ a - z A - Z 0 - 9 _ ] + (? = = ) /
232+ } ,
228233 {
229234 // bracket
230- token : "paren" ,
235+ token : "paren.mcfunction " ,
231236 regex : / [ \[ \] \{ \} ] /
232237 } ,
233238 {
234239 // minecraft namespace
235- token : "identifier.class" ,
240+ token : "identifier.class.mcfunction " ,
236241 regex : / \b m i n e c r a f t \b /
237242 } ,
238243 {
239244 // commands
240- token : "keyword" ,
245+ token : "keyword.mcfunction " ,
241246 regex : "\\b(" + cmds . join ( "|" ) + ")\\b"
242247 } ,
243248 {
244249 // sub-commands
245- token : "identifier" ,
250+ token : "identifier.mcfunction " ,
246251 regex : "\\b(" + subCmds . join ( "|" ) + ")\\b"
247252 } ,
248253 {
249254 // dimensions
250- token : "constant.language" ,
255+ token : "constant.language.mcfunction " ,
251256 regex : "\\b(" + dims . join ( "|" ) + ")\\b"
252- } ,
253- {
254- // variable (like in shell script), for target selectors
255- token : "variable" ,
256- regex : / [ a - z A - Z 0 - 9 _ ] + (? = = ) /
257257 }
258258 ]
259259 } ;
0 commit comments