texlive[71289] Build/source/texk/web2c: {,e}{,u}ptex: Enable to get

commits+takuji at tug.org commits+takuji at tug.org
Sat May 18 13:06:27 CEST 2024


Revision: 71289
          https://tug.org/svn/texlive?view=revision&revision=71289
Author:   takuji
Date:     2024-05-18 13:06:27 +0200 (Sat, 18 May 2024)
Log Message:
-----------
{,e}{,u}ptex: Enable to get charcode from control symbol by back quote

Modified Paths:
--------------
    trunk/Build/source/texk/web2c/Makefile.in
    trunk/Build/source/texk/web2c/euptexdir/ChangeLog
    trunk/Build/source/texk/web2c/euptexdir/am/euptex.am
    trunk/Build/source/texk/web2c/ptexdir/ChangeLog
    trunk/Build/source/texk/web2c/ptexdir/ptex-base.ch
    trunk/Build/source/texk/web2c/uptexdir/ChangeLog
    trunk/Build/source/texk/web2c/uptexdir/ptex-base.ch

Added Paths:
-----------
    trunk/Build/source/texk/web2c/euptexdir/euptex-ctrlsym.test
    trunk/Build/source/texk/web2c/euptexdir/tests/ctrlsym.log
    trunk/Build/source/texk/web2c/euptexdir/tests/ctrlsym.tex
    trunk/Build/source/texk/web2c/uptexdir/tests/ctlsym_num.tex

Modified: trunk/Build/source/texk/web2c/Makefile.in
===================================================================
--- trunk/Build/source/texk/web2c/Makefile.in	2024-05-18 11:06:21 UTC (rev 71288)
+++ trunk/Build/source/texk/web2c/Makefile.in	2024-05-18 11:06:27 UTC (rev 71289)
@@ -3244,22 +3244,24 @@
 	euptexdir/euptrip/euptrip.diffs euptexdir/euptrip/texmf.cnf \
 	euptexdir/pdfprimitive.test \
 	euptexdir/tests/pdfprimitive-test.tex \
-	euptexdir/tests/pdfprimitive-euptex.log hitexdir/ChangeLog \
-	$(hitex_web) $(hitex_tests) hitexdir/tests/hello.tex \
-	hitexdir/tests/rule.tex pdftexdir/regex/COPYING.LIB \
-	pdftexdir/regex/README $(pdftex_ch_srcs) \
-	pdftexdir/pdftex.defines pdftexdir/ChangeLog pdftexdir/NEWS \
-	pdftexdir/README pdftexdir/change-files.txt $(pdftex_tests) \
-	tests/wprob.tex pdftexdir/tests/pdfimage.tex tests/1-4.jpg \
-	tests/B.pdf tests/basic.tex tests/lily-ledger-broken.png \
-	tests/expanded.tex tests/expanded.txt tests/cnfline.tex \
-	tests/partoken-ok.tex tests/partoken-xfail.tex \
-	$(ttf2afm_tests) pdftexdir/tests/postV3.afm \
-	pdftexdir/tests/postV3.ttf pdftexdir/tests/postV7.afm \
-	pdftexdir/tests/postV7.ttf $(pdftosrc_tests) \
-	pdftexdir/tests/test-13.pdf pdftexdir/tests/test-13.xref \
-	pdftexdir/tests/test-15.pdf pdftexdir/tests/test-15.xref \
-	$(libluasocket_sources) luatexdir/luasocket/src/ftp_lua.c \
+	euptexdir/tests/pdfprimitive-euptex.log \
+	euptexdir/tests/ctrlsym.log euptexdir/tests/ctrlsym.tex \
+	hitexdir/ChangeLog $(hitex_web) $(hitex_tests) \
+	hitexdir/tests/hello.tex hitexdir/tests/rule.tex \
+	pdftexdir/regex/COPYING.LIB pdftexdir/regex/README \
+	$(pdftex_ch_srcs) pdftexdir/pdftex.defines pdftexdir/ChangeLog \
+	pdftexdir/NEWS pdftexdir/README pdftexdir/change-files.txt \
+	$(pdftex_tests) tests/wprob.tex pdftexdir/tests/pdfimage.tex \
+	tests/1-4.jpg tests/B.pdf tests/basic.tex \
+	tests/lily-ledger-broken.png tests/expanded.tex \
+	tests/expanded.txt tests/cnfline.tex tests/partoken-ok.tex \
+	tests/partoken-xfail.tex $(ttf2afm_tests) \
+	pdftexdir/tests/postV3.afm pdftexdir/tests/postV3.ttf \
+	pdftexdir/tests/postV7.afm pdftexdir/tests/postV7.ttf \
+	$(pdftosrc_tests) pdftexdir/tests/test-13.pdf \
+	pdftexdir/tests/test-13.xref pdftexdir/tests/test-15.pdf \
+	pdftexdir/tests/test-15.xref $(libluasocket_sources) \
+	luatexdir/luasocket/src/ftp_lua.c \
 	luatexdir/luasocket/src/headers_lua.c \
 	luatexdir/luasocket/src/http_lua.c \
 	luatexdir/luasocket/src/ltn12_lua.c \
