@mintplayer/polyglot-target-typescript 0.5.3 → 0.7.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.5.3",
3
+ "version": "0.7.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",
@@ -94,6 +94,10 @@
94
94
  "mutable": "let $x",
95
95
  "const": "const $x"
96
96
  },
97
+ "localDeclTyped": {
98
+ "mutable": "let $x: $T",
99
+ "const": "const $x: $T"
100
+ },
97
101
  "yield": {
98
102
  "value": "yield $x;",
99
103
  "empty": "return;"
@@ -3051,10 +3055,11 @@
3051
3055
  },
3052
3056
  {
3053
3057
  "tmpl": [
3058
+ "(",
3054
3059
  {
3055
3060
  "type": "type.base"
3056
3061
  },
3057
- " | null"
3062
+ " | null)"
3058
3063
  ]
3059
3064
  }
3060
3065
  ],
@@ -3507,12 +3512,17 @@
3507
3512
  "Math.sinh": "Math.sinh($0)",
3508
3513
  "Math.cosh": "Math.cosh($0)",
3509
3514
  "Math.tanh": "Math.tanh($0)",
3515
+ "Math.asinh": "Math.asinh($0)",
3516
+ "Math.acosh": "Math.acosh($0)",
3517
+ "Math.atanh": "Math.atanh($0)",
3510
3518
  "Math.trunc": "Math.trunc($0)",
3511
3519
  "Math.floor": "Math.floor($0)",
3512
3520
  "Math.ceil": "Math.ceil($0)",
3513
3521
  "Math.min": "((a, b) => (a <= b ? a : b))($0, $1)",
3514
3522
  "Math.max": "((a, b) => (a >= b ? a : b))($0, $1)",
3515
3523
  "Math.abs": "((a) => (a < (a - a) ? -a : a))($0)",
3524
+ "Math.sign": "((a) => { const o = typeof a === 'bigint' ? 1n : 1; return a > (a - a) ? o : (a < (a - a) ? -o : a - a); })($0)",
3525
+ "Math.clamp": "((x, lo, hi) => x < lo ? lo : (x > hi ? hi : x))($0, $1, $2)",
3516
3526
  "Math.round": "Math.round($0)"
3517
3527
  },
3518
3528
  "std.strings": {
@@ -3529,6 +3539,9 @@
3529
3539
  "Error.init": "new $T($0)",
3530
3540
  "Error.message": "$this.message",
3531
3541
  "Iterable.type": "Iterable<$0>",
3542
+ "Array.type": "$0[]",
3543
+ "Array.init": "[]",
3544
+ "Array.count": "$this.length",
3532
3545
  "i8.parse": "(Number.parseInt($0, 10) << 24 >> 24)",
3533
3546
  "i16.parse": "(Number.parseInt($0, 10) << 16 >> 16)",
3534
3547
  "i32.parse": "(Number.parseInt($0, 10) | 0)",