aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2014-08-30 17:01:35 +0300
committerEli Zaretskii2014-08-30 17:01:35 +0300
commit23dbf47d06b396f08a530c91c456510d8dac1126 (patch)
tree9e5a4c09669ab9e1801238c6fa3b679fe310fb94 /src
parent991b257bf8e216f036b30c5a79fdae63b4954e02 (diff)
downloademacs-23dbf47d06b396f08a530c91c456510d8dac1126.tar.gz
emacs-23dbf47d06b396f08a530c91c456510d8dac1126.zip
Updated bidi_resolve_weak. Removed next_en_* members from stack.
Diffstat (limited to 'src')
-rw-r--r--src/bidi.c17
-rw-r--r--src/dispextern.h2
2 files changed, 12 insertions, 7 deletions
diff --git a/src/bidi.c b/src/bidi.c
index a99fd748981..f3b4a0847d8 100644
--- a/src/bidi.c
+++ b/src/bidi.c
@@ -439,8 +439,6 @@ bidi_push_embedding_level (struct bidi_it *bidi_it,
439 st.prev_for_neutral = bidi_it->prev_for_neutral; 439 st.prev_for_neutral = bidi_it->prev_for_neutral;
440 st.next_for_neutral = bidi_it->next_for_neutral; 440 st.next_for_neutral = bidi_it->next_for_neutral;
441 st.next_for_ws = bidi_it->next_for_ws; 441 st.next_for_ws = bidi_it->next_for_ws;
442 st.next_en_pos = bidi_it->next_en_pos;
443 st.next_en_type = bidi_it->next_en_type;
444 st.sos = bidi_it->sos; 442 st.sos = bidi_it->sos;
445 } 443 }
446} 444}
@@ -467,8 +465,6 @@ bidi_pop_embedding_level (struct bidi_it *bidi_it)
467 bidi_it->prev_for_neutral = st.prev_for_neutral; 465 bidi_it->prev_for_neutral = st.prev_for_neutral;
468 bidi_it->next_for_neutral = st.next_for_neutral; 466 bidi_it->next_for_neutral = st.next_for_neutral;
469 bidi_it->next_for_ws = st.next_for_ws; 467 bidi_it->next_for_ws = st.next_for_ws;
470 bidi_it->next_en_pos = st.next_en_pos;
471 bidi_it->next_en_type = st.next_en_type;
472 bidi_it->sos = st.sos; 468 bidi_it->sos = st.sos;
473 } 469 }
474 bidi_it->stack_idx--; 470 bidi_it->stack_idx--;
@@ -2018,6 +2014,12 @@ bidi_resolve_explicit (struct bidi_it *bidi_it)
2018 return new_level; 2014 return new_level;
2019} 2015}
2020 2016
2017static bool
2018bidi_isolate_fmt_char (bidi_type_t ch_type)
2019{
2020 return (ch_type == LRI || ch_type == RLI || ch_type == PDI);
2021}
2022
2021/* Advance in the buffer/string, resolve weak types and return the 2023/* Advance in the buffer/string, resolve weak types and return the
2022 type of the next character after weak type resolution. */ 2024 type of the next character after weak type resolution. */
2023static bidi_type_t 2025static bidi_type_t
@@ -2085,7 +2087,12 @@ bidi_resolve_weak (struct bidi_it *bidi_it)
2085 if (bidi_it->prev.type_after_w1 != UNKNOWN_BT 2087 if (bidi_it->prev.type_after_w1 != UNKNOWN_BT
2086 /* if type_after_w1 is NEUTRAL_B, this NSM is at sos */ 2088 /* if type_after_w1 is NEUTRAL_B, this NSM is at sos */
2087 && bidi_it->prev.type_after_w1 != NEUTRAL_B) 2089 && bidi_it->prev.type_after_w1 != NEUTRAL_B)
2088 type = bidi_it->prev.type_after_w1; 2090 {
2091 if (bidi_isolate_fmt_char (bidi_it->prev.type_after_w1))
2092 type = NEUTRAL_ON;
2093 else
2094 type = bidi_it->prev.type_after_w1;
2095 }
2089 else if (bidi_it->sos == R2L) 2096 else if (bidi_it->sos == R2L)
2090 type = STRONG_R; 2097 type = STRONG_R;
2091 else if (bidi_it->sos == L2R) 2098 else if (bidi_it->sos == L2R)
diff --git a/src/dispextern.h b/src/dispextern.h
index 5e90a4ef23b..3723d341a51 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -1920,8 +1920,6 @@ struct bidi_stack {
1920 struct bidi_saved_info next_for_neutral; 1920 struct bidi_saved_info next_for_neutral;
1921 struct bidi_saved_info prev_for_neutral; 1921 struct bidi_saved_info prev_for_neutral;
1922 struct bidi_saved_info next_for_ws; 1922 struct bidi_saved_info next_for_ws;
1923 ptrdiff_t next_en_pos;
1924 bidi_type_t next_en_type;
1925 bidi_dir_t sos; 1923 bidi_dir_t sos;
1926}; 1924};
1927 1925