@@ -1429,7 +1429,9 @@ character in a component-level import/export (as is currently the case in `wit`
1429
1429
[ identifiers] ( WIT.md#identifiers ) ) and thus can safely be used to prefix
1430
1430
auxiliary Canonical ABI-induced imports/exports.
1431
1431
1432
- Instance-mangling recursively builds a dotted path string (of instance names)
1432
+ #### Instance type mangling
1433
+
1434
+ Instance-type mangling recursively builds a dotted path string (of instance names)
1433
1435
that is included in the mangled core import/export name:
1434
1436
``` python
1435
1437
def mangle_instances (xs , path = ' ' ):
@@ -1457,7 +1459,9 @@ def mangle_instances(xs, path = ''):
1457
1459
The three ` TODO ` cases are intended to be filled in by future PRs extending
1458
1460
the Canonical ABI.
1459
1461
1460
- Function and value types are recursively mangled into
1462
+ #### Function type mangling
1463
+
1464
+ Function types are mangled into
1461
1465
[ ` wit ` ] ( WIT.md ) -compatible syntax:
1462
1466
``` python
1463
1467
def mangle_funcname (name , ft ):
@@ -1473,6 +1477,11 @@ def mangle_funcvec(es, pre_space):
1473
1477
mangled_elems = (e[0 ] + ' : ' + mangle_valtype(e[1 ]) for e in es)
1474
1478
return ' (' + ' , ' .join(mangled_elems) + ' )'
1475
1479
1480
+ # ### Value type mangling
1481
+
1482
+ Value types are similarly mangled into [`wit` ](WIT .md)- compatible syntax,
1483
+ recursively:
1484
+
1476
1485
def mangle_valtype (t ):
1477
1486
match t:
1478
1487
case Bool() : return ' bool'
0 commit comments