diff options
author | Barry Warsaw <barry@python.org> | 2001-12-21 20:04:22 (GMT) |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 2001-12-21 20:04:22 (GMT) |
commit | 52acb49298fd0aee8a2a2a352f0b2ab039649bde (patch) | |
tree | 8494a3378452f85b4b71a0e02bc6c63cc21f8bec /Lib/compiler/ast.py | |
parent | 87fa3aa12cbb24c89cfb13c16d04f46a2dd9a9e1 (diff) | |
download | cpython-52acb49298fd0aee8a2a2a352f0b2ab039649bde.zip cpython-52acb49298fd0aee8a2a2a352f0b2ab039649bde.tar.gz cpython-52acb49298fd0aee8a2a2a352f0b2ab039649bde.tar.bz2 |
Merge of the release22 branch changes back into the trunk.
Diffstat (limited to 'Lib/compiler/ast.py')
-rw-r--r-- | Lib/compiler/ast.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Lib/compiler/ast.py b/Lib/compiler/ast.py index 23c463b..680afee 100644 --- a/Lib/compiler/ast.py +++ b/Lib/compiler/ast.py @@ -282,6 +282,21 @@ class Module(Node): def __repr__(self): return "Module(%s, %s)" % (repr(self.doc), repr(self.node)) +class Expression(Node): + # Expression is an artifical node class to support "eval" + nodes["expression"] = "Expression" + def __init__(self, node): + self.node = node + + def getChildren(self): + return self.node, + + def getChildNodes(self): + return self.node, + + def __repr__(self): + return "Expression(%s)" % (repr(self.node)) + class UnaryAdd(Node): nodes["unaryadd"] = "UnaryAdd" def __init__(self, expr): |