Mauro Carvalho Chehab <[email protected]> writes: >> > tools/lib/python/kdoc/kdoc_re.py | 234 +++++++++++++++++++++++++++++++ >> > 1 file changed, 234 insertions(+) >> > >> > diff --git a/tools/lib/python/kdoc/kdoc_re.py >> > b/tools/lib/python/kdoc/kdoc_re.py >> > index 085b89a4547c..7bed4e9a8810 100644 >> > --- a/tools/lib/python/kdoc/kdoc_re.py >> > +++ b/tools/lib/python/kdoc/kdoc_re.py >> > @@ -141,6 +141,240 @@ class KernRe: >> > >> > return self.last_match.groups() >> > >> > +class TokType(): >> > + >> > + @staticmethod >> > + def __str__(val): >> > + ""Return the name of an enum value"" >> > + return TokType._name_by_val.get(val, f"UNKNOWN({val})") >> >> What is this class supposed to do? > > This __str__() method ensures that, when printing a CToken object, > the name will be displayed, instead of a number. This is really > useful when debugging.
I was talking about the TokType class, though, not CToken. This class doesn't appear to be used anywhere. Indeed, I notice now that when you relocate CToken in patch 7, TokType is silently removed. So perhaps it's better not to introduce it in the first place :) jon

