1.1 --- a/micropython/ast.py Mon Apr 21 00:35:18 2008 +0200
1.2 +++ b/micropython/ast.py Sat Apr 26 02:31:44 2008 +0200
1.3 @@ -194,7 +194,10 @@
1.4
1.5 "Return the last added instruction."
1.6
1.7 - return self.code[-1]
1.8 + try:
1.9 + return self.code[-1]
1.10 + except IndexError:
1.11 + return None
1.12
1.13 # Internal helper methods.
1.14
1.15 @@ -340,7 +343,7 @@
1.16 # Add space for arguments appearing before this one.
1.17
1.18 if frame_pos < pos:
1.19 - self.new_op(ReserveFrame(pos - frame_pos)
1.20 + self.new_op(ReserveFrame(pos - frame_pos))
1.21
1.22 # Generate code for the keyword and the positioning
1.23 # operation.
1.24 @@ -367,7 +370,7 @@
1.25 # Where no position is found, this could be an extra keyword
1.26 # argument.
1.27
1.28 - except ValueError:
1.29 + except self.paramtable.TableError:
1.30 extra_keywords.append(arg)
1.31 continue
1.32