= bidi_it->last_strong.orig_type = UNKNOWN_BT;
bidi_it->prev_for_neutral.type = (bidi_it->sos == R2L ? STRONG_R : STRONG_L);
bidi_it->prev_for_neutral.charpos = bidi_it->charpos;
- bidi_it->prev_for_neutral.bytepos = bidi_it->bytepos;
bidi_it->next_for_neutral.type = bidi_it->next_for_neutral.type_after_wn
= bidi_it->next_for_neutral.orig_type = UNKNOWN_BT;
}
struct bidi_it *bidi_it)
{
saved_info->charpos = bidi_it->charpos;
- saved_info->bytepos = bidi_it->bytepos;
saved_info->type = bidi_it->type;
bidi_check_type (bidi_it->type);
saved_info->type_after_wn = bidi_it->type_after_wn;
else /* EOB or end of string */
prev_type = NEUTRAL_B;
+ /* Reset the bracket_resolved flag. */
+ bidi_it->bracket_resolved = 0;
+
current_level = bidi_it->level_stack[bidi_it->stack_idx].level; /* X1 */
override = bidi_it->level_stack[bidi_it->stack_idx].override;
isolate_status = bidi_it->level_stack[bidi_it->stack_idx].isolate_status;
&& bidi_it->charpos >= bidi_it->next_for_ws.charpos)
bidi_it->next_for_ws.type = UNKNOWN_BT;
- /* Resete the bracket_resolved flag. */
- bidi_it->bracket_resolved = 0;
-
/* This must be taken before we fill the iterator with the info
about the next char. If we scan backwards, the iterator
state must be already cached, so there's no need to know the
if (bidi_get_category (type) == NEUTRAL /* && type != NEUTRAL_B */
|| bidi_isolate_fmt_char (type))
{
- if (bidi_it->next_for_neutral.type == UNKNOWN_BT)
+ /* Make sure the data for resolving neutrals we are about to use
+ is valid. */
+ if (bidi_it->next_for_neutral.charpos <= bidi_it->charpos
+ || bidi_it->next_for_neutral.type == UNKNOWN_BT)
emacs_abort ();
/* If the cached state shows a neutral character, it was not
bidi_it->next_for_ws.type = chtype;
bidi_check_type (bidi_it->next_for_ws.type);
bidi_it->next_for_ws.charpos = cpos;
- bidi_it->next_for_ws.bytepos = bpos;
}
/* Resolve implicit levels. */
/* Data type for storing information about characters we need to
remember. */
struct bidi_saved_info {
- ptrdiff_t bytepos, charpos; /* character's buffer position */
+ ptrdiff_t charpos; /* character's buffer position */
bidi_type_t type; /* character's resolved bidi type */
- bidi_type_t type_after_wn; /* original type of the character, after W1 */
- bidi_type_t orig_type; /* type as we found it in the buffer */
+ bidi_type_t type_after_wn; /* bidi type of the character, after Wn */
+ bidi_type_t orig_type; /* bidi type as we found it in the buffer */
bool_bf bracket_resolved : 1; /* 1 if type was BPA-resolved */
};