mlogjs 0.1.9 → 0.2.0

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.
Files changed (201) hide show
  1. package/README.md +1 -1
  2. package/build/Compiler.js +40 -13
  3. package/build/Compiler.js.map +1 -1
  4. package/build/Scope.js.map +1 -1
  5. package/build/bin.js +16 -9
  6. package/build/bin.js.map +1 -1
  7. package/build/handlers/BlockStatement.js.map +1 -1
  8. package/build/handlers/CallExpression.js.map +1 -1
  9. package/build/handlers/ForStatement.js.map +1 -1
  10. package/build/handlers/Function.js +6 -3
  11. package/build/handlers/Function.js.map +1 -1
  12. package/build/handlers/Identifier.js.map +1 -1
  13. package/build/handlers/IfStatement.js.map +1 -1
  14. package/build/handlers/Literal.js +3 -1
  15. package/build/handlers/Literal.js.map +1 -1
  16. package/build/handlers/Object.d.ts +1 -0
  17. package/build/handlers/Object.js +12 -1
  18. package/build/handlers/Object.js.map +1 -1
  19. package/build/handlers/OperationExpressions.js +2 -1
  20. package/build/handlers/OperationExpressions.js.map +1 -1
  21. package/build/handlers/Program.js.map +1 -1
  22. package/build/handlers/Statements.js +3 -1
  23. package/build/handlers/Statements.js.map +1 -1
  24. package/build/handlers/TemplateExpression.js.map +1 -1
  25. package/build/handlers/VariableDeclaration.js +43 -19
  26. package/build/handlers/VariableDeclaration.js.map +1 -1
  27. package/build/handlers/WhileStatement.js.map +1 -1
  28. package/build/handlers/index.js +5 -1
  29. package/build/handlers/index.js.map +1 -1
  30. package/build/index.js.map +1 -1
  31. package/build/instructions/AddressResolver.js +1 -2
  32. package/build/instructions/AddressResolver.js.map +1 -1
  33. package/build/instructions/ControlInstructions.js.map +1 -1
  34. package/build/instructions/EndInstruction.js.map +1 -1
  35. package/build/instructions/InstructionBase.js.map +1 -1
  36. package/build/instructions/JumpInstruction.js.map +1 -1
  37. package/build/instructions/OperationInstruction.js.map +1 -1
  38. package/build/instructions/SetCounterInstruction.js.map +1 -1
  39. package/build/instructions/SetInstruction.js.map +1 -1
  40. package/build/instructions/ZeroSpaceInstruction.js.map +1 -1
  41. package/build/instructions/index.js +5 -1
  42. package/build/instructions/index.js.map +1 -1
  43. package/build/macros/Blocks.js +15 -6
  44. package/build/macros/Blocks.js.map +1 -1
  45. package/build/macros/Building.d.ts +11 -0
  46. package/build/macros/Building.js +81 -0
  47. package/build/macros/Building.js.map +1 -0
  48. package/build/macros/Draw.js +7 -2
  49. package/build/macros/Draw.js.map +1 -1
  50. package/build/macros/Function.js.map +1 -1
  51. package/build/macros/Items.d.ts +5 -0
  52. package/build/macros/Items.js +20 -0
  53. package/build/macros/Items.js.map +1 -0
  54. package/build/macros/Liquids.d.ts +5 -0
  55. package/build/macros/Liquids.js +18 -0
  56. package/build/macros/Liquids.js.map +1 -0
  57. package/build/macros/Math.js +9 -9
  58. package/build/macros/Math.js.map +1 -1
  59. package/build/macros/Memory.d.ts +5 -0
  60. package/build/macros/Memory.js +61 -0
  61. package/build/macros/Memory.js.map +1 -0
  62. package/build/macros/Namespace.d.ts +21 -0
  63. package/build/macros/Namespace.js +98 -0
  64. package/build/macros/Namespace.js.map +1 -0
  65. package/build/macros/Other.d.ts +0 -3
  66. package/build/macros/Other.js +2 -11
  67. package/build/macros/Other.js.map +1 -1
  68. package/build/macros/RawValue.d.ts +5 -0
  69. package/build/macros/RawValue.js +16 -0
  70. package/build/macros/RawValue.js.map +1 -0
  71. package/build/macros/Symbol.d.ts +0 -0
  72. package/build/macros/Symbol.js +1 -0
  73. package/build/macros/Symbol.js.map +1 -0
  74. package/build/macros/SymbolNamespace.d.ts +0 -0
  75. package/build/macros/SymbolNamespace.js +1 -0
  76. package/build/macros/SymbolNamespace.js.map +1 -0
  77. package/build/macros/TypeFactory.js.map +1 -1
  78. package/build/macros/Units.d.ts +5 -0
  79. package/build/macros/Units.js +18 -0
  80. package/build/macros/Units.js.map +1 -0
  81. package/build/macros/Vars.d.ts +5 -0
  82. package/build/macros/Vars.js +18 -0
  83. package/build/macros/Vars.js.map +1 -0
  84. package/build/macros/commands/Asm.d.ts +5 -0
  85. package/build/macros/commands/Asm.js +21 -0
  86. package/build/macros/commands/Asm.js.map +1 -0
  87. package/build/macros/commands/Draw.d.ts +5 -0
  88. package/build/macros/commands/Draw.js +39 -0
  89. package/build/macros/commands/Draw.js.map +1 -0
  90. package/build/macros/commands/DrawFlush.d.ts +5 -0
  91. package/build/macros/commands/DrawFlush.js +17 -0
  92. package/build/macros/commands/DrawFlush.js.map +1 -0
  93. package/build/macros/commands/GetLink.d.ts +5 -0
  94. package/build/macros/commands/GetLink.js +21 -0
  95. package/build/macros/commands/GetLink.js.map +1 -0
  96. package/build/macros/commands/Lookup.d.ts +5 -0
  97. package/build/macros/commands/Lookup.js +24 -0
  98. package/build/macros/commands/Lookup.js.map +1 -0
  99. package/build/macros/commands/Print.d.ts +5 -0
  100. package/build/macros/commands/Print.js +14 -0
  101. package/build/macros/commands/Print.js.map +1 -0
  102. package/build/macros/commands/PrintFlush.d.ts +5 -0
  103. package/build/macros/commands/PrintFlush.js +17 -0
  104. package/build/macros/commands/PrintFlush.js.map +1 -0
  105. package/build/macros/commands/Radar.d.ts +7 -0
  106. package/build/macros/commands/Radar.js +61 -0
  107. package/build/macros/commands/Radar.js.map +1 -0
  108. package/build/macros/commands/Sensor.d.ts +5 -0
  109. package/build/macros/commands/Sensor.js +20 -0
  110. package/build/macros/commands/Sensor.js.map +1 -0
  111. package/build/macros/commands/UnitBind.d.ts +5 -0
  112. package/build/macros/commands/UnitBind.js +17 -0
  113. package/build/macros/commands/UnitBind.js.map +1 -0
  114. package/build/macros/commands/UnitControl.d.ts +5 -0
  115. package/build/macros/commands/UnitControl.js +68 -0
  116. package/build/macros/commands/UnitControl.js.map +1 -0
  117. package/build/macros/commands/UnitLocate.d.ts +5 -0
  118. package/build/macros/commands/UnitLocate.js +55 -0
  119. package/build/macros/commands/UnitLocate.js.map +1 -0
  120. package/build/macros/commands/UnitRadar.d.ts +5 -0
  121. package/build/macros/commands/UnitRadar.js +41 -0
  122. package/build/macros/commands/UnitRadar.js.map +1 -0
  123. package/build/macros/commands/Wait.d.ts +5 -0
  124. package/build/macros/commands/Wait.js +18 -0
  125. package/build/macros/commands/Wait.js.map +1 -0
  126. package/build/macros/commands/control.d.ts +5 -0
  127. package/build/macros/commands/control.js +25 -0
  128. package/build/macros/commands/control.js.map +1 -0
  129. package/build/macros/commands/index.d.ts +14 -0
  130. package/build/macros/commands/index.js +33 -0
  131. package/build/macros/commands/index.js.map +1 -0
  132. package/build/macros/commands/io.d.ts +8 -0
  133. package/build/macros/commands/io.js +47 -0
  134. package/build/macros/commands/io.js.map +1 -0
  135. package/build/macros/helpers/GetBuilding.d.ts +5 -0
  136. package/build/macros/helpers/GetBuilding.js +16 -0
  137. package/build/macros/helpers/GetBuilding.js.map +1 -0
  138. package/build/macros/helpers/GetVar.d.ts +5 -0
  139. package/build/macros/helpers/GetVar.js +16 -0
  140. package/build/macros/helpers/GetVar.js.map +1 -0
  141. package/build/macros/helpers/index.d.ts +2 -0
  142. package/build/{scopes → macros/helpers}/index.js +2 -3
  143. package/build/macros/helpers/index.js.map +1 -0
  144. package/build/macros/index.d.ts +4 -2
  145. package/build/macros/index.js +25 -3
  146. package/build/macros/index.js.map +1 -1
  147. package/build/operators.d.ts +3 -0
  148. package/build/operators.js +79 -16
  149. package/build/operators.js.map +1 -1
  150. package/build/types.js +5 -1
  151. package/build/types.js.map +1 -1
  152. package/build/utils.d.ts +1 -0
  153. package/build/utils.js +5 -1
  154. package/build/utils.js.map +1 -1
  155. package/build/values/BaseValue.js +13 -3
  156. package/build/values/BaseValue.js.map +1 -1
  157. package/build/values/FunctionValue.js +5 -2
  158. package/build/values/FunctionValue.js.map +1 -1
  159. package/build/values/LiteralValue.js +4 -5
  160. package/build/values/LiteralValue.js.map +1 -1
  161. package/build/values/ObjectValue.js.map +1 -1
  162. package/build/values/StoreValue.js.map +1 -1
  163. package/build/values/TempValue.js +16 -2
  164. package/build/values/TempValue.js.map +1 -1
  165. package/build/values/VoidValue.js.map +1 -1
  166. package/build/values/index.js +5 -1
  167. package/build/values/index.js.map +1 -1
  168. package/dist/bundle.js +1 -553
  169. package/lib/commands.d.ts +326 -0
  170. package/lib/eslib/index.d.ts +3 -0
  171. package/lib/eslib/lib.d.ts +9 -0
  172. package/lib/eslib/lib.es2015.collection.d.ts +89 -0
  173. package/lib/eslib/lib.es2015.core.d.ts +16 -0
  174. package/lib/eslib/lib.es2015.d.ts +30 -0
  175. package/lib/eslib/lib.es2015.generator.d.ts +79 -0
  176. package/lib/eslib/lib.es2015.iterable.d.ts +70 -0
  177. package/lib/eslib/lib.es5.d.ts +295 -0
  178. package/lib/eslib/lib.es6.d.ts +18 -0
  179. package/lib/globals.d.ts +328 -0
  180. package/lib/helpers.d.ts +23 -0
  181. package/lib/index.d.ts +7 -0
  182. package/lib/kinds.d.ts +36 -0
  183. package/lib/memory.d.ts +17 -0
  184. package/lib/traits.d.ts +121 -0
  185. package/lib/util.d.ts +32 -0
  186. package/package.json +21 -10
  187. package/.gitattributes +0 -2
  188. package/build/scopes/FunctionScope.d.ts +0 -5
  189. package/build/scopes/FunctionScope.js +0 -13
  190. package/build/scopes/FunctionScope.js.map +0 -1
  191. package/build/scopes/LoopScope.d.ts +0 -5
  192. package/build/scopes/LoopScope.js +0 -13
  193. package/build/scopes/LoopScope.js.map +0 -1
  194. package/build/scopes/Scope.d.ts +0 -36
  195. package/build/scopes/Scope.js +0 -93
  196. package/build/scopes/Scope.js.map +0 -1
  197. package/build/scopes/index.d.ts +0 -3
  198. package/build/scopes/index.js.map +0 -1
  199. package/mlogjs.d.ts +0 -72
  200. package/tsconfig.json +0 -22
  201. package/webpack.config.js +0 -22
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UnitLocate = void 0;
4
+ const instructions_1 = require("../../instructions");
5
+ const __1 = require("..");
6
+ const values_1 = require("../../values");
7
+ const Building_1 = require("../Building");
8
+ const validFinds = ["ore", "building", "spawn", "damaged"];
9
+ class UnitLocate extends __1.MacroFunction {
10
+ constructor(scope) {
11
+ super(scope, (find, ...args) => {
12
+ if (!(find instanceof values_1.LiteralValue && typeof find.data === "string"))
13
+ throw new Error("The unitLocate find must be a string literal");
14
+ if (!validFinds.includes(find.data))
15
+ throw new Error("Invalid find value");
16
+ if (args.some(value => !(value instanceof values_1.StoreValue || value instanceof values_1.LiteralValue)))
17
+ throw new Error("The others arguments of unitLocate must be literals or stores");
18
+ const outFound = new values_1.TempValue(scope);
19
+ const outX = new values_1.TempValue(scope);
20
+ const outY = new values_1.TempValue(scope);
21
+ const outBuilding = new values_1.TempValue(scope);
22
+ const outArgs = [outX, outY, outFound, outBuilding];
23
+ let inputArgs = [];
24
+ switch (find.data) {
25
+ case "ore": {
26
+ const [ore] = args;
27
+ inputArgs = [find.data, "core", "true", ore];
28
+ break;
29
+ }
30
+ case "building": {
31
+ const [group, enemy] = args;
32
+ inputArgs = [find.data, group.data, enemy, "@copper"];
33
+ break;
34
+ }
35
+ case "spawn":
36
+ case "damaged": {
37
+ inputArgs = [find.data, "core", "true", "@copper"];
38
+ break;
39
+ }
40
+ }
41
+ return [
42
+ new values_1.ObjectValue(scope, {
43
+ 0: outFound,
44
+ 1: outX,
45
+ 2: outY,
46
+ 3: new Building_1.Building(scope, outBuilding.name),
47
+ length: new values_1.LiteralValue(scope, find.data === "ore" ? 3 : 4),
48
+ }),
49
+ [new instructions_1.InstructionBase("ulocate", ...inputArgs, ...outArgs)],
50
+ ];
51
+ });
52
+ }
53
+ }
54
+ exports.UnitLocate = UnitLocate;
55
+ //# sourceMappingURL=UnitLocate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UnitLocate.js","sourceRoot":"","sources":["../../../src/macros/commands/UnitLocate.ts"],"names":[],"mappings":";;;AAAA,qDAAqD;AACrD,0BAAmC;AAEnC,yCAAgF;AAEhF,0CAAuC;AAEvC,MAAM,UAAU,GAAG,CAAC,KAAK,EAAE,U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C;oBACf,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,IAA8B,CAAC;oBACtD,SAAS,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,IAAc,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;oBAChE,MAAM;iBACP;gBACD,KAAK,OAAO,CAAC;gBACb,KAAK,SAAS,CAAC,CAAC;oBACd,SAAS,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;oBACnD,MAAM;iBACP;aACF;YACD,OAAO;gBACL,IAAI,oBAAW,CAAC,KAAK,EAAE;oBACrB,CAAC,EAAE,QAAQ;oBACX,CAAC,EAAE,IAAI;oBACP,CAAC,EAAE,IAAI;oBACP,CAAC,EAAE,IAAI,mBAAQ,CAAC,KAAK,EAAE,WAAW,CAAC,IAAI,CAAC;oBACxC,MAAM,EAAE,IAAI,qBAAY,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;iBAC7D,CAAC;gBACF,CAAC,IAAI,8BAAe,CAAC,SAAS,EAAE,GAAG,SAAS,EAAE,GAAG,OAAO,CAAC,CAAC;aAC3D,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAtDD,gCAsDC"}
@@ -0,0 +1,5 @@
1
+ import { MacroFunction } from "..";
2
+ import { IScope } from "../../types";
3
+ export declare class UnitRadar extends MacroFunction {
4
+ constructor(scope: IScope);
5
+ }
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UnitRadar = void 0;
4
+ const instructions_1 = require("../../instructions");
5
+ const __1 = require("..");
6
+ const values_1 = require("../../values");
7
+ const Radar_1 = require("./Radar");
8
+ class UnitRadar extends __1.MacroFunction {
9
+ constructor(scope) {
10
+ super(scope, (filter1, filter2, filter3, order, sort) => {
11
+ if (!(filter1 instanceof values_1.LiteralValue) ||
12
+ typeof filter1.data !== "string" ||
13
+ !(filter2 instanceof values_1.LiteralValue) ||
14
+ typeof filter2.data !== "string" ||
15
+ !(filter3 instanceof values_1.LiteralValue) ||
16
+ typeof filter3.data !== "string")
17
+ throw new Error("The filters must be string literals");
18
+ if (!Radar_1.validRadarFilters.includes(filter1.data))
19
+ throw new Error("Invalid value for filter1");
20
+ if (!Radar_1.validRadarFilters.includes(filter2.data))
21
+ throw new Error("Invalid value for filter2");
22
+ if (!Radar_1.validRadarFilters.includes(filter3.data))
23
+ throw new Error("Invalid value for filter3");
24
+ if (!(order instanceof values_1.LiteralValue || order instanceof values_1.StoreValue))
25
+ throw new Error("The radar order must be a literal or a store");
26
+ if (!(sort instanceof values_1.LiteralValue) || typeof sort.data !== "string")
27
+ throw new Error("The radar sort must be a string literal");
28
+ if (!Radar_1.validRadarSorts.includes(sort.data))
29
+ throw new Error("Invalid sort value");
30
+ const temp = new values_1.TempValue(scope);
31
+ return [
32
+ temp,
33
+ [
34
+ new instructions_1.InstructionBase("uradar", filter1.data, filter2.data, filter3.data, order, sort.data, temp),
35
+ ],
36
+ ];
37
+ });
38
+ }
39
+ }
40
+ exports.UnitRadar = UnitRadar;
41
+ //# sourceMappingURL=UnitRadar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UnitRadar.js","sourceRoot":"","sources":["../../../src/macros/commands/UnitRadar.ts"],"names":[],"mappings":";;;AAAA,qDAAqD;AACrD,0BAAmC;AAEnC,yCAAmE;AACnE,mCAA6D;AAE7D,MAAa,SAAU,SAAQ,iBAAa;IAC1C,YAAY,KAAa;QACvB,KAAK,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;YACtD,IACE,CAAC,CAAC,OAAO,YAAY,qBAAY,CAAC;gBAClC,OAAO,OAAO,CAAC,IAAI,KAAK,QAAQ;gBAChC,CAAC,CAAC,O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,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AA9CD,8BA8CC"}
@@ -0,0 +1,5 @@
1
+ import { MacroFunction } from "..";
2
+ import { IScope } from "../../types";
3
+ export declare class Wait extends MacroFunction {
4
+ constructor(scope: IScope);
5
+ }
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Wait = void 0;
4
+ const instructions_1 = require("../../instructions");
5
+ const __1 = require("..");
6
+ const values_1 = require("../../values");
7
+ class Wait extends __1.MacroFunction {
8
+ constructor(scope) {
9
+ super(scope, seconds => {
10
+ if (!(seconds instanceof values_1.StoreValue) &&
11
+ !(seconds instanceof values_1.LiteralValue && typeof seconds.data === "number"))
12
+ throw new Error("The wait seconds must be either a number literal or a store");
13
+ return [null, [new instructions_1.InstructionBase("wait", seconds)]];
14
+ });
15
+ }
16
+ }
17
+ exports.Wait = Wait;
18
+ //# sourceMappingURL=Wait.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Wait.js","sourceRoot":"","sources":["../../../src/macros/commands/Wait.ts"],"names":[],"mappings":";;;AAAA,qDAAqD;AACrD,0BAAmC;AAEnC,yCAAwD;AAExD,MAAa,IAAK,SAAQ,iBAAa;IACrC,YAAY,KAAa;QACvB,KAAK,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE;YACrB,IACE,CAAC,CAAC,OAAO,YAAY,mBAAU,CAAC;gBAChC,CAAC,CAAC,OAAO,YAAY,qBAAY,IAAI,OAAO,OAAO,CAAC,IAAI,KAAK,QAAQ,CAAC;gBAEtE,MAAM,IAAI,KAAK,CACb,6DAA6D,CAC9D,CAAC;YAEJ,OAAO,CAAC,IAAI,EAAE,CAAC,IAAI,8BAAe,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;QACxD,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAdD,oBAcC"}
@@ -0,0 +1,5 @@
1
+ import { MacroFunction } from "..";
2
+ import { IScope } from "../../types";
3
+ export declare class Control extends MacroFunction {
4
+ constructor(scope: IScope);
5
+ }
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Control = void 0;
4
+ const instructions_1 = require("../../instructions");
5
+ const __1 = require("..");
6
+ const values_1 = require("../../values");
7
+ const validKinds = ["enabled", "shoot", "shootp", "config", "color"];
8
+ class Control extends __1.MacroFunction {
9
+ constructor(scope) {
10
+ super(scope, (kind, building, ...args) => {
11
+ if (!(kind instanceof values_1.LiteralValue) || typeof kind.data !== "string")
12
+ throw new Error("The control kind must be a string literal");
13
+ if (!validKinds.includes(kind.data))
14
+ throw new Error("Invalid control kind");
15
+ if (!(building instanceof values_1.ObjectValue))
16
+ throw new Error("The building must be an object value");
17
+ return [
18
+ null,
19
+ [new instructions_1.InstructionBase("control", kind.data, building, ...args)],
20
+ ];
21
+ });
22
+ }
23
+ }
24
+ exports.Control = Control;
25
+ //# sourceMappingURL=Control.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Control.js","sourceRoot":"","sources":["../../../src/macros/commands/Control.ts"],"names":[],"mappings":";;;AAAA,qDAAqD;AACrD,0BAAmC;AAEnC,yCAAqE;AAErE,MAAM,UAAU,GAAG,CAAC,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;AACrE,MAAa,OAAQ,SAAQ,iBAAa;IACxC,YAAY,KAAa;QACvB,KAAK,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE;YACvC,IAAI,CAAC,CAAC,IAAI,YAAY,qBAAY,CAAC,IAAI,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ;gBAClE,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;YAE/D,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;gBACjC,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;YAE1C,IAAI,CAAC,CAAC,QAAQ,YAAY,oBAAW,CAAC;gBACpC,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;YAE1D,OAAO;gBACL,IAAI;gBACJ,CAAC,IAAI,8BAAe,CAAC,SAAS,EAAE,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,CAAC;aAC/D,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAlBD,0BAkBC"}
@@ -0,0 +1,14 @@
1
+ export * from "./Draw";
2
+ export * from "./Print";
3
+ export * from "./PrintFlush";
4
+ export * from "./DrawFlush";
5
+ export * from "./GetLink";
6
+ export * from "./Control";
7
+ export { Radar } from "./Radar";
8
+ export * from "./Sensor";
9
+ export * from "./Wait";
10
+ export * from "./Lookup";
11
+ export * from "./UnitBind";
12
+ export * from "./UnitControl";
13
+ export * from "./UnitRadar";
14
+ export * from "./UnitLocate";
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.Radar = void 0;
18
+ __exportStar(require("./Draw"), exports);
19
+ __exportStar(require("./Print"), exports);
20
+ __exportStar(require("./PrintFlush"), exports);
21
+ __exportStar(require("./DrawFlush"), exports);
22
+ __exportStar(require("./GetLink"), exports);
23
+ __exportStar(require("./Control"), exports);
24
+ var Radar_1 = require("./Radar");
25
+ Object.defineProperty(exports, "Radar", { enumerable: true, get: function () { return Radar_1.Radar; } });
26
+ __exportStar(require("./Sensor"), exports);
27
+ __exportStar(require("./Wait"), exports);
28
+ __exportStar(require("./Lookup"), exports);
29
+ __exportStar(require("./UnitBind"), exports);
30
+ __exportStar(require("./UnitControl"), exports);
31
+ __exportStar(require("./UnitRadar"), exports);
32
+ __exportStar(require("./UnitLocate"), exports);
33
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/macros/commands/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,yCAAuB;AACvB,0CAAwB;AACxB,+CAA6B;AAC7B,8CAA4B;AAC5B,4CAA0B;AAC1B,4CAA0B;AAC1B,iCAAgC;AAAvB,8FAAA,KAAK,OAAA;AACd,2CAAyB;AACzB,yCAAuB;AACvB,2CAAyB;AACzB,6CAA2B;AAC3B,gDAA8B;AAC9B,8CAA4B;AAC5B,+CAA6B"}
@@ -0,0 +1,8 @@
1
+ import { IScope } from "../../types";
2
+ import { MacroFunction } from "../Function";
3
+ export declare class Draw extends MacroFunction {
4
+ constructor(scope: IScope);
5
+ }
6
+ export declare class Print extends MacroFunction {
7
+ constructor(scope: IScope);
8
+ }
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Print = exports.Draw = void 0;
4
+ const instructions_1 = require("../../instructions");
5
+ const values_1 = require("../../values");
6
+ const Function_1 = require("../Function");
7
+ class Draw extends Function_1.MacroFunction {
8
+ constructor(scope) {
9
+ super(scope, (kind, ...args) => {
10
+ if (!(kind instanceof values_1.LiteralValue))
11
+ throw new Error("Draw kind must be literal.");
12
+ if ([
13
+ "clear",
14
+ "color",
15
+ "stroke",
16
+ "line",
17
+ "rect",
18
+ "lineRect",
19
+ "poly",
20
+ "linePoly",
21
+ "triangle",
22
+ "image",
23
+ ].indexOf(kind.data) === -1)
24
+ throw new Error("Draw kind must be valid");
25
+ return [
26
+ null,
27
+ [
28
+ new instructions_1.InstructionBase("draw", kind.data, ...args.map(v => {
29
+ if (v instanceof values_1.LiteralValue && typeof v.data === "string")
30
+ return v.data;
31
+ return v;
32
+ })),
33
+ ],
34
+ ];
35
+ });
36
+ }
37
+ }
38
+ exports.Draw = Draw;
39
+ class Print extends Function_1.MacroFunction {
40
+ constructor(scope) {
41
+ super(scope, (...values) => {
42
+ return [null, [new instructions_1.InstructionBase("print", ...values)]];
43
+ });
44
+ }
45
+ }
46
+ exports.Print = Print;
47
+ //# sourceMappingURL=io.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"io.js","sourceRoot":"","sources":["../../../src/macros/commands/io.ts"],"names":[],"mappings":";;;AAAA,qDAAqD;AAErD,yCAA4C;AAC5C,0CAA4C;AAE5C,MAAa,IAAK,SAAQ,wBAAa;IACrC,YAAY,KAAa;QACvB,KAAK,CAAC,KAAK,EAAE,CAAC,IAAY,EAAE,GAAG,IAAc,EAAE,EAAE;YAC/C,IAAI,CAAC,CAAC,IAAI,YAAY,qBAAY,CAAC;gBACjC,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;YAChD,IACE;gBACE,OAAO;gBACP,OAAO;gBACP,QAAQ;gBACR,MAAM;gBACN,MAAM;gBACN,UAAU;gBACV,MAAM;gBACN,UAAU;gBACV,UAAU;gBACV,OAAO;aACR,CAAC,OAAO,CAAC,IAAI,CAAC,IAAc,CAAC,KAAK,CAAC,CAAC;gBAErC,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;YAC7C,OAAO;gBACL,IAAI;gBACJ;oBACE,IAAI,8BAAe,CACjB,MAAM,EACN,IAAI,CAAC,IAAc,EACnB,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;wBACd,IAAI,CAAC,YAAY,qBAAY,IAAI,OAAO,CAAC,CAAC,IAAI,KAAK,QAAQ;4BACzD,OAAO,CAAC,CAAC,IAAI,CAAC;wBAChB,OAAO,CAAC,CAAC;oBACX,CAAC,CAAC,CACH;iBACF;aACF,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AApCD,oBAoCC;AAED,MAAa,KAAM,SAAQ,wBAAa;IACtC,YAAY,KAAa;QACvB,KAAK,CAAC,KAAK,EAAE,CAAC,GAAG,MAAgB,EAAE,EAAE;YACnC,OAAO,CAAC,IAAI,EAAE,CAAC,IAAI,8BAAe,CAAC,OAAO,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;QAC3D,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAND,sBAMC"}
@@ -0,0 +1,5 @@
1
+ import { IScope } from "../../types";
2
+ import { MacroFunction } from "../Function";
3
+ export declare class GetBuilding extends MacroFunction {
4
+ constructor(scope: IScope);
5
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetBuilding = void 0;
4
+ const values_1 = require("../../values");
5
+ const Function_1 = require("../Function");
6
+ class GetBuilding extends Function_1.MacroFunction {
7
+ constructor(scope) {
8
+ super(scope, (name) => {
9
+ if (!(name instanceof values_1.LiteralValue) || typeof name.data !== "string")
10
+ throw new Error("The name of the building must be a string literal.");
11
+ return [new values_1.StoreValue(scope, name.data), []];
12
+ });
13
+ }
14
+ }
15
+ exports.GetBuilding = GetBuilding;
16
+ //# sourceMappingURL=GetBuilding.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GetBuilding.js","sourceRoot":"","sources":["../../../src/macros/helpers/GetBuilding.ts"],"names":[],"mappings":";;;AAEA,yCAAwD;AACxD,0CAA4C;AAE5C,MAAa,WAAY,SAAQ,wBAAa;IAC5C,YAAY,KAAa;QACvB,KAAK,CAAC,KAAK,EAAE,CAAC,IAAY,EAAE,EAAE;YAC5B,IAAI,CAAC,CAAC,IAAI,YAAY,qBAAY,CAAC,IAAI,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ;gBAClE,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;YAExE,OAAO,CAAC,IAAI,mBAAU,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;QAChD,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AATD,kCASC"}
@@ -0,0 +1,5 @@
1
+ import { IScope } from "../../types";
2
+ import { MacroFunction } from "../Function";
3
+ export declare class GetVar extends MacroFunction {
4
+ constructor(scope: IScope);
5
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetVar = void 0;
4
+ const values_1 = require("../../values");
5
+ const Function_1 = require("../Function");
6
+ class GetVar extends Function_1.MacroFunction {
7
+ constructor(scope) {
8
+ super(scope, (name) => {
9
+ if (!(name instanceof values_1.LiteralValue) || typeof name.data !== "string")
10
+ throw new Error("The name of the variable must be a string literal.");
11
+ return [new values_1.StoreValue(scope, name.data), []];
12
+ });
13
+ }
14
+ }
15
+ exports.GetVar = GetVar;
16
+ //# sourceMappingURL=GetVar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GetVar.js","sourceRoot":"","sources":["../../../src/macros/helpers/GetVar.ts"],"names":[],"mappings":";;;AAEA,yCAAwD;AACxD,0CAA4C;AAE5C,MAAa,MAAO,SAAQ,wBAAa;IACvC,YAAY,KAAa;QACvB,KAAK,CAAC,KAAK,EAAE,CAAC,IAAY,EAAE,EAAE;YAC5B,IAAI,CAAC,CAAC,IAAI,YAAY,qBAAY,CAAC,IAAI,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ;gBAClE,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;YAExE,OAAO,CAAC,IAAI,mBAAU,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;QAChD,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AATD,wBASC"}
@@ -0,0 +1,2 @@
1
+ export * from "./GetBuilding";
2
+ export * from "./GetVar";
@@ -10,7 +10,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
10
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
- __exportStar(require("./Scope"), exports);
14
- __exportStar(require("./FunctionScope"), exports);
15
- __exportStar(require("./LoopScope"), exports);
13
+ __exportStar(require("./GetBuilding"), exports);
14
+ __exportStar(require("./GetVar"), exports);
16
15
  //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/macros/helpers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gDAA8B;AAC9B,2CAAyB"}
@@ -1,5 +1,7 @@
1
1
  export * from "./Function";
2
- export * from "./Blocks";
3
2
  export * from "./Math";
4
- export * from "./TypeFactory";
5
3
  export * from "./Other";
4
+ export * as commands from "./commands";
5
+ export * from "./Memory";
6
+ export { BuildingBuilder } from "./Building";
7
+ export { NamespaceMacro, VarsNamespace } from "./Namespace";
@@ -1,18 +1,40 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
8
12
  }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
9
18
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
19
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
20
  };
