@mintplayer/polyglot-target-typescript 0.2.0 → 0.5.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mintplayer/polyglot-target-typescript",
3
- "version": "0.2.0",
3
+ "version": "0.5.0",
4
4
  "description": "MintPlayer Polyglot TypeScript / JavaScript target — a pure-JSON language plugin (spec + emission rules + capabilities + std bindings) for the polyglot transpiler.",
5
5
  "keywords": [
6
6
  "polyglot",
@@ -690,20 +690,12 @@
690
690
  ]
691
691
  },
692
692
  {
693
- "fn": "wrap",
694
- "args": [
693
+ "tmpl": [
694
+ "Math.trunc(",
695
695
  {
696
- "get": "node.type"
696
+ "emit": "node.operand"
697
697
  },
698
- {
699
- "tmpl": [
700
- "Math.trunc(",
701
- {
702
- "emit": "node.operand"
703
- },
704
- ")"
705
- ]
706
- }
698
+ ")"
707
699
  ]
708
700
  }
709
701
  ]
@@ -2291,6 +2283,26 @@
2291
2283
  },
2292
2284
  "Program": {
2293
2285
  "seq": [
2286
+ {
2287
+ "mapDecl": "module.imports",
2288
+ "each": {
2289
+ "line": {
2290
+ "case": {
2291
+ "when": [
2292
+ [
2293
+ { "eq": [ "item.isNamespace", "true" ] },
2294
+ { "tmpl": [ "import * as ", { "get": "item.ns" }, " from \"./", { "get": "item.path" }, "\";" ] }
2295
+ ],
2296
+ [
2297
+ { "not": { "eq": [ "item.names", "" ] } },
2298
+ { "tmpl": [ "import { ", { "get": "item.names" }, " } from \"./", { "get": "item.path" }, "\";" ] }
2299
+ ]
2300
+ ],
2301
+ "else": { "tmpl": [ "import \"./", { "get": "item.path" }, "\";" ] }
2302
+ }
2303
+ }
2304
+ }
2305
+ },
2294
2306
  {
2295
2307
  "mapMembers": "module.enums",
2296
2308
  "rule": "EnumDecl"
@@ -3480,6 +3492,22 @@
3480
3492
  "Math.E": "Math.E",
3481
3493
  "Math.sqrt": "Math.sqrt($0)",
3482
3494
  "Math.ln": "Math.log($0)",
3495
+ "Math.log": "Math.log($0)",
3496
+ "Math.log2": "Math.log2($0)",
3497
+ "Math.log10": "Math.log10($0)",
3498
+ "Math.exp": "Math.exp($0)",
3499
+ "Math.pow": "Math.pow($0, $1)",
3500
+ "Math.sin": "Math.sin($0)",
3501
+ "Math.cos": "Math.cos($0)",
3502
+ "Math.tan": "Math.tan($0)",
3503
+ "Math.asin": "Math.asin($0)",
3504
+ "Math.acos": "Math.acos($0)",
3505
+ "Math.atan": "Math.atan($0)",
3506
+ "Math.atan2": "Math.atan2($0, $1)",
3507
+ "Math.sinh": "Math.sinh($0)",
3508
+ "Math.cosh": "Math.cosh($0)",
3509
+ "Math.tanh": "Math.tanh($0)",
3510
+ "Math.trunc": "Math.trunc($0)",
3483
3511
  "Math.floor": "Math.floor($0)",
3484
3512
  "Math.ceil": "Math.ceil($0)",
3485
3513
  "Math.min": "((a, b) => (a <= b ? a : b))($0, $1)",