# Path: wordinserter/operations.py
# class ChildlessOperation(Operation):
#     def __init__(self, **kwargs):
#         super().__init__([], **kwargs)
# 
#     def __repr__(self):
#         return "<{0}>".format(self.__class__.__name__)
# 
#     def has_child(self, child_class):
#         return False
# 
#     def replace_child(self, child, new_child):
#         raise RuntimeError("ChildlessOperation: Cannot replace child")
# 
# class Text(ChildlessOperation):
#     requires = {"text"}
# 
#     def __repr__(self):
#         return "<Text '{0}' />".format(self.short_text)
# 
#     @property
#     def short_text(self):
#         if len(self.text) > 10:
#             txt = self.text[:10] + "..."
#         else:
#             txt = self.text
# 
#         return repr(txt)


from wordinserter.operations import ChildlessOperation, Text


class _NotFound(object):
    pass


class CombinedConstants(object):
    def __init__(self, *constants):
        self.constants = constants

    def __getattr__(self, item):
        for c in self.constants:
            result = getattr(c, item, _NotFound)
            if result is not _NotFound:
                return result

        raise AttributeError("No constant with the name {0} found".format(item))


def pprint(tokens, indent=0):
    pad = '\t' * indent
    for token in tokens:

# Path: wordinserter/operations.py
# class ChildlessOperation(Operation):
#     def __init__(self, **kwargs):
#         super().__init__([], **kwargs)
# 
#     def __repr__(self):
#         return "<{0}>".format(self.__class__.__name__)
# 
#     def has_child(self, child_class):
#         return False
# 
#     def replace_child(self, child, new_child):
#         raise RuntimeError("ChildlessOperation: Cannot replace child")
# 
# class Text(ChildlessOperation):
#     requires = {"text"}
# 
#     def __repr__(self):
#         return "<Text '{0}' />".format(self.short_text)
# 
#     @property
#     def short_text(self):
#         if len(self.text) > 10:
#             txt = self.text[:10] + "..."
#         else:
#             txt = self.text
# 
#         return repr(txt)


# Path: wordinserter/utils.py
from wordinserter.operations import ChildlessOperation, Text



class _NotFound(object):
    pass


class CombinedConstants(object):
    def __init__(self, *constants):
        self.constants = constants

    def __getattr__(self, item):
        for c in self.constants:
            result = getattr(c, item, _NotFound)
            if result is not _NotFound:
                return result

        raise AttributeError("No constant with the name {0} found".format(item))


def pprint(tokens, indent=0):
    pad = '\t' * indent
    for token in tokens:

        if isinstance(token, Text):