21
+ var __importStar = (this && this.__importStar) || function (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
12
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.VarsNamespace = exports.NamespaceMacro = exports.BuildingBuilder = exports.commands = void 0;
13
30
  __exportStar(require("./Function"), exports);
14
- __exportStar(require("./Blocks"), exports);
15
31
  __exportStar(require("./Math"), exports);
16
- __exportStar(require("./TypeFactory"), exports);
17
32
  __exportStar(require("./Other"), exports);
33
+ exports.commands = __importStar(require("./commands"));
34
+ __exportStar(require("./Memory"), exports);
35
+ var Building_1 = require("./Building");
36
+ Object.defineProperty(exports, "BuildingBuilder", { enumerable: true, get: function () { return Building_1.BuildingBuilder; } });
37
+ var Namespace_1 = require("./Namespace");
38
+ Object.defineProperty(exports, "NamespaceMacro", { enumerable: true, get: function () { return Namespace_1.NamespaceMacro; } });
39
+ Object.defineProperty(exports, "VarsNamespace", { enumerable: true, get: function () { return Namespace_1.VarsNamespace; } });
18
40
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/macros/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA0B;AAC1B,2CAAwB;AACxB,yCAAsB;AACtB,gDAA6B;AAC7B,0CAAuB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/macros/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,yCAAuB;AACvB,0CAAwB;AACxB,uDAAuC;AACvC,2CAAyB;AACzB,uCAA6C;AAApC,2GAAA,eAAe,OAAA;AACxB,yCAA4D;AAAnD,2GAAA,cAAc,OAAA;AAAE,0GAAA,aAAa,OAAA"}
@@ -20,3 +20,6 @@ export declare const singleOperators: readonly ["!", "u+", "u-", "delete", "type
20
20
  export declare type SingleOperator = typeof singleOperators[number];
21
21
  export declare const operators: readonly ["*", "**", "+", "-", "/", "%", "!=", "!==", "<", "<=", "==", "===", ">", ">=", "&", "<<", ">>", ">>>", "^", "|", "instanceof", "in", "&&", "??", "||", "%=", "&=", "*=", "**=", "+=", "-=", "/=", "&&=", "||=", "<<=", ">>=", ">>>=", "^=", "|=", "=", "!", "u+", "u-", "delete", "typeof", "void", "~", "++", "--"];
22
22
  export declare type Operator = typeof operators[number];
23
+ export declare const operatorMap: {
24
+ [k in BinaryOperator | LogicalOperator]?: string;
25
+ };
@@ -1,9 +1,32 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.operators = exports.singleOperators = exports.updateOperators = exports.unaryOperators = exports.leftRightOperators = exports.assignmentOperators = exports.bitwiseAssignmentOperators = exports.logicalAssignmentOperators = exports.arithmeticAssignmentOperators = exports.logicalOperators = exports.binaryOperators = exports.bitwiseBinaryOperators = exports.comparisonBinaryOperators = exports.arithmeticBinaryOperators = void 0;
4
- exports.arithmeticBinaryOperators = ["*", "**", "+", "-", "/", "%"];
5
- exports.comparisonBinaryOperators = ["!=", "!==", "<", "<=", "==", "===", ">", ">="];
6
- exports.bitwiseBinaryOperators = ["&", "<<", ">>", ">>>", "^", "|"];
3
+ exports.operatorMap = exports.operators = exports.singleOperators = exports.updateOperators = exports.unaryOperators = exports.leftRightOperators = exports.assignmentOperators = exports.bitwiseAssignmentOperators = exports.logicalAssignmentOperators = exports.arithmeticAssignmentOperators = exports.logicalOperators = exports.binaryOperators = exports.bitwiseBinaryOperators = exports.comparisonBinaryOperators = exports.arithmeticBinaryOperators = void 0;
4
+ exports.arithmeticBinaryOperators = [
5
+ "*",
6
+ "**",
7
+ "+",
8
+ "-",
9
+ "/",
10
+ "%",
11
+ ];
12
+ exports.comparisonBinaryOperators = [
13
+ "!=",
14
+ "!==",
15
+ "<",
16
+ "<=",
17
+ "==",
18
+ "===",
19
+ ">",
20
+ ">=",
21
+ ];
22
+ exports.bitwiseBinaryOperators = [
23
+ "&",
24
+ "<<",
25
+ ">>",
26
+ ">>>",
27
+ "^",
28
+ "|",
29
+ ];
7
30
  exports.binaryOperators = [
8
31
  ...exports.arithmeticBinaryOperators,
9
32
  ...exports.comparisonBinaryOperators,
@@ -12,9 +35,23 @@ exports.binaryOperators = [
12
35
  "in",
13
36
  ];
14
37
  exports.logicalOperators = ["&&", "??", "||"];
15
- exports.arithmeticAssignmentOperators = ["%=", "&=", "*=", "**=", "+=", "-=", "/="];
38
+ exports.arithmeticAssignmentOperators = [
39
+ "%=",
40
+ "&=",
41
+ "*=",
42
+ "**=",
43
+ "+=",
44
+ "-=",
45
+ "/=",
46
+ ];
16
47
  exports.logicalAssignmentOperators = ["&&=", "||="];
17
- exports.bitwiseAssignmentOperators = ["<<=", ">>=", ">>>=", "^=", "|="];
48
+ exports.bitwiseAssignmentOperators = [
49
+ "<<=",
50
+ ">>=",
51
+ ">>>=",
52
+ "^=",
53
+ "|=",
54
+ ];
18
55
  exports.assignmentOperators = [
19
56
  ...exports.arithmeticAssignmentOperators,
20
57
  ...exports.logicalAssignmentOperators,
@@ -24,16 +61,42 @@ exports.assignmentOperators = [
24
61
  exports.leftRightOperators = [
25
62
  ...exports.binaryOperators,
26
63
  ...exports.logicalOperators,
27
- ...exports.assignmentOperators
28
- ];
29
- exports.unaryOperators = ["!", "u+", "u-", "delete", "typeof", "void", "~"];
30
- exports.updateOperators = ["++", "--"];
31
- exports.singleOperators = [
32
- ...exports.unaryOperators,
33
- ...exports.updateOperators,
64
+ ...exports.assignmentOperators,
34
65
  ];
35
- exports.operators = [
36
- ...exports.leftRightOperators,
37
- ...exports.singleOperators
66
+ exports.unaryOperators = [
67
+ "!",
68
+ "u+",
69
+ "u-",
70
+ "delete",
71
+ "typeof",
72
+ "void",
73
+ "~",
38
74
  ];
75
+ exports.updateOperators = ["++", "--"];
76
+ exports.singleOperators = [...exports.unaryOperators, ...exports.updateOperators];
77
+ exports.operators = [...exports.leftRightOperators, ...exports.singleOperators];
78
+ exports.operatorMap = {
79
+ "==": "equal",
80
+ "===": "strictEqual",
81
+ "!=": "notEqual",
82
+ "!==": "notEqual",
83
+ "<": "lessThan",
84
+ ">": "greaterThan",
85
+ "<=": "lessThanEq",
86
+ ">=": "greaterThanEq",
87
+ "+": "add",
88
+ "-": "sub",
89
+ "*": "mul",
90
+ "/": "div",
91
+ "%": "mod",
92
+ "**": "pow",
93
+ "|": "or",
94
+ "&": "and",
95
+ "^": "xor",
96
+ ">>": "shr",
97
+ ">>>": "shr",
98
+ "<<": "shl",
99
+ "&&": "land",
100
+ "||": "or",
101
+ };
39
102
  //# sourceMappingURL=operators.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"operators.js","sourceRoot":"","sources":["../src/operators.ts"],"names":[],"mappings":";;;AAAa,QAAA,yBAAyB,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAU,CAAC;AACrE,QAAA,yBAAyB,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,CAAU,CAAC;AACtF,QAAA,sBAAsB,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,CAAU,CAAC;AACrE,QAAA,eAAe,GAAG;IAC9B,GAAG,iCAAyB;IAC5B,GAAG,iCAAyB;IAC5B,GAAG,8BAAsB;IACzB,YAAY;IACZ,IA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,GAAG,EAAE,UAAU;IACf,GAAG,EAAE,aAAa;IAClB,IAAI,EAAE,YAAY;IAClB,IAAI,EAAE,eAAe;IACrB,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,KAAK;IACX,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,KAAK;IACX,KAAK,EAAE,KAAK;IACZ,IAAI,EAAE,KAAK;IACX,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,IAAI;CACF,CAAC"}
package/build/types.js CHANGED
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA6B"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA6B"}
package/build/utils.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  import { es } from "./types";
2
2
  export declare function nodeName(node: es.Node): string;
3
+ export declare function camelToDashCase(name: string): string;
package/build/utils.js CHANGED
@@ -1,9 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.nodeName = void 0;
3
+ exports.camelToDashCase = exports.nodeName = void 0;
4
4
  function nodeName(node) {
5
5
  const { line, column } = node.loc.start;
6
6
  return line + ":" + column;
7
7
  }
8
8
  exports.nodeName = nodeName;
9
+ function camelToDashCase(name) {
10
+ return name.replace(/[A-Z]/g, str => `-${str.toLowerCase()}`);
11
+ }
12
+ exports.camelToDashCase = camelToDashCase;
9
13
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;AAEA,SAAgB,QAAQ,CAAC,IAAa;IAClC,MAAM,EAAC,IAAI,EAAE,MAAM,EAAC,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAA;IACrC,OAAO,IAAI,GAAG,GAAG,GAAG,MAAM,CAAA;AAC9B,CAAC;AAHD,4BAGC"}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;AAEA,SAAgB,QAAQ,CAAC,IAAa;IACpC,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC;IACxC,OAAO,IAAI,GAAG,GAAG,GAAG,MAAM,CAAC;AAC7B,CAAC;AAHD,4BAGC;AAED,SAAgB,eAAe,CAAC,IAAY;IAC1C,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,EAAE,CAAC,IAAI,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;AAChE,CAAC;AAFD,0CAEC"}