ticbuild 1.0.19 → 1.0.21
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/README.md +35 -0
- package/dist/backend/importers/LuaCodeImporter.d.ts +4 -1
- package/dist/backend/importers/LuaCodeImporter.d.ts.map +1 -1
- package/dist/backend/importers/LuaCodeImporter.js +18 -8
- package/dist/backend/importers/LuaCodeImporter.js.map +1 -1
- package/dist/buildInfo.d.ts +4 -4
- package/dist/buildInfo.js +4 -4
- package/dist/frontend/build.d.ts +2 -1
- package/dist/frontend/build.d.ts.map +1 -1
- package/dist/frontend/build.js +66 -2
- package/dist/frontend/build.js.map +1 -1
- package/dist/frontend/buildReporter.d.ts +86 -0
- package/dist/frontend/buildReporter.d.ts.map +1 -0
- package/dist/frontend/buildReporter.js +64 -0
- package/dist/frontend/buildReporter.js.map +1 -0
- package/dist/frontend/buildReporter.test.d.ts +2 -0
- package/dist/frontend/buildReporter.test.d.ts.map +1 -0
- package/dist/frontend/buildReporter.test.js +360 -0
- package/dist/frontend/buildReporter.test.js.map +1 -0
- package/dist/frontend/core.d.ts +2 -1
- package/dist/frontend/core.d.ts.map +1 -1
- package/dist/frontend/core.js +294 -68
- package/dist/frontend/core.js.map +1 -1
- package/dist/frontend/parseOptions.d.ts +1 -0
- package/dist/frontend/parseOptions.d.ts.map +1 -1
- package/dist/frontend/parseOptions.js.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/utils/console.d.ts +7 -0
- package/dist/utils/console.d.ts.map +1 -1
- package/dist/utils/console.js +32 -9
- package/dist/utils/console.js.map +1 -1
- package/dist/utils/lua/lua_alias_expressions.d.ts +2 -0
- package/dist/utils/lua/lua_alias_expressions.d.ts.map +1 -1
- package/dist/utils/lua/lua_alias_expressions.js +29 -94
- package/dist/utils/lua/lua_alias_expressions.js.map +1 -1
- package/dist/utils/lua/lua_alias_expressions.test.d.ts +2 -0
- package/dist/utils/lua/lua_alias_expressions.test.d.ts.map +1 -0
- package/dist/utils/lua/lua_alias_expressions.test.js +212 -0
- package/dist/utils/lua/lua_alias_expressions.test.js.map +1 -0
- package/dist/utils/lua/lua_alias_literals.d.ts +2 -0
- package/dist/utils/lua/lua_alias_literals.d.ts.map +1 -1
- package/dist/utils/lua/lua_alias_literals.js +12 -79
- package/dist/utils/lua/lua_alias_literals.js.map +1 -1
- package/dist/utils/lua/lua_alias_shared.d.ts +49 -14
- package/dist/utils/lua/lua_alias_shared.d.ts.map +1 -1
- package/dist/utils/lua/lua_alias_shared.js +661 -184
- package/dist/utils/lua/lua_alias_shared.js.map +1 -1
- package/dist/utils/lua/lua_local_budget.test.d.ts +2 -0
- package/dist/utils/lua/lua_local_budget.test.d.ts.map +1 -0
- package/dist/utils/lua/lua_local_budget.test.js +167 -0
- package/dist/utils/lua/lua_local_budget.test.js.map +1 -0
- package/dist/utils/lua/lua_processor.d.ts +6 -0
- package/dist/utils/lua/lua_processor.d.ts.map +1 -1
- package/dist/utils/lua/lua_processor.js +18 -9
- package/dist/utils/lua/lua_processor.js.map +1 -1
- package/dist/utils/lua/lua_processor.test.js +36 -0
- package/dist/utils/lua/lua_processor.test.js.map +1 -1
- package/dist/utils/lua/lua_simplify.d.ts.map +1 -1
- package/dist/utils/lua/lua_simplify.js +5 -1
- package/dist/utils/lua/lua_simplify.js.map +1 -1
- package/package.json +1 -1
- package/templates/help/build.txt +9 -7
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const lua_processor_1 = require("./lua_processor");
|
|
4
|
+
describe("Lua repeated expression alias lexical bindings", () => {
|
|
5
|
+
const options = {
|
|
6
|
+
stripComments: true,
|
|
7
|
+
maxIndentLevel: 1,
|
|
8
|
+
lineBehavior: "tight",
|
|
9
|
+
maxLineLength: 180,
|
|
10
|
+
renameLocalVariables: false,
|
|
11
|
+
aliasRepeatedExpressions: true,
|
|
12
|
+
aliasLiterals: false,
|
|
13
|
+
packLocalDeclarations: false,
|
|
14
|
+
simplifyExpressions: false,
|
|
15
|
+
removeUnusedLocals: false,
|
|
16
|
+
removeUnusedFunctions: false,
|
|
17
|
+
functionNamesToKeep: [],
|
|
18
|
+
renameTableFields: false,
|
|
19
|
+
tableEntryKeysToRename: [],
|
|
20
|
+
};
|
|
21
|
+
function repeatedCalls(expression, count = 7, prefix = "globalUse") {
|
|
22
|
+
return Array.from({ length: count }, (_, index) => `local ${prefix}${index}=${expression}()`).join("\n");
|
|
23
|
+
}
|
|
24
|
+
function repeatedTerms(identifier, count) {
|
|
25
|
+
return Array.from({ length: count }, () => identifier).join("+");
|
|
26
|
+
}
|
|
27
|
+
it("aliases genuine globals without including shadowed parameter uses in their scope", () => {
|
|
28
|
+
const input = `
|
|
29
|
+
local function readClock()
|
|
30
|
+
${repeatedCalls("time")}
|
|
31
|
+
return globalUse0
|
|
32
|
+
end
|
|
33
|
+
local function readParameter(time)
|
|
34
|
+
return time
|
|
35
|
+
end
|
|
36
|
+
return readClock(), readParameter(42)
|
|
37
|
+
`;
|
|
38
|
+
const output = (0, lua_processor_1.processLua)(input, options);
|
|
39
|
+
const readClockIndex = output.indexOf("local function readClock()");
|
|
40
|
+
const aliasIndex = output.indexOf("local _a=time");
|
|
41
|
+
const readParameterIndex = output.indexOf("local function readParameter(time)");
|
|
42
|
+
expect(aliasIndex).toBeGreaterThan(readClockIndex);
|
|
43
|
+
expect(aliasIndex).toBeLessThan(readParameterIndex);
|
|
44
|
+
expect(output).toContain("local function readParameter(time) return time end");
|
|
45
|
+
expect(output).not.toContain("local function readParameter(time) return _a end");
|
|
46
|
+
});
|
|
47
|
+
it("does not count shadowed parameters as global alias candidates", () => {
|
|
48
|
+
const input = `
|
|
49
|
+
local function sum(time)
|
|
50
|
+
return ${repeatedTerms("time", 12)}
|
|
51
|
+
end
|
|
52
|
+
return sum(1)
|
|
53
|
+
`;
|
|
54
|
+
const output = (0, lua_processor_1.processLua)(input, options);
|
|
55
|
+
expect(output).not.toMatch(/local _[a-z]+=time/);
|
|
56
|
+
expect(output).toContain(`return ${repeatedTerms("time", 12)}`);
|
|
57
|
+
});
|
|
58
|
+
it("evaluates local initializers before introducing their bindings", () => {
|
|
59
|
+
const input = `
|
|
60
|
+
${repeatedCalls("time")}
|
|
61
|
+
local time = time()
|
|
62
|
+
local localValue = time
|
|
63
|
+
return localValue
|
|
64
|
+
`;
|
|
65
|
+
const output = (0, lua_processor_1.processLua)(input, options);
|
|
66
|
+
expect(output).toContain("local _a=time");
|
|
67
|
+
expect(output).toContain("local time=_a()");
|
|
68
|
+
expect(output).toContain("local localValue=time");
|
|
69
|
+
});
|
|
70
|
+
it("preserves locals captured by nested functions", () => {
|
|
71
|
+
const input = `
|
|
72
|
+
${repeatedCalls("time")}
|
|
73
|
+
local function makeReader()
|
|
74
|
+
local time = 42
|
|
75
|
+
local function read()
|
|
76
|
+
return time
|
|
77
|
+
end
|
|
78
|
+
return read
|
|
79
|
+
end
|
|
80
|
+
return makeReader()
|
|
81
|
+
`;
|
|
82
|
+
const output = (0, lua_processor_1.processLua)(input, options);
|
|
83
|
+
expect(output).toContain("local _a=time");
|
|
84
|
+
expect(output).toContain("local time=42");
|
|
85
|
+
expect(output).toContain("local function read() return time end");
|
|
86
|
+
});
|
|
87
|
+
it("preserves bindings introduced by anonymous function parameters", () => {
|
|
88
|
+
const input = `
|
|
89
|
+
${repeatedCalls("key", 14)}
|
|
90
|
+
local callback = function(key)
|
|
91
|
+
return key
|
|
92
|
+
end
|
|
93
|
+
return callback
|
|
94
|
+
`;
|
|
95
|
+
const output = (0, lua_processor_1.processLua)(input, options);
|
|
96
|
+
expect(output).toContain("local _a=key");
|
|
97
|
+
expect(output).toContain("local callback=function(key)");
|
|
98
|
+
expect(output).toContain("return key");
|
|
99
|
+
});
|
|
100
|
+
it("preserves local function bindings that shadow safe globals", () => {
|
|
101
|
+
const input = `
|
|
102
|
+
${repeatedCalls("time")}
|
|
103
|
+
local function time()
|
|
104
|
+
return 42
|
|
105
|
+
end
|
|
106
|
+
local localValue = time()
|
|
107
|
+
return localValue
|
|
108
|
+
`;
|
|
109
|
+
const output = (0, lua_processor_1.processLua)(input, options);
|
|
110
|
+
expect(output).toContain("local _a=time");
|
|
111
|
+
expect(output).toContain("local function time()");
|
|
112
|
+
expect(output).toContain("local localValue=time()");
|
|
113
|
+
});
|
|
114
|
+
it("does not rewrite local assignment targets", () => {
|
|
115
|
+
const input = `
|
|
116
|
+
local function triangleWave(phase)
|
|
117
|
+
local tri
|
|
118
|
+
if phase < 0.5 then
|
|
119
|
+
tri = phase * 4 - 1
|
|
120
|
+
else
|
|
121
|
+
tri = 3 - phase * 4
|
|
122
|
+
end
|
|
123
|
+
return ${repeatedTerms("tri", 12)}
|
|
124
|
+
end
|
|
125
|
+
return triangleWave(0.25)
|
|
126
|
+
`;
|
|
127
|
+
const output = (0, lua_processor_1.processLua)(input, options);
|
|
128
|
+
expect(output).not.toMatch(/local _[a-z]+=tri/);
|
|
129
|
+
expect(output).toContain("tri=phase*4-1");
|
|
130
|
+
expect(output).toContain("tri=3-phase*4");
|
|
131
|
+
expect(output).toContain(`return ${repeatedTerms("tri", 12)}`);
|
|
132
|
+
});
|
|
133
|
+
it("preserves numeric and generic for-loop bindings", () => {
|
|
134
|
+
const input = `
|
|
135
|
+
local function visit(items)
|
|
136
|
+
for key = 1, 2 do
|
|
137
|
+
consume(${repeatedTerms("key", 14)})
|
|
138
|
+
end
|
|
139
|
+
for line in items do
|
|
140
|
+
consume(${repeatedTerms("line", 8)})
|
|
141
|
+
end
|
|
142
|
+
end
|
|
143
|
+
return visit
|
|
144
|
+
`;
|
|
145
|
+
const output = (0, lua_processor_1.processLua)(input, options);
|
|
146
|
+
expect(output).not.toMatch(/local _[a-z]+=(key|line)/);
|
|
147
|
+
expect(output).toContain(`consume(${repeatedTerms("key", 14)})`);
|
|
148
|
+
expect(output).toContain(`consume(${repeatedTerms("line", 8)})`);
|
|
149
|
+
});
|
|
150
|
+
it("keeps repeat-body locals visible in the until condition", () => {
|
|
151
|
+
const input = `
|
|
152
|
+
${repeatedCalls("key", 14)}
|
|
153
|
+
repeat
|
|
154
|
+
local key = nextKey()
|
|
155
|
+
consume(key)
|
|
156
|
+
until key
|
|
157
|
+
`;
|
|
158
|
+
const output = (0, lua_processor_1.processLua)(input, options);
|
|
159
|
+
expect(output).toContain("local _a=key");
|
|
160
|
+
expect(output).toContain("local key=nextKey()");
|
|
161
|
+
expect(output).toContain("consume(key)");
|
|
162
|
+
expect(output).toContain("until key");
|
|
163
|
+
});
|
|
164
|
+
it("restores the outer binding after leaving a nested block", () => {
|
|
165
|
+
const input = `
|
|
166
|
+
${repeatedCalls("line")}
|
|
167
|
+
do
|
|
168
|
+
local line = "local"
|
|
169
|
+
consume(line)
|
|
170
|
+
end
|
|
171
|
+
local outside = line
|
|
172
|
+
return outside
|
|
173
|
+
`;
|
|
174
|
+
const output = (0, lua_processor_1.processLua)(input, options);
|
|
175
|
+
expect(output).toContain("local _a=line");
|
|
176
|
+
expect(output).toContain('local line="local"');
|
|
177
|
+
expect(output).toContain("consume(line)");
|
|
178
|
+
expect(output).toContain("local outside=_a");
|
|
179
|
+
});
|
|
180
|
+
it("does not treat members of a shadowed library base as global expressions", () => {
|
|
181
|
+
const input = `
|
|
182
|
+
local function useLocalMath()
|
|
183
|
+
local math = {
|
|
184
|
+
sin = function(value)
|
|
185
|
+
return value
|
|
186
|
+
end,
|
|
187
|
+
}
|
|
188
|
+
return math.sin(1) + math.sin(2) + math.sin(3) + math.sin(4)
|
|
189
|
+
end
|
|
190
|
+
return useLocalMath()
|
|
191
|
+
`;
|
|
192
|
+
const output = (0, lua_processor_1.processLua)(input, options);
|
|
193
|
+
expect(output).not.toMatch(/local _[a-z]+=math\.sin/);
|
|
194
|
+
expect(output).toContain("return math.sin(1)+math.sin(2)+math.sin(3)+math.sin(4)");
|
|
195
|
+
});
|
|
196
|
+
it("chooses generated alias names that cannot collide with user bindings", () => {
|
|
197
|
+
const input = `
|
|
198
|
+
local _a = "user value"
|
|
199
|
+
${repeatedCalls("time")}
|
|
200
|
+
return _a
|
|
201
|
+
`;
|
|
202
|
+
const output = (0, lua_processor_1.processLua)(input, options);
|
|
203
|
+
const aliasMatch = output.match(/local ([A-Za-z_][A-Za-z0-9_]*)=time(?=\s|$)/);
|
|
204
|
+
const aliasName = aliasMatch?.[1];
|
|
205
|
+
expect(aliasName).toBeDefined();
|
|
206
|
+
expect(aliasName).not.toBe("_a");
|
|
207
|
+
expect(output).toContain(`local globalUse0=${aliasName}()`);
|
|
208
|
+
expect(output).toContain('local _a="user value"');
|
|
209
|
+
expect(output).toContain("return _a");
|
|
210
|
+
});
|
|
211
|
+
});
|
|
212
|
+
//# sourceMappingURL=lua_alias_expressions.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lua_alias_expressions.test.js","sourceRoot":"","sources":["../../../src/utils/lua/lua_alias_expressions.test.ts"],"names":[],"mappings":";;AAAA,mDAAsE;AAEtE,QAAQ,CAAC,gDAAgD,EAAE,GAAG,EAAE;IAC9D,MAAM,OAAO,GAA4B;QACvC,aAAa,EAAE,IAAI;QACnB,cAAc,EAAE,CAAC;QACjB,YAAY,EAAE,OAAO;QACrB,aAAa,EAAE,GAAG;QAClB,oBAAoB,EAAE,KAAK;QAC3B,wBAAwB,EAAE,IAAI;QAC9B,aAAa,EAAE,KAAK;QACpB,qBAAqB,EAAE,KAAK;QAC5B,mBAAmB,EAAE,KAAK;QAC1B,kBAAkB,EAAE,KAAK;QACzB,qBAAqB,EAAE,KAAK;QAC5B,mBAAmB,EAAE,EAAE;QACvB,iBAAiB,EAAE,KAAK;QACxB,sBAAsB,EAAE,EAAE;KAC3B,CAAC;IAEF,SAAS,aAAa,CAAC,UAAkB,EAAE,KAAK,GAAG,CAAC,EAAE,MAAM,GAAG,WAAW;QACxE,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,E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AC,MAAM,CAAC,CAAC,SAAS,CAAC,uBAAuB,CAAC,CAAC;QAClD,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lua_alias_literals.d.ts","sourceRoot":"","sources":["../../../src/utils/lua/lua_alias_literals.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"lua_alias_literals.d.ts","sourceRoot":"","sources":["../../../src/utils/lua/lua_alias_literals.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC;AACrC,OAAO,EAAa,aAAa,EAAgB,MAAM,oBAAoB,CAAC;AAwF5E,eAAO,MAAM,oBAAoB,EAAE,aAKlC,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,QAAQ,CAAC,KAAK,GAAG,QAAQ,CAAC,KAAK,CAEtE"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.literalAliasStrategy = void 0;
|
|
3
4
|
exports.aliasLiteralsInAST = aliasLiteralsInAST;
|
|
4
5
|
const lua_alias_shared_1 = require("./lua_alias_shared");
|
|
5
6
|
// ============================================================================
|
|
@@ -29,8 +30,8 @@ function serializeLiteral(node) {
|
|
|
29
30
|
return null;
|
|
30
31
|
}
|
|
31
32
|
}
|
|
32
|
-
//
|
|
33
|
-
function
|
|
33
|
+
// Estimate the source bytes saved by aliasing this literal.
|
|
34
|
+
function estimateLiteralSavings(info, aliasNameLength) {
|
|
34
35
|
const node = info.node;
|
|
35
36
|
// Calculate the cost of the literal per use
|
|
36
37
|
let literalCost = 0;
|
|
@@ -55,11 +56,10 @@ function shouldAliasLiteral(info) {
|
|
|
55
56
|
literalCost = 3;
|
|
56
57
|
break;
|
|
57
58
|
default:
|
|
58
|
-
return
|
|
59
|
+
return Number.NEGATIVE_INFINITY;
|
|
59
60
|
}
|
|
60
61
|
// Calculate the cost of creating an alias
|
|
61
62
|
// Format: "local La=<literal>" (minimum)
|
|
62
|
-
const aliasNameLength = info.aliasName?.length ?? 2; // minimum expected alias length
|
|
63
63
|
const declarationCost = 6 + aliasNameLength + literalCost; // "local " + name + "=" + literal
|
|
64
64
|
// Calculate the cost of using the alias (just the identifier length)
|
|
65
65
|
const useCost = aliasNameLength;
|
|
@@ -67,75 +67,14 @@ function shouldAliasLiteral(info) {
|
|
|
67
67
|
const aliasTotalCost = declarationCost + useCost * info.count;
|
|
68
68
|
// Total cost without alias: literalCost * count
|
|
69
69
|
const noAliasTotalCost = literalCost * info.count;
|
|
70
|
-
|
|
71
|
-
return aliasTotalCost < noAliasTotalCost;
|
|
72
|
-
}
|
|
73
|
-
// Recursively replace literals with aliases
|
|
74
|
-
function replaceLiteral(node, tracker) {
|
|
75
|
-
if (!node)
|
|
76
|
-
return node;
|
|
77
|
-
// Check if this literal itself should be replaced
|
|
78
|
-
const key = serializeLiteral(node);
|
|
79
|
-
if (key) {
|
|
80
|
-
const alias = tracker.getAlias(key);
|
|
81
|
-
//const literalNode = node as LiteralNode;
|
|
82
|
-
// const displayValue =
|
|
83
|
-
// literalNode.type === "StringLiteral" ? (literalNode.raw ?? "<missing raw>") : literalNode.value;
|
|
84
|
-
if (alias) {
|
|
85
|
-
// This literal should be replaced with an alias
|
|
86
|
-
return {
|
|
87
|
-
type: "Identifier",
|
|
88
|
-
name: alias,
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
// This is a literal but shouldn't be aliased, return as-is
|
|
92
|
-
return node;
|
|
93
|
-
}
|
|
94
|
-
// Not a literal, recursively replace in child expressions
|
|
95
|
-
switch (node.type) {
|
|
96
|
-
case "BinaryExpression":
|
|
97
|
-
case "LogicalExpression":
|
|
98
|
-
node.left = replaceLiteral(node.left, tracker);
|
|
99
|
-
node.right = replaceLiteral(node.right, tracker);
|
|
100
|
-
break;
|
|
101
|
-
case "UnaryExpression":
|
|
102
|
-
node.argument = replaceLiteral(node.argument, tracker);
|
|
103
|
-
break;
|
|
104
|
-
case "CallExpression":
|
|
105
|
-
node.base = replaceLiteral(node.base, tracker);
|
|
106
|
-
if (node.arguments) {
|
|
107
|
-
node.arguments = node.arguments.map((arg) => replaceLiteral(arg, tracker));
|
|
108
|
-
}
|
|
109
|
-
break;
|
|
110
|
-
case "TableCallExpression":
|
|
111
|
-
node.base = replaceLiteral(node.base, tracker);
|
|
112
|
-
node.arguments = replaceLiteral(node.arguments, tracker);
|
|
113
|
-
break;
|
|
114
|
-
case "StringCallExpression":
|
|
115
|
-
node.base = replaceLiteral(node.base, tracker);
|
|
116
|
-
break;
|
|
117
|
-
case "MemberExpression":
|
|
118
|
-
node.base = replaceLiteral(node.base, tracker);
|
|
119
|
-
break;
|
|
120
|
-
case "IndexExpression":
|
|
121
|
-
node.base = replaceLiteral(node.base, tracker);
|
|
122
|
-
node.index = replaceLiteral(node.index, tracker);
|
|
123
|
-
break;
|
|
124
|
-
case "TableConstructorExpression":
|
|
125
|
-
if (node.fields) {
|
|
126
|
-
node.fields.forEach((field) => {
|
|
127
|
-
if (field.type === "TableKey") {
|
|
128
|
-
if (field.key)
|
|
129
|
-
field.key = replaceLiteral(field.key, tracker);
|
|
130
|
-
}
|
|
131
|
-
if (field.value)
|
|
132
|
-
field.value = replaceLiteral(field.value, tracker);
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
break;
|
|
136
|
-
}
|
|
137
|
-
return node;
|
|
70
|
+
return noAliasTotalCost - aliasTotalCost;
|
|
138
71
|
}
|
|
72
|
+
exports.literalAliasStrategy = {
|
|
73
|
+
rule: "aliasLiterals",
|
|
74
|
+
prefix: LITERAL_ALIAS_PREFIX,
|
|
75
|
+
serialize: serializeLiteral,
|
|
76
|
+
estimateSavings: estimateLiteralSavings,
|
|
77
|
+
};
|
|
139
78
|
/**
|
|
140
79
|
* Alias repeated literal values in the AST
|
|
141
80
|
*
|
|
@@ -154,12 +93,6 @@ function replaceLiteral(node, tracker) {
|
|
|
154
93
|
* local z = La .. "demo"
|
|
155
94
|
*/
|
|
156
95
|
function aliasLiteralsInAST(ast) {
|
|
157
|
-
|
|
158
|
-
prefix: LITERAL_ALIAS_PREFIX,
|
|
159
|
-
serialize: serializeLiteral,
|
|
160
|
-
shouldAlias: shouldAliasLiteral,
|
|
161
|
-
replaceExpression: replaceLiteral,
|
|
162
|
-
};
|
|
163
|
-
return (0, lua_alias_shared_1.runAliasPass)(ast, strategy);
|
|
96
|
+
return (0, lua_alias_shared_1.runAliasPass)(ast, exports.literalAliasStrategy);
|
|
164
97
|
}
|
|
165
98
|
//# sourceMappingURL=lua_alias_literals.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lua_alias_literals.js","sourceRoot":"","sources":["../../../src/utils/lua/lua_alias_literals.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lua_alias_literals.js","sourceRoot":"","sources":["../../../src/utils/lua/lua_alias_literals.ts"],"names":[],"mappings":";;;AAiHA,gDAEC;AAlHD,yDAA4E;AAG5E,+EAA+E;AAC/E,sEAAsE;AACtE,+EAA+E;AAE/E,gBAAgB;AAChB,MAAM,oBAAoB,GAAG,GAAG,CAAC;AAEjC,0EAA0E;AAC1E,2GAA2G;AAE3G,qDAAqD;AACrD,SAAS,gBAAgB,CAAC,IAAyB;IACjD,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IAEvB,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;QAClB,KAAK,eAAe,CAAC,CAAC,CAAC;YACrB,MAAM,OAAO,GAAG,IAAyB,CAAC;YAC1C,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,IAAI,IAAI,CA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AG,CAAC,CAAC;YAChB,MAAM;QAER;YACE,OAAO,MAAM,CAAC,iBAAiB,CAAC;IACpC,CAAC;IAED,0CAA0C;IAC1C,yCAAyC;IACzC,MAAM,eAAe,GAAG,CAAC,GAAG,eAAe,GAAG,WAAW,CAAC,CAAC,kCAAkC;IAE7F,qEAAqE;IACrE,MAAM,OAAO,GAAG,eAAe,CAAC;IAEhC,yDAAyD;IACzD,MAAM,cAAc,GAAG,eAAe,GAAG,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC;IAE9D,gDAAgD;IAChD,MAAM,gBAAgB,GAAG,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC;IAElD,OAAO,gBAAgB,GAAG,cAAc,CAAC;AAC3C,CAAC;AAEY,QAAA,oBAAoB,GAAkB;IACjD,IAAI,EAAE,eAAe;IACrB,MAAM,EAAE,oBAAoB;IAC5B,SAAS,EAAE,gBAAgB;IAC3B,eAAe,EAAE,sBAAsB;CACxC,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,SAAgB,kBAAkB,CAAC,GAAmB;IACpD,OAAO,IAAA,+BAAY,EAAC,GAAG,EAAE,4BAAoB,CAAC,CAAC;AACjD,CAAC"}
|
|
@@ -1,31 +1,66 @@
|
|
|
1
1
|
import * as luaparse from "luaparse";
|
|
2
2
|
export declare function generateAliasName(index: number, prefix?: string): string;
|
|
3
3
|
export declare function cloneExpression<T extends luaparse.Expression>(node: T): T;
|
|
4
|
+
export type AliasScopeNode = luaparse.Chunk | luaparse.FunctionDeclaration | luaparse.IfClause | luaparse.ElseifClause | luaparse.ElseClause | luaparse.WhileStatement | luaparse.DoStatement | luaparse.RepeatStatement | luaparse.ForNumericStatement | luaparse.ForGenericStatement;
|
|
5
|
+
export interface AliasBindingScope {
|
|
6
|
+
isShadowed(name: string): boolean;
|
|
7
|
+
}
|
|
4
8
|
export interface AliasInfo {
|
|
5
9
|
serialized: string;
|
|
6
10
|
node: luaparse.Expression;
|
|
7
11
|
count: number;
|
|
8
|
-
scopes:
|
|
12
|
+
scopes: AliasScopeNode[];
|
|
13
|
+
occurrences: luaparse.Expression[];
|
|
9
14
|
aliasName?: string;
|
|
10
|
-
targetScope?:
|
|
15
|
+
targetScope?: AliasScopeNode;
|
|
16
|
+
estimatedSavings?: number;
|
|
17
|
+
selected?: boolean;
|
|
18
|
+
order: number;
|
|
19
|
+
strategy: AliasStrategy;
|
|
20
|
+
conflicts: Set<AliasInfo>;
|
|
11
21
|
}
|
|
12
22
|
export declare class AliasTracker {
|
|
23
|
+
private strategy;
|
|
24
|
+
private nextOrder;
|
|
13
25
|
private items;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
record(key: string, node: luaparse.Expression, scope: luaparse.Chunk | luaparse.Statement): void;
|
|
18
|
-
getAliasableItems(predicate: (info: AliasInfo) => boolean): AliasInfo[];
|
|
19
|
-
getAlias(key: string): string | null;
|
|
26
|
+
constructor(strategy: AliasStrategy, nextOrder: () => number);
|
|
27
|
+
record(key: string, node: luaparse.Expression, scope: AliasScopeNode): AliasInfo;
|
|
28
|
+
getItems(): AliasInfo[];
|
|
20
29
|
}
|
|
21
|
-
export declare function
|
|
22
|
-
export declare function
|
|
23
|
-
export declare function insertDeclarationsIntoScopes(ast: luaparse.Chunk, declarationsByScope: Map<luaparse.Chunk | luaparse.Statement, AliasInfo[]>): void;
|
|
30
|
+
export declare function findCommonAncestor(scopes: AliasScopeNode[], scopeParents: WeakMap<AliasScopeNode, AliasScopeNode>, rootScope: AliasScopeNode): AliasScopeNode;
|
|
31
|
+
export declare function insertDeclarationsIntoScopes(declarationsByScope: Map<AliasScopeNode, AliasInfo[]>, generatedDeclarations?: WeakSet<luaparse.LocalStatement>): void;
|
|
24
32
|
export type AliasStrategy = {
|
|
33
|
+
rule: AliasRuleName;
|
|
25
34
|
prefix: string;
|
|
26
|
-
serialize(node: luaparse.Expression | null | undefined): string | null;
|
|
27
|
-
|
|
28
|
-
|
|
35
|
+
serialize(node: luaparse.Expression | null | undefined, bindings: AliasBindingScope): string | null;
|
|
36
|
+
estimateSavings(info: AliasInfo, aliasNameLength: number): number;
|
|
37
|
+
};
|
|
38
|
+
export type AliasRuleName = "aliasLiterals" | "aliasRepeatedExpressions";
|
|
39
|
+
export type AliasRuleReport = {
|
|
40
|
+
accepted: number;
|
|
41
|
+
omitted: number;
|
|
42
|
+
estimatedBytesSaved: number;
|
|
43
|
+
estimatedBytesOmitted: number;
|
|
44
|
+
};
|
|
45
|
+
export type AliasFunctionReport = {
|
|
46
|
+
functionName: string;
|
|
47
|
+
sourceLine: number;
|
|
48
|
+
localLimit: number;
|
|
49
|
+
peakActiveLocals: number;
|
|
50
|
+
existingLocalsAtPeak: number;
|
|
51
|
+
generatedLocalsAtPeak: number;
|
|
52
|
+
rules: Record<AliasRuleName, AliasRuleReport>;
|
|
53
|
+
};
|
|
54
|
+
export type AliasPassReport = {
|
|
55
|
+
localLimit: number;
|
|
56
|
+
constrainedFunctions: AliasFunctionReport[];
|
|
57
|
+
};
|
|
58
|
+
export type AliasPassResult = {
|
|
59
|
+
ast: luaparse.Chunk;
|
|
60
|
+
report: AliasPassReport;
|
|
29
61
|
};
|
|
62
|
+
export declare const LUA_MAX_ACTIVE_LOCALS = 200;
|
|
63
|
+
export declare function createEmptyAliasPassReport(): AliasPassReport;
|
|
64
|
+
export declare function runAliasPasses(ast: luaparse.Chunk, strategies: AliasStrategy[]): AliasPassResult;
|
|
30
65
|
export declare function runAliasPass(ast: luaparse.Chunk, strategy: AliasStrategy): luaparse.Chunk;
|
|
31
66
|
//# sourceMappingURL=lua_alias_shared.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lua_alias_shared.d.ts","sourceRoot":"","sources":["../../../src/utils/lua/lua_alias_shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC;AAQrC,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,GAAE,MAAY,GA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