1.1 --- a/micropython/deduce.py Sun Mar 09 18:51:11 2014 +0100
1.2 +++ b/micropython/deduce.py Mon Mar 10 23:10:14 2014 +0100
1.3 @@ -3,7 +3,7 @@
1.4 """
1.5 Perform deductions on an inspected program.
1.6
1.7 -Copyright (C) 2006, 2007, 2010, 2011, 2012, 2013 Paul Boddie <paul@boddie.org.uk>
1.8 +Copyright (C) 2006, 2007, 2010, 2011, 2012, 2013, 2014 Paul Boddie <paul@boddie.org.uk>
1.9
1.10 This program is free software; you can redistribute it and/or modify it under
1.11 the terms of the GNU General Public License as published by the Free Software
1.12 @@ -20,7 +20,7 @@
1.13 """
1.14
1.15 from micropython.stdcompiler import compiler
1.16 -from compiler.ast import AssAttr, Getattr, Name
1.17 +from compiler.ast import *
1.18
1.19 from micropython.basicdata import Const, Constant, TypedInstance
1.20 from micropython.common import ASTVisitor, used_by_unit
1.21 @@ -66,15 +66,15 @@
1.22 return node.visit(self.visitor, *args)
1.23 except AttributeError:
1.24 # NOTE: Obligatory hack to find real attribute errors.
1.25 - #if isinstance(node, self.implemented_nodes):
1.26 - # raise
1.27 + if isinstance(node, self.implemented_nodes):
1.28 + raise
1.29 return self.visitor.default(node, *args)
1.30
1.31 - #implemented_nodes = (
1.32 - # AssAttr, Assign, AssName, AssList, AssTuple, CallFunc, Getattr,
1.33 - # Add, Bitand, Bitor, Bitxor, Div, FloorDiv, Invert, LeftShift, Mod, Mul,
1.34 - # Power, RightShift, Sub, UnaryAdd, UnarySub
1.35 - # )
1.36 + implemented_nodes = (
1.37 + AssAttr, Assign, AssName, AssList, AssTuple, CallFunc, Function, Getattr,
1.38 + Add, Bitand, Bitor, Bitxor, Div, FloorDiv, Invert, LeftShift, Mod, Mul,
1.39 + Power, RightShift, Sub, UnaryAdd, UnarySub
1.40 + )
1.41
1.42 # Deduction-related methods.
1.43