@@ -3569,7 +3571,8 @@
 	uptests/ygk256*.* uptests/xskipjfmp.* uptrip.diffs \
 	$(nodist_euptex_SOURCES) euptex.web euptex.ch euptex-web2c \
 	euptex.p euptex.pool euptex-tangle euptrip.diffs \
-	pdfprimitive-euptex.* $(nodist_hitex_SOURCES) \
+	pdfprimitive-euptex.* eup-ctrlsym.fmt eup-ctrlsym.log \
+	eup-ctrlsym.out eup-ctrlsym.tex $(nodist_hitex_SOURCES) \
 	$(nodist_hishrink_SOURCES) $(nodist_histretch_SOURCES) \
 	hiformat-tangle hitex-tangle hello.log rule.log \
 	$(nodist_pdftex_SOURCES) pdftex-final.ch pdftex-web2c pdftex.p \
@@ -4514,6 +4517,7 @@
 euptex_tests = \
 	euptexdir/euptriptest.test euptexdir/eptriptest.test \
 	euptexdir/pdfprimitive.test \
+	euptexdir/euptex-ctrlsym.test \
 	euptexdir/eupver.test \
 	euptexdir/upkcat.test \
 	euptexdir/wcfname.test euptexdir/wcfname0.test
@@ -21984,7 +21988,8 @@
 euptexdir/euptriptest.log euptexdir/eptriptest.log: \
 	euptex$(EXEEXT) dvitype$(EXEEXT) pltotf$(EXEEXT) tftopl$(EXEEXT)
 euptexdir/pdfprimitive.log: euptex$(EXEEXT)
-euptexdir/eupver.log euptexdir/upkcat.log \
+euptexdir/euptex-ctrlsym.log \
+	euptexdir/eupver.log euptexdir/upkcat.log \
 	euptexdir/wcfname.log euptexdir/wcfname0.log: euptex$(EXEEXT)
 euptrip.diffs: euptex$(EXEEXT) dvitype$(EXEEXT) pltotf$(EXEEXT) tftopl$(EXEEXT)
 	$(triptrap_diffs) $@

Modified: trunk/Build/source/texk/web2c/euptexdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/euptexdir/ChangeLog	2024-05-18 11:06:21 UTC (rev 71288)
+++ trunk/Build/source/texk/web2c/euptexdir/ChangeLog	2024-05-18 11:06:27 UTC (rev 71289)
@@ -1,3 +1,10 @@
+2024-05-18  TANAKA Takuji  <ttk at t-lab.opal.ne.jp>
+
+	* euptex-ctrlsym.test, tests/ctrlsym.{tex,log},
+	am/euptex.am: Add tests for getting character codes
+	from control symbols by using backquote "`".
+	https://github.com/texjporg/tex-jp-build/issues/167
+
 2024-05-01  TANAKA Takuji  <ttk at t-lab.opal.ne.jp>
 
 	* pdfutils.ch: Revert some patches.

Modified: trunk/Build/source/texk/web2c/euptexdir/am/euptex.am
===================================================================
--- trunk/Build/source/texk/web2c/euptexdir/am/euptex.am	2024-05-18 11:06:21 UTC (rev 71288)
+++ trunk/Build/source/texk/web2c/euptexdir/am/euptex.am	2024-05-18 11:06:27 UTC (rev 71289)
@@ -98,6 +98,7 @@
 euptex_tests = \
 	euptexdir/euptriptest.test euptexdir/eptriptest.test \
 	euptexdir/pdfprimitive.test \
+	euptexdir/euptex-ctrlsym.test \
 	euptexdir/eupver.test \
 	euptexdir/upkcat.test \
 	euptexdir/wcfname.test euptexdir/wcfname0.test
