@grey-ts/transpiler 2.1.0 → 2.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 (2) hide show
  1. package/dist/index.js +11 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -192,6 +192,7 @@ var apiNameMap = {
192
192
  "GreyHack.getType": "typeof",
193
193
  "GreyHack.userBankNumber": "user_bank_number",
194
194
  "GreyHack.userInput": "user_input",
195
+ "GreyHack.pollInput": "poll_input",
195
196
  "GreyHack.userMailAddress": "user_mail_address",
196
197
  "GreyHack.MetaLib.debugTools": "debug_tools",
197
198
  "GreyHack.MetaLib.isPatched": "is_patched",
@@ -259,9 +260,7 @@ var apiNameMap = {
259
260
  "Object.size": "len",
260
261
  "Array.length": "len",
261
262
  "Array.shift": "pull",
262
- "Array.push": "push_many",
263
- "Map.size": "data.len",
264
- "Set.size": "data.len"
263
+ "Array.push": "push_many"
265
264
  };
266
265
  var propertyAccessReplacements = {
267
266
  "String.prototype": "string",
@@ -1080,7 +1079,7 @@ NodeHandler.register(ts9.SyntaxKind.RegularExpressionLiteral, (node) => {
1080
1079
  const flags = node.text.slice(end + 1);
1081
1080
  if (flags)
1082
1081
  throw "Regex flags are not supported yet";
1083
- return `"${node.text.slice(start, end)}"`;
1082
+ return `"${node.text.slice(start, end).replaceAll('"', '""')}"`;
1084
1083
  });
1085
1084
 
1086
1085
  // src/visitors/imports.ts
@@ -1796,6 +1795,9 @@ var globalObjects = {
1796
1795
  "end function",
1797
1796
  "Map.values = function",
1798
1797
  "\treturn self.data.values",
1798
+ "end function",
1799
+ "Map.size = function",
1800
+ "\treturn self.data.len",
1799
1801
  "end function"
1800
1802
  ].join(`
1801
1803
  `),
@@ -1831,6 +1833,9 @@ var globalObjects = {
1831
1833
  "end function",
1832
1834
  "Set.values = function",
1833
1835
  "\treturn self.data.indexes",
1836
+ "end function",
1837
+ "Set.size = function",
1838
+ "\treturn self.data.len",
1834
1839
  "end function"
1835
1840
  ].join(`
1836
1841
  `),
@@ -2062,7 +2067,8 @@ if (command === "transpile") {
2062
2067
  const statement = transpiledStatements.shift();
2063
2068
  if (content.length + statement.length > 155000 && content.length) {
2064
2069
  fileContents.push(content);
2065
- content = "";
2070
+ content = `${statement}
2071
+ `;
2066
2072
  continue;
2067
2073
  }
2068
2074
  content += `${statement}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grey-ts/transpiler",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "description": "Transpiles TypeScript into GreyScript",
5
5
  "author": "Okka",
6
6
  "module": "src/index.ts",