(self, ins)
Helper function for ON event trap definitions.
Helper function for ON event trap definitions.
Helper function for ON event trap definitions .
def _parse_on_event(self, ins):
        """Helper function for ON event trap definitions."""
        # token is known to be in (tk.PEN, tk.KEY, tk.TIMER, tk.PLAY, tk.COM, tk.STRIG)
        # before we call this generator
        token = ins.read_keyword_token()
        yield token
        if token != tk.PEN:
            yield self._parse_bracket(ins)
        else:
            yield None
        ins.require_read((tk.GOSUB,))
        yield self._parse_jumpnum(ins)
        ins.require_end()
def _parse_on_event ( self , ins ) : # token is known to be in (tk.PEN, tk.KEY, tk.TIMER, tk.PLAY, tk.COM, tk.STRIG) # before we call this generator token = ins . read_keyword_token ( ) yield token if token != tk . PEN : yield self . _parse_bracket ( ins ) else : yield None ins . require_read ( ( tk . GOSUB , ) ) yield self . _parse_jumpnum ( ins ) ins . require_end ( )