@@ -104,7 +105,8 @@
 euptexdir/euptriptest.log euptexdir/eptriptest.log: \
 	euptex$(EXEEXT) dvitype$(EXEEXT) pltotf$(EXEEXT) tftopl$(EXEEXT)
 euptexdir/pdfprimitive.log: euptex$(EXEEXT)
-euptexdir/eupver.log euptexdir/upkcat.log \
+euptexdir/euptex-ctrlsym.log \
+	euptexdir/eupver.log euptexdir/upkcat.log \
 	euptexdir/wcfname.log euptexdir/wcfname0.log: euptex$(EXEEXT)
 
 EXTRA_DIST += $(euptex_tests)
@@ -136,4 +138,8 @@
 	euptexdir/tests/pdfprimitive-euptex.log
 DISTCLEANFILES += pdfprimitive-euptex.*
 
+## euptex-ctrlsym.test
+EXTRA_DIST += euptexdir/tests/ctrlsym.log euptexdir/tests/ctrlsym.tex
+DISTCLEANFILES += eup-ctrlsym.fmt eup-ctrlsym.log eup-ctrlsym.out eup-ctrlsym.tex
+
 # (end of euptex.am)

Added: trunk/Build/source/texk/web2c/euptexdir/euptex-ctrlsym.test
===================================================================
--- trunk/Build/source/texk/web2c/euptexdir/euptex-ctrlsym.test	                        (rev 0)
+++ trunk/Build/source/texk/web2c/euptexdir/euptex-ctrlsym.test	2024-05-18 11:06:27 UTC (rev 71289)
@@ -0,0 +1,28 @@
+#! /bin/sh -vx
+# Copyright 2024 Japanese TeX Development Community <issue at texjp.org>
+# You may freely use, modify and/or distribute this file.
+
+BinDir=${BinDir:-.}
+ExeExt=${ExeExt:-}
+_euptex=$BinDir/euptex$ExeExt
+
+LC_ALL=C; export LC_ALL;  LANGUAGE=C; export LANGUAGE
+
+TEXMFCNF=$srcdir/../kpathsea;export TEXMFCNF
+TEXINPUTS=".;$srcdir/tests"; export TEXINPUTS
+TEXFORMATS=.; export TEXFORMATS
+
+# get same filename in log
+rm -f eup-ctrlsym.tex
+$LN_S $srcdir/euptexdir/tests/ctrlsym.tex ./eup-ctrlsym.tex
+
+#exit 77
+
+$_euptex -ini -etex eup-ctrlsym || exit 1
+
+$_euptex -etex -fmt=eup-ctrlsym eup-ctrlsym || exit 2
+
+sed 1d eup-ctrlsym.log >eup-ctrlsym.out
+
+diff $srcdir/euptexdir/tests/ctrlsym.log eup-ctrlsym.out || exit 3
+


Property changes on: trunk/Build/source/texk/web2c/euptexdir/euptex-ctrlsym.test
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Build/source/texk/web2c/euptexdir/tests/ctrlsym.log
===================================================================
--- trunk/Build/source/texk/web2c/euptexdir/tests/ctrlsym.log	                        (rev 0)
+++ trunk/Build/source/texk/web2c/euptexdir/tests/ctrlsym.log	2024-05-18 11:06:27 UTC (rev 71289)
@@ -0,0 +1,20 @@
+entering extended mode
+ restricted \write18 enabled.
+ %&-line parsing enabled.
+**eup-ctrlsym
+(./eup-ctrlsym.tex 
+A: 38634
+
+\雪 ->snow
+B: 38634. 雪\雪snow
+macro:->snow.
+macro:->snow.
+
+C: 127820
+
+\🍌->banana
+D: 127820. 🍌\🍌 banana
+macro:->banana.
+macro:->banana.
+ )
+No pages of output.

