redscript-mc 1.2.24 → 1.2.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/publish-extension-on-ci.yml +1 -0
- package/dist/codegen/mcfunction/index.js +5 -0
- package/dist/codegen/var-allocator.js +7 -3
- package/editors/vscode/package-lock.json +3 -3
- package/editors/vscode/package.json +1 -1
- package/package.json +1 -1
- package/src/codegen/mcfunction/index.ts +5 -0
- package/src/codegen/var-allocator.ts +7 -3
|
@@ -64,6 +64,7 @@ jobs:
|
|
|
64
64
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
65
65
|
git add editors/vscode/package.json editors/vscode/package-lock.json
|
|
66
66
|
git commit -m "chore: auto-bump vscode extension to ${NEW_VER} [skip ci]" || echo "Nothing to commit"
|
|
67
|
+
git pull --rebase origin main || true
|
|
67
68
|
git push
|
|
68
69
|
id: bump
|
|
69
70
|
|
|
@@ -336,6 +336,11 @@ function generateDatapackWithStats(module, options = {}) {
|
|
|
336
336
|
const filePath = i === 0
|
|
337
337
|
? `data/${ns}/function/${fn.name}.mcfunction`
|
|
338
338
|
: `data/${ns}/function/${fn.name}/${block.label}.mcfunction`;
|
|
339
|
+
// Skip empty continuation blocks (only contain the block comment, no real commands)
|
|
340
|
+
// Entry block (i === 0) is always emitted so the function file exists
|
|
341
|
+
const hasRealContent = lines.some(l => !l.startsWith('#') && l.trim() !== '');
|
|
342
|
+
if (i !== 0 && !hasRealContent)
|
|
343
|
+
continue;
|
|
339
344
|
files.push({ path: filePath, content: lines.join('\n') });
|
|
340
345
|
}
|
|
341
346
|
}
|
|
@@ -61,12 +61,16 @@ class VarAllocator {
|
|
|
61
61
|
*/
|
|
62
62
|
toSourceMap() {
|
|
63
63
|
const map = {};
|
|
64
|
-
for (const [orig, alloc] of this.varCache)
|
|
64
|
+
for (const [orig, alloc] of this.varCache) {
|
|
65
|
+
// Skip compiler-generated temporaries (start with _ followed by digits)
|
|
66
|
+
if (/^_\d+$/.test(orig))
|
|
67
|
+
continue;
|
|
65
68
|
map[alloc] = orig;
|
|
69
|
+
}
|
|
66
70
|
for (const [val, alloc] of this.constCache)
|
|
67
|
-
map[alloc] = `const
|
|
71
|
+
map[alloc] = `const:${val}`;
|
|
68
72
|
for (const [suf, alloc] of this.internalCache)
|
|
69
|
-
map[alloc] = `
|
|
73
|
+
map[alloc] = `internal:${suf}`;
|
|
70
74
|
return map;
|
|
71
75
|
}
|
|
72
76
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "redscript-vscode",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.16",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "redscript-vscode",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.16",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"redscript": "file:../../"
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
},
|
|
24
24
|
"../..": {
|
|
25
25
|
"name": "redscript-mc",
|
|
26
|
-
"version": "1.2.
|
|
26
|
+
"version": "1.2.25",
|
|
27
27
|
"license": "MIT",
|
|
28
28
|
"bin": {
|
|
29
29
|
"redscript": "dist/cli.js",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "redscript-vscode",
|
|
3
3
|
"displayName": "RedScript for Minecraft",
|
|
4
4
|
"description": "Syntax highlighting, error diagnostics, and language support for RedScript — a compiler targeting Minecraft Java Edition",
|
|
5
|
-
"version": "1.0.
|
|
5
|
+
"version": "1.0.16",
|
|
6
6
|
"publisher": "bkmashiro",
|
|
7
7
|
"icon": "icon.png",
|
|
8
8
|
"license": "MIT",
|
package/package.json
CHANGED
|
@@ -384,6 +384,11 @@ export function generateDatapackWithStats(
|
|
|
384
384
|
? `data/${ns}/function/${fn.name}.mcfunction`
|
|
385
385
|
: `data/${ns}/function/${fn.name}/${block.label}.mcfunction`
|
|
386
386
|
|
|
387
|
+
// Skip empty continuation blocks (only contain the block comment, no real commands)
|
|
388
|
+
// Entry block (i === 0) is always emitted so the function file exists
|
|
389
|
+
const hasRealContent = lines.some(l => !l.startsWith('#') && l.trim() !== '')
|
|
390
|
+
if (i !== 0 && !hasRealContent) continue
|
|
391
|
+
|
|
387
392
|
files.push({ path: filePath, content: lines.join('\n') })
|
|
388
393
|
}
|
|
389
394
|
}
|
|
@@ -63,9 +63,13 @@ export class VarAllocator {
|
|
|
63
63
|
*/
|
|
64
64
|
toSourceMap(): Record<string, string> {
|
|
65
65
|
const map: Record<string, string> = {}
|
|
66
|
-
for (const [orig, alloc] of this.varCache)
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
for (const [orig, alloc] of this.varCache) {
|
|
67
|
+
// Skip compiler-generated temporaries (start with _ followed by digits)
|
|
68
|
+
if (/^_\d+$/.test(orig)) continue
|
|
69
|
+
map[alloc] = orig
|
|
70
|
+
}
|
|
71
|
+
for (const [val, alloc] of this.constCache) map[alloc] = `const:${val}`
|
|
72
|
+
for (const [suf, alloc] of this.internalCache) map[alloc] = `internal:${suf}`
|
|
69
73
|
return map
|
|
70
74
|
}
|
|
71
75
|
}
|