diff options
Diffstat (limited to 'Lib/compiler')
-rw-r--r-- | Lib/compiler/ast.py | 26 | ||||
-rw-r--r-- | Lib/compiler/pyassem.py | 1 | ||||
-rw-r--r-- | Lib/compiler/pycodegen.py | 12 | ||||
-rw-r--r-- | Lib/compiler/transformer.py | 15 |
4 files changed, 0 insertions, 54 deletions
diff --git a/Lib/compiler/ast.py b/Lib/compiler/ast.py index 6953325..b06531f 100644 --- a/Lib/compiler/ast.py +++ b/Lib/compiler/ast.py @@ -440,32 +440,6 @@ class Ellipsis(Node): def __repr__(self): return "Ellipsis()" -class Exec(Node): - def __init__(self, expr, locals, globals, lineno=None): - self.expr = expr - self.locals = locals - self.globals = globals - self.lineno = lineno - - def getChildren(self): - children = [] - children.append(self.expr) - children.append(self.locals) - children.append(self.globals) - return tuple(children) - - def getChildNodes(self): - nodelist = [] - nodelist.append(self.expr) - if self.locals is not None: - nodelist.append(self.locals) - if self.globals is not None: - nodelist.append(self.globals) - return tuple(nodelist) - - def __repr__(self): - return "Exec(%s, %s, %s)" % (repr(self.expr), repr(self.locals), repr(self.globals)) - class FloorDiv(Node): def __init__(self, (left, right), lineno=None): self.left = left diff --git a/Lib/compiler/pyassem.py b/Lib/compiler/pyassem.py index 542d704..5e3eb30 100644 --- a/Lib/compiler/pyassem.py +++ b/Lib/compiler/pyassem.py @@ -762,7 +762,6 @@ class StackDepthTracker: 'PRINT_ITEM': -1, 'RETURN_VALUE': -1, 'YIELD_VALUE': -1, - 'EXEC_STMT': -3, 'BUILD_CLASS': -2, 'STORE_NAME': -1, 'STORE_ATTR': -2, diff --git a/Lib/compiler/pycodegen.py b/Lib/compiler/pycodegen.py index af99045..e0c3a10 100644 --- a/Lib/compiler/pycodegen.py +++ b/Lib/compiler/pycodegen.py @@ -1043,18 +1043,6 @@ class CodeGenerator: self.emit('ROT_THREE') self.emit('STORE_SUBSCR') - def visitExec(self, node): - self.visit(node.expr) - if node.locals is None: - self.emit('LOAD_CONST', None) - else: - self.visit(node.locals) - if node.globals is None: - self.emit('DUP_TOP') - else: - self.visit(node.globals) - self.emit('EXEC_STMT') - def visitCallFunc(self, node): pos = 0 kw = 0 diff --git a/Lib/compiler/transformer.py b/Lib/compiler/transformer.py index a9b971a..4f2107f 100644 --- a/Lib/compiler/transformer.py +++ b/Lib/compiler/transformer.py @@ -468,20 +468,6 @@ class Transformer: names.append(nodelist[i][1]) return Global(names, lineno=nodelist[0][2]) - def exec_stmt(self, nodelist): - # exec_stmt: 'exec' expr ['in' expr [',' expr]] - expr1 = self.com_node(nodelist[1]) - if len(nodelist) >= 4: - expr2 = self.com_node(nodelist[3]) - if len(nodelist) >= 6: - expr3 = self.com_node(nodelist[5]) - else: - expr3 = None - else: - expr2 = expr3 = None - - return Exec(expr1, expr2, expr3, lineno=nodelist[0][2]) - def assert_stmt(self, nodelist): # 'assert': test, [',' test] expr1 = self.com_node(nodelist[1]) @@ -1429,7 +1415,6 @@ _legal_node_types = [ symbol.raise_stmt, symbol.import_stmt, symbol.global_stmt, - symbol.exec_stmt, symbol.assert_stmt, symbol.if_stmt, symbol.while_stmt, |