Added: trunk/Build/source/texk/web2c/euptexdir/tests/ctrlsym.tex
===================================================================
--- trunk/Build/source/texk/web2c/euptexdir/tests/ctrlsym.tex	                        (rev 0)
+++ trunk/Build/source/texk/web2c/euptexdir/tests/ctrlsym.tex	2024-05-18 11:06:27 UTC (rev 71289)
@@ -0,0 +1,34 @@
+% Copyright 2024 Japanese TeX Development Community <issue at texjp.org>
+% You may freely use, modify and/or distribute this file.
+%
+\ifx\fmtname\undefined
+  \input basic
+  \def\fmtname{basic}
+  \expandafter\dump
+\fi
+%==================
+\begingroup % Just there to minimize tracing output
+  \tracingmacros=2
+  \tracingonline=1
+%--
+  \newlinechar=10
+  \count255=0
+  \count255=`雪 \relax
+  \message{^^JA: \the\count255^^J}
+  \def\雪{snow}
+  \count255=`\雪 \relax
+  \message{B: \the\count255. 雪\string\雪 \雪^^J}
+  \message{\expandafter\meaning\csname 雪\endcsname.^^J}
+  \message{\expandafter\meaning\csname \Uchar"96EA\endcsname.^^J}%
+  \count4095=0
+  \count4095=`🍌 \relax
+  \message{^^JC: \the\count4095^^J}
+  \def\🍌{banana}
+  \count4095=`\🍌 \relax
+  \message{D: \the\count4095. 🍌\string\🍌 \🍌^^J}
+  \message{\expandafter\meaning\csname 🍌\endcsname.^^J}
+  \message{\expandafter\meaning\csname \Uchar"1F34C\endcsname.^^J}%
+%--
+  \setbox0=\vbox{} % no dvi/xdv/pdf output
+\endgroup
+\end

Modified: trunk/Build/source/texk/web2c/ptexdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/ptexdir/ChangeLog	2024-05-18 11:06:21 UTC (rev 71288)
+++ trunk/Build/source/texk/web2c/ptexdir/ChangeLog	2024-05-18 11:06:27 UTC (rev 71289)
@@ -1,3 +1,9 @@
+2024-05-18  Hironori Kitagawa  <h_kitagawa2001 at yahoo.co.jp>
+
+	* ptex-base.ch: Enable to get character codes
+	from control symbols by using backquote "`".
+	https://github.com/texjporg/tex-jp-build/issues/167
+
 2024-04-14  TANAKA Takuji  <ttk at t-lab.opal.ne.jp>
 
 	* ptriptest.test:

Modified: trunk/Build/source/texk/web2c/ptexdir/ptex-base.ch
===================================================================
--- trunk/Build/source/texk/web2c/ptexdir/ptex-base.ch	2024-05-18 11:06:21 UTC (rev 71288)
+++ trunk/Build/source/texk/web2c/ptexdir/ptex-base.ch	2024-05-18 11:06:27 UTC (rev 71289)
@@ -2582,14 +2582,15 @@
   end
 else if cur_tok<cs_token_flag+single_base then
   cur_val:=cur_tok-cs_token_flag-active_base
-else
-  { the token is a CS;
-    * if |kanji|<=|cur_cmd|<=|max_char_code|, then CS is let-equal to |wchar_token|
-    * if |max_char_code|<|cur_cmd|, then CS is a multibyte CS
-      => both case should raise "Improper ..." error
-    * otherwise it should be a single-character CS with |cur_val|<=255 }
-  begin if not (cur_cmd<kanji) then cur_cmd:=invalid_char;
-  cur_val:=cur_tok-cs_token_flag-single_base;
+else if cur_tok<cs_token_flag+null_cs then
+  cur_val:=cur_tok-cs_token_flag-single_base
+else { check the cs is a single Japanese character }
+  begin m:=text(cur_tok-cs_token_flag);
+    if str_start[m+1]-str_start[m]
+       = multistrlenshort(str_pool, str_start[m+1], str_start[m])
+       then
+      cur_val:=fromBUFFshort(str_pool, str_start[m+1], str_start[m])
+    else begin cur_cmd:=invalid_char; cur_val:=256; end;
   end;
 if (cur_val>255)and(cur_cmd<kanji) then
   begin print_err("Improper alphabetic or KANJI constant");

Modified: trunk/Build/source/texk/web2c/uptexdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/uptexdir/ChangeLog	2024-05-18 11:06:21 UTC (rev 71288)
+++ trunk/Build/source/texk/web2c/uptexdir/ChangeLog	2024-05-18 11:06:27 UTC (rev 71289)
@@ -1,3 +1,10 @@
+2024-05-18  Hironori Kitagawa  <h_kitagawa2001 at yahoo.co.jp>
+
+	* ptex-base.ch: Enable to get character codes
+	from control symbols by using backquote "`".
+	* tests/ctlsym_num.tex: Add a test file.
+	https://github.com/texjporg/tex-jp-build/issues/167
+
 2024-05-11  TANAKA Takuji  <ttk at t-lab.opal.ne.jp>
 
 	* uptex-m.ch: Fix unmatched begin-end grouping

Modified: trunk/Build/source/texk/web2c/uptexdir/ptex-base.ch
===================================================================
--- trunk/Build/source/texk/web2c/uptexdir/ptex-base.ch	2024-05-18 11:06:21 UTC (rev 71288)
+++ trunk/Build/source/texk/web2c/uptexdir/ptex-base.ch	2024-05-18 11:06:27 UTC (rev 71289)
@@ -2582,14 +2582,15 @@
   end
 else if cur_tok<cs_token_flag+single_base then
   cur_val:=cur_tok-cs_token_flag-active_base
-else
-  { the token is a CS;
-    * if |kanji|<=|cur_cmd|<=|max_char_code|, then CS is let-equal to |wchar_token|
-    * if |max_char_code|<|cur_cmd|, then CS is a multibyte CS
-      => both case should raise "Improper ..." error
-    * otherwise it should be a single-character CS with |cur_val|<=255 }
-  begin if not (cur_cmd<kanji) then cur_cmd:=invalid_char;
-  cur_val:=cur_tok-cs_token_flag-single_base;
+else if cur_tok<cs_token_flag+null_cs then
+  cur_val:=cur_tok-cs_token_flag-single_base
+else { check the cs is a single Japanese character }
+  begin m:=text(cur_tok-cs_token_flag);
+    if str_start[m+1]-str_start[m]
+       = multistrlenshort(str_pool, str_start[m+1], str_start[m])
+       then
+      cur_val:=fromBUFFshort(str_pool, str_start[m+1], str_start[m])
+    else begin cur_cmd:=invalid_char; cur_val:=256; end;
   end;
 if (cur_val>255)and(cur_cmd<kanji) then
   begin print_err("Improper alphabetic or KANJI constant");

Added: trunk/Build/source/texk/web2c/uptexdir/tests/ctlsym_num.tex
===================================================================
--- trunk/Build/source/texk/web2c/uptexdir/tests/ctlsym_num.tex	                        (rev 0)
+++ trunk/Build/source/texk/web2c/uptexdir/tests/ctlsym_num.tex	2024-05-18 11:06:27 UTC (rev 71289)
@@ -0,0 +1,69 @@
+% Copyright 2024 Japanese TeX Development Community <issue at texjp.org>
+% You may freely use, modify and/or distribute this file.
+%
+\scrollmode
+\newlinechar=10
+
+
+%
+% Following runs on ptex, uptex, eptex and euptex
+%
+\count255=0
+
+\count255=`♪ \relax
+\message{P: \the\count255^^J}
+
+\def\♪{baz}
+\def\雪{qux}
+
+\count255=0
+\count255=`\♪ \relax
+\message{Q: \the\count255. ♪\string\♪ \♪^^J}
+
+\count255=0
+\count255=`雪 \relax
+\message{R: \the\count255^^J}
+\count255=0
+\count255=`\雪 \relax
+\message{S: \the\count255. 雪\string\雪 \雪^^J}
+
+\message{\expandafter\meaning\csname ♪\endcsname.^^J}
+\message{\expandafter\meaning\csname 雪\endcsname.^^J}
+\ifx\Uchar\undefined\else
+\message{\expandafter\meaning\csname \Uchar\jis"2276\endcsname.^^J}
+\message{\expandafter\meaning\csname \Uchar\jis"4063\endcsname.^^J}
+\fi
+
+%
+% Following runs on euptex
+%
+\ifnum\jis"2121="3000
+\ifx\Uchar\undefined
+\else
+
+\count1000=0
+
+\def\🍌{foo}
+\def\𝕯{bar}
+\count1000=`🍌 \relax
+\message{A: \the\count1000^^J}
+\count1000=0
+\count1000=`\🍌 \relax
+\message{B: \the\count1000. 🍌\string\🍌 \🍌^^J}
+
+\count1000=0
+\count1000=`𝕯 \relax
+\message{C: \the\count1000^^J}
+\count1000=0
+\count1000=`\𝕯 \relax
+\message{D: \the\count1000. 𝕯 \string\𝕯  \𝕯^^J}
+
+\message{\expandafter\meaning\csname 🍌\endcsname.^^J}
+\message{\expandafter\meaning\csname 𝕯\endcsname.^^J}
+\message{\expandafter\meaning\csname \Uchar"1F34C\endcsname.^^J}
+\message{\expandafter\meaning\csname \Uchar"1D56F\endcsname.^^J}
+
+\fi
+\fi
+
+\bye



More information about the tex-live-commits mailing list.