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
2.1 --- a/micropython/rsvp.py Mon Apr 21 00:35:18 2008 +0200
2.2 +++ b/micropython/rsvp.py Sat Apr 26 02:31:44 2008 +0200
2.3 @@ -67,18 +67,27 @@
2.4
2.5 AR = AddressRelativeInstruction
2.6
2.7 -class ImmediateInstruction(Instruction):
2.8 +class AddressInstruction(Instruction):
2.9
2.10 "An instruction loading an address directly."
2.11
2.12 def __repr__(self):
2.13 return "%s(%r)" % (self.__class__.__name__, self.attr.location)
2.14
2.15 +Address = AddressInstruction
2.16 +
2.17 +class ImmediateInstruction(Instruction):
2.18 +
2.19 + "An instruction employing a constant."
2.20 +
2.21 + def __repr__(self):
2.22 + return "%s(%r)" % (self.__class__.__name__, self.attr)
2.23 +
2.24 Immediate = ImmediateInstruction
2.25
2.26 # Instructions operating on the value stack.
2.27
2.28 -class LoadConst(Immediate): "Load the constant from the specified location."
2.29 +class LoadConst(Address): "Load the constant from the specified location."
2.30 class Duplicate(Instruction): "Duplicate the top of stack."
2.31 class Pop(Instruction): "Pop the top of stack."
2.32