warcraft-vscode 0.2.9 → 0.2.10
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/CHANGELOG.md +4 -0
- package/bin/lua/prometheus/compiler/compiler.lua +10 -9
- package/out/cli.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -66,6 +66,7 @@ function Compiler:createBlock()
|
|
|
66
66
|
repeat
|
|
67
67
|
id = math.random(0, 2^24)
|
|
68
68
|
until not self.usedBlockIds[id];
|
|
69
|
+
self.usedBlockIds[id] = true;
|
|
69
70
|
|
|
70
71
|
local scope = Scope:new(self.containerFuncScope);
|
|
71
72
|
local block = {
|
|
@@ -660,13 +661,13 @@ function Compiler:emitContainerFuncBody()
|
|
|
660
661
|
end
|
|
661
662
|
|
|
662
663
|
local mid = l + math.ceil(len / 2);
|
|
663
|
-
local bound = math.random(tb[mid - 1].id, tb[mid].id);
|
|
664
|
+
local bound = math.random(tb[mid - 1].id + 1, tb[mid].id);
|
|
664
665
|
local ifScope = scope or Scope:new(pScope);
|
|
665
666
|
|
|
666
667
|
local lBlock = buildWhileBody(tb, l, mid - 1, ifScope);
|
|
667
668
|
local rBlock = buildWhileBody(tb, mid, r, ifScope);
|
|
668
669
|
|
|
669
|
-
return buildIfBlock(ifScope, bound, lBlock, rBlock)
|
|
670
|
+
return buildIfBlock(ifScope, bound, lBlock, rBlock);
|
|
670
671
|
end
|
|
671
672
|
|
|
672
673
|
local whileBody = buildWhileBody(blocks, 1, #blocks, self.containerFuncScope, self.whileScope);
|
|
@@ -1222,7 +1223,7 @@ function Compiler:compileStatement(statement, funcDepth)
|
|
|
1222
1223
|
return;
|
|
1223
1224
|
end
|
|
1224
1225
|
|
|
1225
|
-
-- Function
|
|
1226
|
+
-- Function Call Statement
|
|
1226
1227
|
if(statement.kind == AstKind.FunctionCallStatement) then
|
|
1227
1228
|
local baseReg = self:compileExpression(statement.base, funcDepth, 1)[1];
|
|
1228
1229
|
local retReg = self:allocRegister(false);
|
|
@@ -1253,7 +1254,7 @@ function Compiler:compileStatement(statement, funcDepth)
|
|
|
1253
1254
|
return;
|
|
1254
1255
|
end
|
|
1255
1256
|
|
|
1256
|
-
-- Pass
|
|
1257
|
+
-- Pass Self Function Call Statement
|
|
1257
1258
|
if(statement.kind == AstKind.PassSelfFunctionCallStatement) then
|
|
1258
1259
|
local baseReg = self:compileExpression(statement.base, funcDepth, 1)[1];
|
|
1259
1260
|
local tmpReg = self:allocRegister(false);
|
|
@@ -1661,7 +1662,7 @@ function Compiler:compileStatement(statement, funcDepth)
|
|
|
1661
1662
|
return;
|
|
1662
1663
|
end
|
|
1663
1664
|
|
|
1664
|
-
-- For
|
|
1665
|
+
-- For In Statement
|
|
1665
1666
|
if(statement.kind == AstKind.ForInStatement) then
|
|
1666
1667
|
local expressionsLength = #statement.expressions;
|
|
1667
1668
|
local exprregs = {};
|
|
@@ -1791,7 +1792,7 @@ function Compiler:compileStatement(statement, funcDepth)
|
|
|
1791
1792
|
return;
|
|
1792
1793
|
end
|
|
1793
1794
|
|
|
1794
|
-
--
|
|
1795
|
+
-- Continue Statement
|
|
1795
1796
|
if(statement.kind == AstKind.ContinueStatement) then
|
|
1796
1797
|
local toFreeVars = {};
|
|
1797
1798
|
local statScope;
|
|
@@ -1823,7 +1824,7 @@ function Compiler:compileStatement(statement, funcDepth)
|
|
|
1823
1824
|
return;
|
|
1824
1825
|
end
|
|
1825
1826
|
|
|
1826
|
-
--
|
|
1827
|
+
-- Compound Statements
|
|
1827
1828
|
local compoundConstructors = {
|
|
1828
1829
|
[AstKind.CompoundAddStatement] = Ast.CompoundAddStatement,
|
|
1829
1830
|
[AstKind.CompoundSubStatement] = Ast.CompoundSubStatement,
|
|
@@ -1969,7 +1970,7 @@ function Compiler:compileExpression(expression, funcDepth, numReturns)
|
|
|
1969
1970
|
return regs;
|
|
1970
1971
|
end
|
|
1971
1972
|
|
|
1972
|
-
-- Function
|
|
1973
|
+
-- Function Call Expression
|
|
1973
1974
|
if(expression.kind == AstKind.FunctionCallExpression) then
|
|
1974
1975
|
local baseReg = self:compileExpression(expression.base, funcDepth, 1)[1];
|
|
1975
1976
|
|
|
@@ -2025,7 +2026,7 @@ function Compiler:compileExpression(expression, funcDepth, numReturns)
|
|
|
2025
2026
|
return retRegs;
|
|
2026
2027
|
end
|
|
2027
2028
|
|
|
2028
|
-
-- Pass
|
|
2029
|
+
-- Pass Self Function Call Expression
|
|
2029
2030
|
if(expression.kind == AstKind.PassSelfFunctionCallExpression) then
|
|
2030
2031
|
local baseReg = self:compileExpression(expression.base, funcDepth, 1)[1];
|
|
2031
2032
|
local retRegs = {};
|