Author: Ronan Lamy <[email protected]>
Branch: expressions-2
Changeset: r74558:125a6ee9aeb3
Date: 2014-11-10 01:23 +0000
http://bitbucket.org/pypy/pypy/changeset/125a6ee9aeb3/
Log: create ExceptBlock class
diff --git a/rpython/flowspace/model.py b/rpython/flowspace/model.py
--- a/rpython/flowspace/model.py
+++ b/rpython/flowspace/model.py
@@ -18,11 +18,7 @@
self.returnblock = Block([return_var or Variable()])
self.returnblock.operations = ()
self.returnblock.exits = ()
- # block corresponding to exception results
- self.exceptblock = Block([Variable('etype'), # exception class
- Variable('evalue')]) # exception value
- self.exceptblock.operations = ()
- self.exceptblock.exits = ()
+ self.exceptblock = ExceptBlock()
self.tag = None
def getargs(self):
@@ -181,8 +177,6 @@
else:
if (not self.exits) and len(self.inputargs) == 1:
txt = "return block"
- elif (not self.exits) and len(self.inputargs) == 2:
- txt = "raise block"
else:
txt = "codeless block"
return txt
@@ -249,6 +243,17 @@
view = show
+class ExceptBlock(Block):
+ def __init__(self):
+ self.inputargs = [Variable('etype'), # exception class
+ Variable('evalue')] # exception value
+ self.operations = ()
+ self.exits = ()
+ self.exitswitch = None
+
+ def __str__(self):
+ return "raise block"
+
class Variable(object):
__slots__ = ["_name", "_nr", "annotation", "concretetype", "equals"]
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit