Skip to content

Commit d767f40

Browse files
committed
some patches
1 parent f84347a commit d767f40

File tree

2 files changed

+34
-34
lines changed

2 files changed

+34
-34
lines changed

main.js

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -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+[df\$])/
6969
},
7070
{
7171
// icons
72-
token: "storage",
72+
token: "storage.mclang",
7373
regex: /:[_a-zA-Z0-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: /(true|false)/
210+
token: "constant.language.boolean.mcfunction",
211+
regex: /\b(true|false)\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: /@[aerpsv]/
227227
},
228+
{
229+
// variable (like in shell script), for target selectors
230+
token: "variable.mcfunction",
231+
regex: /[a-zA-Z0-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: /\bminecraft\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-zA-Z0-9_]+(?==)/
257257
}
258258
]
259259
};

plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"id": "vytdev.minecraft.util",
33
"name": "Minecraft Utility",
44
"main": "main.js",
5-
"version": "1.0.0",
5+
"version": "1.0.1",
66
"readme": "readme.md",
77
"icon": "icon.png",
88
"files": [],

0 commit comments

Comments
 (0)