def wrapb(parent, child):
    """Return the child node as a string, wrapped in brackets if its precedence is
    higher than the parent node.
    """
    if child.prec > parent.prec:
        return "[{}]".format(child)
    else:
        return str(child)