Add string conversions for predicates and encodings.
This is just used for printing better comments in generated code.
This commit is contained in:
@@ -1003,6 +1003,9 @@ class EncRecipe(object):
|
||||
if instp:
|
||||
assert instp.predicate_context() == format
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
|
||||
class Encoding(object):
|
||||
"""
|
||||
@@ -1034,6 +1037,9 @@ class Encoding(object):
|
||||
self.instp = And.combine(recipe.instp, instp)
|
||||
self.isap = And.combine(recipe.isap, instp)
|
||||
|
||||
def __str__(self):
|
||||
return '[{}/{:02x}]'.format(self.recipe, self.encbits)
|
||||
|
||||
def ctrl_typevar(self):
|
||||
"""
|
||||
Get the controlling type variable for this encoding or `None`.
|
||||
|
||||
Reference in New Issue
Block a user