def append_newline(self, force_newline=False, preserve_statement_flags=False):
    self.output_space_before_token = False
    if (not preserve_statement_flags):
        if ((self.flags.last_text != ';') and (self.flags.last_text != ',') and (self.flags.last_text != '=') and (self.last_type != 'TK_OPERATOR')):
            while ((self.flags.mode == MODE.Statement) and (not self.flags.if_block) and (not self.flags.do_block)):
                self.restore_mode()
    if ((len(self.output_lines) == 1) and self.just_added_newline()):
        return
    if (force_newline or (not self.just_added_newline())):
        self.flags.multiline_frame = True
        self.output_lines.append(OutputLine())
def append_newline(self, force_newline=False, preserve_statement_flags=False):
    self.output_space_before_token = False
    if (not preserve_statement_flags):
        if ((self.flags.last_text != ';') and (self.flags.last_text != ',') and (self.flags.last_text != '=') and (self.last_type != 'TK_OPERATOR')):
            while ((self.flags.mode == MODE.Statement) and (not self.flags.if_block) and (not self.flags.do_block)):
                self.restore_mode()
    if ((len(self.output_lines) == 1) and self.just_added_newline()):
        return
    if (force_newline or (not self.just_added_newline())):
        self.flags.multiline_frame = True
        self.output_lines.append(OutputLine())