@mintplayer/polyglot-target-php 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 +1 -1
- package/polyglot-plugin.json +40 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mintplayer/polyglot-target-php",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "MintPlayer Polyglot PHP target — a pure-JSON language plugin (spec + emission rules + capabilities + std bindings) for the polyglot transpiler.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"polyglot",
|
package/polyglot-plugin.json
CHANGED
|
@@ -155,6 +155,34 @@
|
|
|
155
155
|
"std.core": {
|
|
156
156
|
"i32.parse": "(intval($0) & 0xffffffff)",
|
|
157
157
|
"f64.parse": "floatval($0)"
|
|
158
|
+
},
|
|
159
|
+
"std.math": {
|
|
160
|
+
"Math.PI": "M_PI",
|
|
161
|
+
"Math.E": "M_E",
|
|
162
|
+
"Math.sqrt": "sqrt($0)",
|
|
163
|
+
"Math.ln": "log($0)",
|
|
164
|
+
"Math.log": "log($0)",
|
|
165
|
+
"Math.log2": "log($0, 2)",
|
|
166
|
+
"Math.log10": "log10($0)",
|
|
167
|
+
"Math.exp": "exp($0)",
|
|
168
|
+
"Math.pow": "pow($0, $1)",
|
|
169
|
+
"Math.sin": "sin($0)",
|
|
170
|
+
"Math.cos": "cos($0)",
|
|
171
|
+
"Math.tan": "tan($0)",
|
|
172
|
+
"Math.asin": "asin($0)",
|
|
173
|
+
"Math.acos": "acos($0)",
|
|
174
|
+
"Math.atan": "atan($0)",
|
|
175
|
+
"Math.atan2": "atan2($0, $1)",
|
|
176
|
+
"Math.sinh": "sinh($0)",
|
|
177
|
+
"Math.cosh": "cosh($0)",
|
|
178
|
+
"Math.tanh": "tanh($0)",
|
|
179
|
+
"Math.trunc": "(float)(int)($0)",
|
|
180
|
+
"Math.floor": "floor($0)",
|
|
181
|
+
"Math.ceil": "ceil($0)",
|
|
182
|
+
"Math.min": "min($0, $1)",
|
|
183
|
+
"Math.max": "max($0, $1)",
|
|
184
|
+
"Math.abs": "abs($0)",
|
|
185
|
+
"Math.round": "round($0)"
|
|
158
186
|
}
|
|
159
187
|
},
|
|
160
188
|
"rules": {
|
|
@@ -561,20 +589,12 @@
|
|
|
561
589
|
]
|
|
562
590
|
},
|
|
563
591
|
{
|
|
564
|
-
"
|
|
565
|
-
|
|
592
|
+
"tmpl": [
|
|
593
|
+
"(int)(",
|
|
566
594
|
{
|
|
567
|
-
"
|
|
595
|
+
"emit": "node.operand"
|
|
568
596
|
},
|
|
569
|
-
|
|
570
|
-
"tmpl": [
|
|
571
|
-
"(int)(",
|
|
572
|
-
{
|
|
573
|
-
"emit": "node.operand"
|
|
574
|
-
},
|
|
575
|
-
")"
|
|
576
|
-
]
|
|
577
|
-
}
|
|
597
|
+
")"
|
|
578
598
|
]
|
|
579
599
|
}
|
|
580
600
|
]
|
|
@@ -1426,6 +1446,14 @@
|
|
|
1426
1446
|
{
|
|
1427
1447
|
"line": "<?php"
|
|
1428
1448
|
},
|
|
1449
|
+
{
|
|
1450
|
+
"mapDecl": "module.imports",
|
|
1451
|
+
"each": {
|
|
1452
|
+
"line": {
|
|
1453
|
+
"tmpl": [ "require_once __DIR__ . '/", { "get": "item.path" }, ".php';" ]
|
|
1454
|
+
}
|
|
1455
|
+
}
|
|
1456
|
+
},
|
|
1429
1457
|
{
|
|
1430
1458
|
"mapMembers": "module.enums",
|
|
1431
1459
|
"rule": "EnumDecl"
|