(value, indent=0, prefix='')
Recursive procedure for printast.

    Args:
      value: An element from the AST: a Node, a list, or a tuple.
      indent: The indentation level for this value.
      prefix: A string prefix for this value.
Recursive procedure for printast.
Recursive procedure for printast .
def _printast_node(value, indent=0, prefix=''):
    """Recursive procedure for printast.

    Args:
      value: An element from the AST: a Node, a list, or a tuple.
      indent: The indentation level for this value.
      prefix: A string prefix for this value.
    """
    if isinstance(value, parser.Node):
        util.write('{}{}{}\n'.format(' ' * indent, prefix,
                                     value.__class__.__name__))
        for field in value._fields:
            _printast_node(getattr(value, field),
                           indent=indent+_PRINTAST_INDENT_SIZE,
                           prefix='* {}: '.format(field))
    elif isinstance(value, list) or isinstance(value, tuple):
        util.write('{}{}[list:]\n'.format(' ' * indent, prefix))
        for item in value:
            _printast_node(item,
                           indent=indent+_PRINTAST_INDENT_SIZE,
                           prefix='- ')
    else:
        util.write('{}{}{}\n'.format(' ' * indent, prefix, value))
def _printast_node ( value , indent = 0 , prefix = '' ) : if isinstance ( value , parser . Node ) : util . write ( '{}{}{}\n' . format ( ' ' * indent , prefix , value . __class__ . __name__ ) ) for field in value . _fields : _printast_node ( getattr ( value , field ) , indent = indent + _PRINTAST_INDENT_SIZE , prefix = '* {}: ' . format ( field ) ) elif isinstance ( value , list ) or isinstance ( value , tuple ) : util . write ( '{}{}[list:]\n' . format ( ' ' * indent , prefix ) ) for item in value : _printast_node ( item , indent = indent + _PRINTAST_INDENT_SIZE , prefix = '- ' ) else : util . write ( '{}{}{}\n' . format ( ' ' * indent , prefix , value ) )