@mintplayer/polyglot-target-python 0.8.1 → 0.9.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.8.1",
3
+ "version": "0.9.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",
@@ -991,6 +991,29 @@
991
991
  }
992
992
  }
993
993
  },
994
+ {
995
+ "case": {
996
+ "when": [
997
+ [
998
+ {
999
+ "not": {
1000
+ "eq": [
1001
+ "module.interfaces.count",
1002
+ "0"
1003
+ ]
1004
+ }
1005
+ },
1006
+ {
1007
+ "line": "import abc"
1008
+ }
1009
+ ]
1010
+ ]
1011
+ }
1012
+ },
1013
+ {
1014
+ "mapMembers": "module.interfaces",
1015
+ "rule": "InterfaceDecl"
1016
+ },
994
1017
  {
995
1018
  "mapMembers": "module.enums",
996
1019
  "rule": "EnumDecl"
@@ -1303,6 +1326,93 @@
1303
1326
  }
1304
1327
  ]
1305
1328
  },
1329
+ "InterfaceDecl": {
1330
+ "block": {
1331
+ "head": {
1332
+ "tmpl": [
1333
+ "class ",
1334
+ {
1335
+ "fn": "ident",
1336
+ "args": [
1337
+ {
1338
+ "get": "decl.name"
1339
+ }
1340
+ ]
1341
+ },
1342
+ "(",
1343
+ {
1344
+ "case": {
1345
+ "when": [
1346
+ [
1347
+ {
1348
+ "eq": [
1349
+ "decl.bases.count",
1350
+ "0"
1351
+ ]
1352
+ },
1353
+ ""
1354
+ ]
1355
+ ],
1356
+ "else": {
1357
+ "tmpl": [
1358
+ {
1359
+ "map": "decl.bases",
1360
+ "sep": ", ",
1361
+ "item": {
1362
+ "type": "item"
1363
+ }
1364
+ },
1365
+ ", "
1366
+ ]
1367
+ }
1368
+ }
1369
+ },
1370
+ "abc.ABC)"
1371
+ ]
1372
+ },
1373
+ "body": [
1374
+ {
1375
+ "mapDecl": "decl.methods",
1376
+ "each": {
1377
+ "seq": [
1378
+ {
1379
+ "line": "@abc.abstractmethod"
1380
+ },
1381
+ {
1382
+ "line": {
1383
+ "tmpl": [
1384
+ "def ",
1385
+ {
1386
+ "fn": "ident",
1387
+ "args": [
1388
+ {
1389
+ "get": "item.name"
1390
+ }
1391
+ ]
1392
+ },
1393
+ "(self",
1394
+ {
1395
+ "map": "item.params",
1396
+ "sep": "",
1397
+ "item": {
1398
+ "tmpl": [
1399
+ ", ",
1400
+ {
1401
+ "call": "pyParam"
1402
+ }
1403
+ ]
1404
+ }
1405
+ },
1406
+ "): ..."
1407
+ ]
1408
+ }
1409
+ }
1410
+ ]
1411
+ }
1412
+ }
1413
+ ]
1414
+ }
1415
+ },
1306
1416
  "ClassDecl": {
1307
1417
  "block": {
1308
1418
  "head": {
@@ -2773,6 +2883,7 @@
2773
2883
  "string.toUpper": "$this.upper()",
2774
2884
  "string.toLower": "$this.lower()",
2775
2885
  "string.charAt": "$this[$0]",
2886
+ "string.codePointAt": "ord($this[$0])",
2776
2887
  "string.codePoints": "list($this)",
2777
2888
  "string.toI32": "int($this)"
2778
2889
  },