(self, ins)
Parse CHAIN syntax.
Parse CHAIN syntax.
Parse CHAIN syntax .
def _parse_chain(self, ins):
        """Parse CHAIN syntax."""
        yield ins.skip_blank_read_if((tk.MERGE,)) is not None
        yield self.parse_expression(ins)
        jumpnum, common_all, delete_range = None, False, True
        if ins.skip_blank_read_if((b',',)):
            # check for an expression that indicates a line in the other program.
            # This is not stored as a jumpnum (to avoid RENUM)
            jumpnum = self.parse_expression(ins, allow_empty=True)
            if ins.skip_blank_read_if((b',',)):
                common_all = ins.skip_blank_read_if((tk.W_ALL,), 3)
                if common_all:
                    # CHAIN "file", , ALL, DELETE
                    delete_range = ins.skip_blank_read_if((b',',))
                # CHAIN "file", , DELETE
        yield jumpnum
        yield common_all
        if delete_range and ins.skip_blank_read_if((tk.DELETE,)):
            from_line = self._parse_optional_jumpnum(ins)
            if ins.skip_blank_read_if((tk.O_MINUS,)):
                to_line = self._parse_optional_jumpnum(ins)
            else:
                to_line = from_line
            error.throw_if(not to_line)
            delete_lines = (from_line, to_line)
            # ignore rest if preceded by comma
            if ins.skip_blank_read_if((b',',)):
                ins.skip_to(tk.END_STATEMENT)
            yield delete_lines
        else:
            yield None
        ins.require_end()
def _parse_chain ( self , ins ) : yield ins . skip_blank_read_if ( ( tk . MERGE , ) ) is not None yield self . parse_expression ( ins ) jumpnum , common_all , delete_range = None , False , True if ins . skip_blank_read_if ( ( b',' , ) ) : # check for an expression that indicates a line in the other program. # This is not stored as a jumpnum (to avoid RENUM) jumpnum = self . parse_expression ( ins , allow_empty = True ) if ins . skip_blank_read_if ( ( b',' , ) ) : common_all = ins . skip_blank_read_if ( ( tk . W_ALL , ) , 3 ) if common_all : # CHAIN "file", , ALL, DELETE delete_range = ins . skip_blank_read_if ( ( b',' , ) ) # CHAIN "file", , DELETE yield jumpnum yield common_all if delete_range and ins . skip_blank_read_if ( ( tk . DELETE , ) ) : from_line = self . _parse_optional_jumpnum ( ins ) if ins . skip_blank_read_if ( ( tk . O_MINUS , ) ) : to_line = self . _parse_optional_jumpnum ( ins ) else : to_line = from_line error . throw_if ( not to_line ) delete_lines = ( from_line , to_line ) # ignore rest if preceded by comma if ins . skip_blank_read_if ( ( b',' , ) ) : ins . skip_to ( tk . END_STATEMENT ) yield delete_lines else : yield None ins . require_end ( )