From 7a632fb434e2f29e35f2e297c38dc620fd76a35d Mon Sep 17 00:00:00 2001 From: Qing Lee Date: Mon, 10 Feb 2020 17:59:19 +0800 Subject: [PATCH] =?UTF-8?q?xeCJK:=20=E5=BA=94=E7=94=A8=20\peek=5Fremove=5F?= =?UTF-8?q?spaces:n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xeCJK/xeCJK.dtx | 41 ++++++++++------------------------------- 1 file changed, 10 insertions(+), 31 deletions(-) diff --git a/xeCJK/xeCJK.dtx b/xeCJK/xeCJK.dtx index d7e08018..c62bef4a 100644 --- a/xeCJK/xeCJK.dtx +++ b/xeCJK/xeCJK.dtx @@ -283,7 +283,7 @@ Copyright and Licence % \changes{v3.8.0}{2020/02/09}{兼容 \LaTeXe\ 2020/02/02 对 \pkg{NFSS} 的修改。} % \changes{v3.8.0}{2020/02/09}{清理过时的兼容性补丁代码。} % -% \CheckSum{10770} +% \CheckSum{10754} % \GetFileId{xeCJK.sty} % % \title{\bfseries\pkg{xeCJK} 宏包} @@ -1979,8 +1979,10 @@ Copyright and Licence \cs_new_protected:Npn \xeCJK_peek_catcode_ignore_spaces:NTF #1#2#3 { \cs_set_eq:NN \l_@@_peek_search_token #1 \scan_stop: - \tl_set:Nn \@@_peek_catcode_true:w { \group_align_safe_end: #2 } - \tl_set:Nn \@@_peek_catcode_false:w { \group_align_safe_end: #3 } + \cs_set_protected:Npx \@@_peek_catcode_true:w + { \exp_not:N \group_align_safe_end: \exp_not:n {#2} } + \cs_set_protected:Npx \@@_peek_catcode_false:w + { \exp_not:N \group_align_safe_end: \exp_not:n {#3} } \bool_set_false:N \l_@@_peek_ignore_spaces_bool \group_align_safe_begin: \peek_after:Nw \@@_peek_catcode_ignore_spaces_branches:w @@ -2004,33 +2006,13 @@ Copyright and Licence \fi: } \cs_new_eq:NN \l_@@_peek_search_token ? -\tl_new:N \@@_peek_catcode_true:w -\tl_new:N \@@_peek_catcode_false:w +\cs_new_eq:NN \@@_peek_catcode_true:w \prg_do_nothing: +\cs_new_eq:NN \@@_peek_catcode_false:w \prg_do_nothing: \bool_new:N \l_@@_peek_ignore_spaces_bool % \end{macrocode} % \end{macro} % -% \begin{macro}[int]{\xeCJK_peek_after_ignore_spaces:nw} -% 与 \tn{@ifnextchar} 和 \tn{futurenonspacelet} 类似,会省略掉后面的空格。 -% \begin{macrocode} -\cs_new_protected:Npn \xeCJK_peek_after_ignore_spaces:nw #1 - { - \tl_set:Nn \@@_peek_after_do:w { \group_align_safe_end: #1 } - \group_align_safe_begin: - \peek_after:Nw \@@_peek_ignore_spaces_branches:w - } -\cs_new_protected_nopar:Npn \@@_peek_ignore_spaces_branches:w - { - \if_meaning:w \l_peek_token \c_space_token - \exp_after:wN \peek_after:Nw - \exp_after:wN \@@_peek_ignore_spaces_branches:w - \tex_romannumeral:D 0 - \else: - \exp_after:wN \@@_peek_after_do:w - \fi: - } -% \end{macrocode} -% \end{macro} +% \changes{v3.8.0}{2020/02/10}{应用 \cs{peek_remove_spaces:n}。} % % \begin{macro}[int]{\xeCJK_token_value_class:N} % 用于取得记号 |#1| 所在的 \XeTeX 字符类。|#1| 应为 \tn{catcode} 为 |11| 或 |12| @@ -4552,10 +4534,7 @@ Copyright and Licence % \begin{macro}[int]{\xeCJK_check_FullRight_symbol:Nw} % \begin{macrocode} \cs_new_protected_nopar:Npn \xeCJK_check_FullRight_symbol:Nw #1 - { - \xeCJK_peek_after_ignore_spaces:nw - { \@@_save_FullRight_symbol:N #1 } - } + { \peek_remove_spaces:n { \@@_save_FullRight_symbol:N #1 } } % \end{macrocode} % \end{macro} % @@ -7854,7 +7833,7 @@ Copyright and Licence } \cs_new_protected_nopar:Npn \@@_set_visible_space_size:n #1 { - \fontencoding { \g_fontspec_encoding_tl } + \fontencoding { \UnicodeEncodingName } \tl_set:Nn \f@family { lmtt } \selectfont \dim_compare:nNnF {#1} = { \tex_fontdimen:D 2 ~ \tex_font:D }