@mintplayer/polyglot-target-python 0.2.0 → 0.3.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-python",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "MintPlayer Polyglot Python target — a pure-JSON language plugin (spec + emission rules + capabilities + std bindings) for the polyglot transpiler.",
5
5
  "keywords": [
6
6
  "polyglot",
@@ -971,6 +971,26 @@
971
971
  },
972
972
  "Program": {
973
973
  "seq": [
974
+ {
975
+ "mapDecl": "module.imports",
976
+ "each": {
977
+ "line": {
978
+ "case": {
979
+ "when": [
980
+ [
981
+ { "eq": [ "item.isNamespace", "true" ] },
982
+ { "tmpl": [ "import ", { "get": "item.path" }, " as ", { "get": "item.ns" } ] }
983
+ ],
984
+ [
985
+ { "not": { "eq": [ "item.names", "" ] } },
986
+ { "tmpl": [ "from ", { "get": "item.path" }, " import ", { "get": "item.names" } ] }
987
+ ]
988
+ ],
989
+ "else": { "tmpl": [ "import ", { "get": "item.path" } ] }
990
+ }
991
+ }
992
+ }
993
+ },
974
994
  {
975
995
  "mapMembers": "module.enums",
976
996
  "rule": "EnumDecl"
@@ -2692,6 +2712,22 @@
2692
2712
  "Math.E": "__import__('math').e",
2693
2713
  "Math.sqrt": "__import__('math').sqrt($0)",
2694
2714
  "Math.ln": "__import__('math').log($0)",
2715
+ "Math.log": "__import__('math').log($0)",
2716
+ "Math.log2": "__import__('math').log2($0)",
2717
+ "Math.log10": "__import__('math').log10($0)",
2718
+ "Math.exp": "__import__('math').exp($0)",
2719
+ "Math.pow": "__import__('math').pow($0, $1)",
2720
+ "Math.sin": "__import__('math').sin($0)",
2721
+ "Math.cos": "__import__('math').cos($0)",
2722
+ "Math.tan": "__import__('math').tan($0)",
2723
+ "Math.asin": "__import__('math').asin($0)",
2724
+ "Math.acos": "__import__('math').acos($0)",
2725
+ "Math.atan": "__import__('math').atan($0)",
2726
+ "Math.atan2": "__import__('math').atan2($0, $1)",
2727
+ "Math.sinh": "__import__('math').sinh($0)",
2728
+ "Math.cosh": "__import__('math').cosh($0)",
2729
+ "Math.tanh": "__import__('math').tanh($0)",
2730
+ "Math.trunc": "float(__import__('math').trunc($0))",
2695
2731
  "Math.floor": "float(__import__('math').floor($0))",
2696
2732
  "Math.ceil": "float(__import__('math').ceil($0))",
2697
2733
  "Math.min": "min($0, $1)",