1.1 --- a/micropython/ast.py Sat May 23 02:46:04 2009 +0200
1.2 +++ b/micropython/ast.py Sun May 24 00:21:41 2009 +0200
1.3 @@ -588,8 +588,8 @@
1.4
1.5 if self.unit is not node.unit:
1.6 self.new_op(LoadConst(node.unit))
1.7 + self.record_value()
1.8
1.9 - self.record_value()
1.10 self._visitName(node, self.name_store_instructions) # AssName equivalent
1.11 self.set_source()
1.12 self.discard_value()
1.13 @@ -600,6 +600,7 @@
1.14
1.15 else:
1.16 body_block = self.new_block()
1.17 + check_block = self.new_block()
1.18
1.19 # Check frames using the function's details.
1.20
1.21 @@ -607,6 +608,12 @@
1.22 nparams = len(fn.positional_names)
1.23 ndefaults = len(fn.defaults)
1.24
1.25 + self._generateFunctionContextTest(node, check_block, body_block)
1.26 +
1.27 + # Check the number of parameters and defaults.
1.28 +
1.29 + self.set_block(check_block)
1.30 +
1.31 self.new_op(CheckFrame((nparams, ndefaults, fn.has_star)))
1.32 if ndefaults > 0:
1.33 self.new_op(FillDefaults((nparams, ndefaults, fn)))
1.34 @@ -670,6 +677,7 @@
1.35
1.36 else:
1.37 body_block = self.new_block()
1.38 + check_block = self.new_block()
1.39
1.40 # Check frames using the function's details.
1.41
1.42 @@ -677,6 +685,12 @@
1.43 nparams = len(fn.positional_names)
1.44 ndefaults = len(fn.defaults)
1.45
1.46 + self._generateFunctionContextTest(node, check_block, body_block)
1.47 +
1.48 + # Check the number of parameters and defaults.
1.49 +
1.50 + self.set_block(check_block)
1.51 +
1.52 self.new_op(CheckFrame((nparams, ndefaults, fn.has_star)))
1.53 if ndefaults > 0:
1.54 self.new_op(FillDefaults((nparams, ndefaults, fn)))