# HG changeset patch # User Paul Boddie # Date 1477347154 -7200 # Node ID 197ae84b7b2892364c981485dfabbd0dfb8c4c2f # Parent 331aa7c1517856cfc7be24095645a2f59b136bd1 Introduced an encoder function for special type attributes. diff -r 331aa7c15178 -r 197ae84b7b28 encoders.py --- a/encoders.py Tue Oct 25 00:12:01 2016 +0200 +++ b/encoders.py Tue Oct 25 00:12:34 2016 +0200 @@ -227,7 +227,7 @@ # Convert type name arguments to position and code symbols. elif op in typename_ops: - arg = "#" % a[1] + arg = encode_type_attribute(a[1]) a[1] = encode_symbol("pos", arg) a.insert(2, encode_symbol("code", arg)) @@ -296,6 +296,12 @@ return "__%s%s" % (symbol_type, path and "_%s" % encode_path(path) or "") +def encode_type_attribute(path): + + "Encode the special type attribute for 'path'." + + return "#%s" % path + # Output language reserved words.