Skip to content

Commit

Permalink
Adjusted for expl3 2023-08-11
Browse files Browse the repository at this point in the history
  • Loading branch information
h20y6m committed Aug 14, 2023
1 parent e8ff901 commit 580ad42
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 90 deletions.
3 changes: 3 additions & 0 deletions build.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ bundle = ""
maindir = "."

os.setenv("guess_input_kanji_encoding", "0")
os.setenv("PTEX_KANJI_ENC", "utf8")

checkengines = {"ptex-euc","ptex-sjis","uptex","uptex-euc","uptex-sjis"}
stdengine = "ptex-euc"
Expand Down Expand Up @@ -49,6 +50,8 @@ installfiles = {"plexpl3.ltx","plexpl3.sty","plpatch3.sty"}
typesetexe = "platex"
typesetopts = " -interaction=nonstopmode -halt-on-error -kanji=utf8 "

maxprintline = 9999

unpackexe = "ptex"
unpackopts = " -interaction=batchmode -halt-on-error -kanji=utf8 "

Expand Down
99 changes: 28 additions & 71 deletions plpatch3.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,14 @@
% }^^A
% }
%
% \date{Released 2023-02-18}
% \date{Released 2023-08-11}
%
% \maketitle
%
% \begin{documentation}
%
%
%
% \end{documentation}
%
% \begin{implementation}
Expand Down Expand Up @@ -495,86 +498,32 @@
%
% \subsubsection{Fix for the codepoints funcrtions}
%
% Reverts the \pTeX{} implementation to the same as \pdfTeX{}.
% \begin{macrocode}
\sys_if_engine_ptex:T
{
\cs_gset:Npn \@@_codepoint_process:nN #1#2
{
\int_compare:nNnTF { `#2 } > { "80 }
{
\int_compare:nNnTF { `#2 } < { "E0 }
{ \@@_codepoint_process:nNN }
{
\int_compare:nNnTF { `#2 } < { "F0 }
{ \@@_codepoint_process:nNNN }
{ \@@_codepoint_process:nNNNN }
}
}
{ \use:n }
{#1} #2
}
\cs_new:Npn \@@_codepoint_process:nNNN #1#2#3#4
{ #1 {#2#3#4} }
\cs_new:Npn \@@_codepoint_process:nNNNN #1#2#3#4#5
{ #1 {#2#3#4#5} }
}
% \end{macrocode}
% Handle jachar in \pTeX{} and \upTeX{}.
% \begin{macrocode}
\bool_lazy_or:nnT
{ \sys_if_engine_ptex_p: }
{ \sys_if_engine_uptex_p: }
{
\cs_new_eq:NN \@@_codepoint_process_non_jachar:nN
\@@_codepoint_process:nN
\cs_gset:Npn \@@_codepoint_process:nN #1#2
{
\token_if_jachar:NTF #2
{ \@@_codepoint_process_jachar:nN }
{ \@@_codepoint_process_non_jachar:nN }
\int_compare:nNnTF {`#2} > { "7F }
{
\token_if_jachar:NTF #2
{ \use:n }
{ \@@_codepoint_process_aux:nN }
}
{ \use:n }
{#1} #2
}
\cs_new:Npn \@@_codepoint_process_jachar:nN #1#2
{ #1 {#2} }
}
% \end{macrocode}
%
% Reverts the \pTeX{} implementation to the same as \pdfTeX{}.
% \begin{macrocode}
\sys_if_engine_ptex:T
\bool_lazy_or:nnT
{ \sys_if_engine_ptex_p: }
{ \sys_if_engine_uptex_p: }
{
\cs_gset:Npn \@@_codepoint_from_chars:Nw #1
{
\if_int_compare:w `#1 > "80 \exp_stop_f:
\if_int_compare:w `#1 < "E0 \exp_stop_f:
\exp_after:wN \exp_after:wN \exp_after:wN
\@@_codepoint_from_chars:NN
\else:
\if_int_compare:w `#1 < "F0 \exp_stop_f:
\exp_after:wN \exp_after:wN \exp_after:wN
\exp_after:wN \exp_after:wN \exp_after:wN
\exp_after:wN \@@_codepoint_from_chars:NNN
\else:
\exp_after:wN \exp_after:wN \exp_after:wN
\exp_after:wN \exp_after:wN \exp_after:wN
\exp_after:wN \@@_codepoint_from_chars:NNNN
\fi:
\fi:
\else:
\exp_after:wN \@@_codepoint_from_chars:N
\fi:
#1
}
\cs_new:Npn \@@_codepoint_from_chars:NNN #1#2#3
{ (`#1 - "E0) * "1000 + (`#2 - "80) * "40 + `#3 - "80 }
\cs_new:Npn \@@_codepoint_from_chars:NNNN #1#2#3#4
{
(`#1 - "F0) * "40000
+ (`#2 - "80) * "1000
+ (`#3 - "80) * "40
+ `#4 - "80
}
}
% \end{macrocode}
% Handle jachar in \pTeX{} and \upTeX{}.
Expand All @@ -583,14 +532,22 @@
{ \sys_if_engine_ptex_p: }
{ \sys_if_engine_uptex_p: }
{
\cs_new_eq:NN \@@_codepoint_from_chars_non_jachar:Nw
\@@_codepoint_from_chars:Nw
\cs_gset:Npn \@@_codepoint_from_chars:Nw #1
{
\token_if_jachar:NTF #1
{ \@@_codepoint_from_chars_jachar:N }
{ \@@_codepoint_from_chars_non_jachar:Nw }
#1
\if_int_compare:w `#1 > "7F \exp_stop_f:
\token_if_jachar:NTF #1
{
\exp_after:wN
\@@_codepoint_from_chars:N
}
{
\exp_after:wN
\@@_codepoint_from_chars_aux:Nw
}
\else:
\exp_after:wN \@@_codepoint_from_chars:N
\fi:
#1
}
\cs_new:Npn \@@_codepoint_from_chars_jachar:N #1
{ \tex_toucs:D `#1 ~ }
Expand Down
9 changes: 3 additions & 6 deletions testfiles/pl3str001.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ Don't change this file in any respect.
TEST 1: tl_to_str
============================================================
"ABCxyz+?"
"£§±¶^^c2^^bd^^c3^^85^^c3^^86^^c3^^87^^c3^^8a^^c3^^8f^^c3^^90^^c3^^91^^c3^^
92×^^c3^^98^^c3^^99^^c3^^9d^^c3^^9e^^c3^^9f"
"£§±¶^^c2^^bd^^c3^^85^^c3^^86^^c3^^87^^c3^^8a^^c3^^8f^^c3^^90^^c3^^91^^c3^^92×^^c3^^98^^c3^^99^^c3^^9d^^c3^^9e^^c3^^9f"
"^^c3^^a3^^c3^^a6^^c3^^a7^^c3^^a9^^c3^^ac^^c3^^b0^^c3^^b4÷^^c3^^b8^^c3^^bb^^c3^^be^^c3^^bf"
"^^c4^^82^^c4^^98^^c5^^81^^c5^^8a^^c5^^90^^c4^^85^^c4^^9b^^c4^^9f^^c5^^8b^^c5^^9f^^c5^^af^^c5^^bc"
"ΑΒΓΩαβγω"
Expand All @@ -16,8 +15,7 @@ TEST 1: tl_to_str
TEST 2: uppercase
============================================================
"ABCXYZ+?"
"£§±¶^^c2^^bd^^c3^^85^^c3^^86^^c3^^87^^c3^^8a^^c3^^8f^^c3^^90^^c3^^91^^c3^^
92×^^c3^^98^^c3^^99^^c3^^9d^^c3^^9eSS"
"£§±¶^^c2^^bd^^c3^^85^^c3^^86^^c3^^87^^c3^^8a^^c3^^8f^^c3^^90^^c3^^91^^c3^^92×^^c3^^98^^c3^^99^^c3^^9d^^c3^^9eSS"
"^^c3^^83^^c3^^86^^c3^^87^^c3^^89^^c3^^8c^^c3^^90^^c3^^94÷^^c3^^98^^c3^^9b^^c3^^9e^^c5^^b8"
"^^c4^^82^^c4^^98^^c5^^81^^c5^^8a^^c5^^90^^c4^^84^^c4^^9a^^c4^^9e^^c5^^8a^^c5^^9e^^c5^^ae^^c5^^bb"
"ΑΒΓΩαβγω"
Expand All @@ -28,8 +26,7 @@ TEST 2: uppercase
TEST 3: lowercase
============================================================
"abcxyz+?"
"£§±¶^^c2^^bd^^c3^^a5^^c3^^a6^^c3^^a7^^c3^^aa^^c3^^af^^c3^^b0^^c3^^b1^^c3^^
b2×^^c3^^b8^^c3^^b9^^c3^^bd^^c3^^be^^c3^^9f"
"£§±¶^^c2^^bd^^c3^^a5^^c3^^a6^^c3^^a7^^c3^^aa^^c3^^af^^c3^^b0^^c3^^b1^^c3^^b2×^^c3^^b8^^c3^^b9^^c3^^bd^^c3^^be^^c3^^9f"
"^^c3^^a3^^c3^^a6^^c3^^a7^^c3^^a9^^c3^^ac^^c3^^b0^^c3^^b4÷^^c3^^b8^^c3^^bb^^c3^^be^^c3^^bf"
"^^c4^^83^^c4^^99^^c5^^82^^c5^^8b^^c5^^91^^c4^^85^^c4^^9b^^c4^^9f^^c5^^8b^^c5^^9f^^c5^^af^^c5^^bc"
"ΑΒΓΩαβγω"
Expand Down
9 changes: 3 additions & 6 deletions testfiles/pl3text001.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ Don't change this file in any respect.
TEST 1: expand
============================================================
ABCxyz+?
£§±¶^^c2^^bd^^c3^^85^^c3^^86^^c3^^87^^c3^^8a^^c3^^8f^^c3^^90^^c3^^91^^c3^^9
2×^^c3^^98^^c3^^99^^c3^^9d^^c3^^9e^^c3^^9f
£§±¶^^c2^^bd^^c3^^85^^c3^^86^^c3^^87^^c3^^8a^^c3^^8f^^c3^^90^^c3^^91^^c3^^92×^^c3^^98^^c3^^99^^c3^^9d^^c3^^9e^^c3^^9f
^^c3^^a3^^c3^^a6^^c3^^a7^^c3^^a9^^c3^^ac^^c3^^b0^^c3^^b4÷^^c3^^b8^^c3^^bb^^c3^^be^^c3^^bf
^^c4^^82^^c4^^98^^c5^^81^^c5^^8a^^c5^^90^^c4^^85^^c4^^9b^^c4^^9f^^c5^^8b^^c5^^9f^^c5^^af^^c5^^bc
\cGrek {ΑΒΓΩαβγω}
Expand All @@ -16,8 +15,7 @@ ABCxyz+?
TEST 2: uppercase
============================================================
ABCXYZ+?
£§±¶^^c2^^bd^^c3^^85^^c3^^86^^c3^^87^^c3^^8a^^c3^^8f^^c3^^90^^c3^^91^^c3^^9
2×^^c3^^98^^c3^^99^^c3^^9d^^c3^^9eSS
£§±¶^^c2^^bd^^c3^^85^^c3^^86^^c3^^87^^c3^^8a^^c3^^8f^^c3^^90^^c3^^91^^c3^^92×^^c3^^98^^c3^^99^^c3^^9d^^c3^^9eSS
^^c3^^83^^c3^^86^^c3^^87^^c3^^89^^c3^^8c^^c3^^90^^c3^^94÷^^c3^^98^^c3^^9b^^c3^^9e^^c5^^b8
^^c4^^82^^c4^^98^^c5^^81^^c5^^8a^^c5^^90^^c4^^84^^c4^^9a^^c4^^9e^^c5^^8a^^c5^^9e^^c5^^ae^^c5^^bb
\cGrek {ΑΒΓΩαβγω}
Expand All @@ -28,8 +26,7 @@ ABCXYZ+?
TEST 3: lowercase
============================================================
abcxyz+?
£§±¶^^c2^^bd^^c3^^a5^^c3^^a6^^c3^^a7^^c3^^aa^^c3^^af^^c3^^b0^^c3^^b1^^c3^^b
2×^^c3^^b8^^c3^^b9^^c3^^bd^^c3^^be^^c3^^9f
£§±¶^^c2^^bd^^c3^^a5^^c3^^a6^^c3^^a7^^c3^^aa^^c3^^af^^c3^^b0^^c3^^b1^^c3^^b2×^^c3^^b8^^c3^^b9^^c3^^bd^^c3^^be^^c3^^9f
^^c3^^a3^^c3^^a6^^c3^^a7^^c3^^a9^^c3^^ac^^c3^^b0^^c3^^b4÷^^c3^^b8^^c3^^bb^^c3^^be^^c3^^bf
^^c4^^83^^c4^^99^^c5^^82^^c5^^8b^^c5^^91^^c4^^85^^c4^^9b^^c4^^9f^^c5^^8b^^c5^^9f^^c5^^af^^c5^^bc
\cGrek {ΑΒΓΩαβγω}
Expand Down
5 changes: 1 addition & 4 deletions testfiles/pl3text002.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ Defining \test_map:n on line ...
============================================================
TEST 1: text_map_function
============================================================
[A][B][C][ ][^^c3^^a4][^^c3^^ab][^^c3^^af][^^c3^^b6][^^c3^^bc][ ][α][β][γ][ ][あ][い][う][え][お][ ][か^^e3^^82^^9a][き^^e3^^82^^9a][く^^e3^^82^^9a][け^^e3
^^82^^9a][こ^^e3^^82^^9a][ ][葛^^f3^^a0^^84^^80][城][市][ ][葛^^f3^^a0^^84^^81]
[飾][区][ ][^^e2^^98^^80][^^e2^^98^^81][^^e2^^98^^82][^^e2^^98^^83][ ][^^e2^^9b
^^84][^^f0^^9f^^91^^a8^^e2^^80^^8d][^^f0^^9f^^91^^a9^^e2^^80^^8d][^^f0^^9f^^91^^a7^^e2^^80^^8d][^^f0^^9f^^91^^a6][^^f0^^9f^^92^^94]
[A][B][C][ ][^^c3^^a4][^^c3^^ab][^^c3^^af][^^c3^^b6][^^c3^^bc][ ][α][β][γ][ ][あ][い][う][え][お][ ][か^^e3^^82^^9a][き^^e3^^82^^9a][く^^e3^^82^^9a][け^^e3^^82^^9a][こ^^e3^^82^^9a][ ][葛^^f3^^a0^^84^^80][城][市][ ][葛^^f3^^a0^^84^^81][飾][区][ ][^^e2^^98^^80][^^e2^^98^^81][^^e2^^98^^82][^^e2^^98^^83][ ][^^e2^^9b^^84][^^f0^^9f^^91^^a8^^e2^^80^^8d][^^f0^^9f^^91^^a9^^e2^^80^^8d][^^f0^^9f^^91^^a7^^e2^^80^^8d][^^f0^^9f^^91^^a6][^^f0^^9f^^92^^94]
============================================================
============================================================
TEST 2: text_map_inline
Expand Down
4 changes: 1 addition & 3 deletions testfiles/pl3text002.uptex.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ Defining \test_map:n on line ...
============================================================
TEST 1: text_map_function
============================================================
[A][B][C][ ][^^c3^^a4][^^c3^^ab][^^c3^^af][^^c3^^b6][^^c3^^bc][ ][α][β][γ][ ][あ][い][う][え][お][ ][か゚][き゚][く゚][け゚][こ゚][ ][葛
󠄀][城][市][ ][葛󠄁][飾][区][ ][☀][☁][☂][☃][ ][⛄][👨‍][
👩‍][👧‍][👦][💔]
[A][B][C][ ][^^c3^^a4][^^c3^^ab][^^c3^^af][^^c3^^b6][^^c3^^bc][ ][α][β][γ][ ][あ][い][う][え][お][ ][か゚][き゚][く゚][け゚][こ゚][ ][葛󠄀][城][市][ ][葛󠄁][飾][区][ ][☀][☁][☂][☃][ ][⛄][👨‍][👩‍][👧‍][👦][💔]
============================================================
============================================================
TEST 2: text_map_inline
Expand Down

0 comments on commit 580ad42

Please sign in to comment.