diff options
author | Eli Bendersky <eliben@gmail.com> | 2020-04-15 15:07:22 -0700 |
---|---|---|
committer | Eli Bendersky <eliben@gmail.com> | 2020-04-15 15:07:22 -0700 |
commit | 66fc2434c804867707392b704c3cd13923118476 (patch) | |
tree | e6ffa9b7476f832fe656af8734fc00e2efc55eeb /pycparser/_ast_gen.py | |
parent | 7b893b86bb185ff1262f6a524e92b8ad592acaa3 (diff) | |
download | pycparser-66fc2434c804867707392b704c3cd13923118476.tar.gz |
Clean up whitespace in generated AST code
Diffstat (limited to 'pycparser/_ast_gen.py')
-rw-r--r-- | pycparser/_ast_gen.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/pycparser/_ast_gen.py b/pycparser/_ast_gen.py index 5ec2d3d..ba03d90 100644 --- a/pycparser/_ast_gen.py +++ b/pycparser/_ast_gen.py @@ -196,7 +196,7 @@ def _repr(obj): if isinstance(obj, list): return '[' + (',\n '.join((_repr(e).replace('\n', '\n ') for e in obj))) + '\n]' else: - return repr(obj) + return repr(obj) class Node(object): __slots__ = () @@ -206,19 +206,19 @@ class Node(object): """ Generates a python representation of the current node """ result = self.__class__.__name__ + '(' - + indent = '' separator = '' for name in self.__slots__[:-2]: result += separator result += indent result += name + '=' + (_repr(getattr(self, name)).replace('\n', '\n ' + (' ' * (len(name) + len(self.__class__.__name__))))) - + separator = ',' indent = '\n ' + (' ' * len(self.__class__.__name__)) - + result += indent + ')' - + return result def children(self): |