micropython

Change of rsvp.py

229:a179262ea7c4
rsvp.py
     1.1 --- a/rsvp.py	Mon May 25 00:45:53 2009 +0200
     1.2 +++ b/rsvp.py	Fri May 29 00:18:40 2009 +0200
     1.3 @@ -280,21 +280,24 @@
     1.4          self.run()
     1.5          success = 1
     1.6  
     1.7 -        for name in module.keys():
     1.8 -            if name.startswith("result"):
     1.9 -                label, expected = name.split("_")
    1.10 -                attr = module[name]
    1.11 +        if self.exception is None:
    1.12 +            for name in module.keys():
    1.13 +                if name.startswith("result"):
    1.14 +                    label, expected = name.split("_")
    1.15 +                    attr = module[name]
    1.16  
    1.17 -                # NOTE: Assumptions about headers and content made.
    1.18 +                    # NOTE: Assumptions about headers and content made.
    1.19  
    1.20 -                attr_location = module.location + 1 + attr.position
    1.21 -                context, ref = self.load(attr_location)
    1.22 -                content = self.load(ref + 1)
    1.23 -                print label, expected, content
    1.24 +                    attr_location = module.location + 1 + attr.position
    1.25 +                    context, ref = self.load(attr_location)
    1.26 +                    content = self.load(ref + 1)
    1.27 +                    print label, expected, content
    1.28  
    1.29 -                success = success and (int(expected) == content)
    1.30 +                    success = success and (int(expected) == content)
    1.31  
    1.32 -        return success
    1.33 +            return success
    1.34 +        else:
    1.35 +            return 0
    1.36  
    1.37      def execute(self):
    1.38  
    1.39 @@ -509,7 +512,7 @@
    1.40          self.frame_stack = self.frame_stack[:frame] # reset stack before call
    1.41  
    1.42      def RecoverFrame(self):
    1.43 -        self.local_sp_stack.pop()
    1.44 +        self.invocation_sp_stack[-1] = self.local_sp_stack.pop()
    1.45  
    1.46      def StoreFrame(self):
    1.47          frame = self.invocation_sp_stack[-1] # different from the current frame after MakeFrame
    1.48 @@ -618,7 +621,7 @@
    1.49          self.frame_stack.extend([None] * self.operand)
    1.50  
    1.51      def AdjustFrame(self):
    1.52 -        self.invocation_sp_stack[-1] += self.operand
    1.53 +        self.local_sp_stack[-1] += self.operand
    1.54  
    1.55      def Return(self):
    1.56          return self.pull_pc()