dtlib: add _Token __repr__
Convert numeric IDs to symbolic token ID names for ease of debugging. Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
This commit is contained in:
parent
ce6d402787
commit
4e783a363a
@ -664,6 +664,10 @@ class _Token(NamedTuple):
|
||||
id: int
|
||||
val: _TokVal
|
||||
|
||||
def __repr__(self):
|
||||
id_repr = _T(self.id).name
|
||||
return f'Token(id=_T.{id_repr}, val={repr(self.val)})'
|
||||
|
||||
class DT:
|
||||
"""
|
||||
Represents a devicetree parsed from a .dts file (or from many files, if the
|
||||
|
||||
Loading…
Reference in New Issue
Block a user