texlive[60054] new cross-engine primitives \partokenname and

commits+karl at tug.org commits+karl at tug.org
Sun Jul 25 18:07:36 CEST 2021


Revision: 60054
          http://tug.org/svn/texlive?view=revision&revision=60054
Author:   karl
Date:     2021-07-25 18:07:35 +0200 (Sun, 25 Jul 2021)
Log Message:
-----------
new cross-engine primitives \partokenname and \partokencontext, from Petr Olsak

Modified Paths:
--------------
    trunk/Build/source/texk/web2c/ChangeLog
    trunk/Build/source/texk/web2c/Makefile.in
    trunk/Build/source/texk/web2c/NEWS
    trunk/Build/source/texk/web2c/enctexdir/enctex-pdftex.ch
    trunk/Build/source/texk/web2c/eptexdir/am/eptex.am
    trunk/Build/source/texk/web2c/euptexdir/am/euptex.am
    trunk/Build/source/texk/web2c/pdftexdir/am/pdftex.am
    trunk/Build/source/texk/web2c/pdftexdir/tests/cnfline.test
    trunk/Build/source/texk/web2c/ptexdir/am/ptex.am
    trunk/Build/source/texk/web2c/ptexdir/ptex-base.ch
    trunk/Build/source/texk/web2c/uptexdir/am/uptex.am
    trunk/Build/source/texk/web2c/uptexdir/uptex-m.ch
    trunk/Build/source/texk/web2c/xetexdir/am/xetex.am

Added Paths:
-----------
    trunk/Build/source/texk/web2c/partoken-102.ch
    trunk/Build/source/texk/web2c/partoken.ch
    trunk/Build/source/texk/web2c/pdftexdir/tests/partoken.test
    trunk/Build/source/texk/web2c/tests/cmr10.pfb
    trunk/Build/source/texk/web2c/tests/partoken-ok.tex
    trunk/Build/source/texk/web2c/tests/partoken-xfail.tex

Property Changed:
----------------
    trunk/Build/source/texk/web2c/ptexdir/am/ptex.am
    trunk/Build/source/texk/web2c/ptexdir/ptex-base.ch
    trunk/Build/source/texk/web2c/uptexdir/am/uptex.am
    trunk/Build/source/texk/web2c/uptexdir/uptex-m.ch

Modified: trunk/Build/source/texk/web2c/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/ChangeLog	2021-07-25 16:07:08 UTC (rev 60053)
+++ trunk/Build/source/texk/web2c/ChangeLog	2021-07-25 16:07:35 UTC (rev 60054)
@@ -1,3 +1,37 @@
+2021-07-25  Petr Olsak  <petr at olsak.net>
+	and Karl Berry  <karl at freefriends.org>
+	and Hironori Kitagawa  <h_kitagawa2001 at yahoo.co.jp>
+
+	* partoken.ch: new primitives \partokenname and \partokencontext.
+	* NEWS: mention this.
+
+	* partoken-102.ch (max_command): split off @d since different for pTeX.
+	* enctexdir/enctex-pdftex.ch: rearrange constants.
+	* uptexdir/uptex-m.ch (max_command): now partoken_name is last.
+	* ptexdir/ptex-base.ch (max_command): now partoken_name is last.
+	(insert_group, vcenter_group): remove constant lines from change
+	hunks so that partoken.ch can apply.
+
+	* eptexdir/am/eptex.am (eptex_web_srcs),
+	* euptexdir/am/euptex.am (euptex_web_srcs),
+	* ptexdir/am/ptex.am (ptex_web_srcs),
+	* uptexdir/am/uptex.am (uptex_web_srcs): include partoken.ch.
+	* xetexdir/am/xetex.am (xetex_ch_srcs),
+	* pdftexdir/am/pdftex.am (pdftex_ch_srcs): include partoken.ch
+	and partoken-102.ch.
+
+	* pdftexdir/tests/partoken.test: test it.
+	* tests/partoken-ok.tex,
+	* tests/partoken-xfail.tex: new test files.
+	* tests/cmr10.pfb: needed since the partoken test typesets text.
+	* pdftexdir/am/pdftex.am (pdftex_tests): new test.
+	(pdftexdir/tests/partoken.log): new log.
+	(EXTRA_DIST): new test files.
+	(DISTCLEANFILES): remove new log files.
+
+	* pdftexdir/tests/cnfline.test: use nonstopmode so errors are on
+	terminal, following partoken.test.
+
 2021-07-25  Karl Berry  <karl at freefriends.org>
 
 	* tex.ch: restore "strings are different" change from 2021-07-22.

Modified: trunk/Build/source/texk/web2c/Makefile.in
===================================================================
--- trunk/Build/source/texk/web2c/Makefile.in	2021-07-25 16:07:08 UTC (rev 60053)
+++ trunk/Build/source/texk/web2c/Makefile.in	2021-07-25 16:07:35 UTC (rev 60054)
@@ -3252,7 +3252,8 @@
 	$(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 $(ttf2afm_tests) \
+	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 \
@@ -3570,31 +3571,31 @@
 	pdfprimitive-euptex.* $(nodist_pdftex_SOURCES) pdftex-final.ch \
 	pdftex-web2c pdftex.p pdftex.pool pdftex-tangle pwprob.log \
 	pwprob.tex pdfimage.fmt pdfimage.log pdfimage.pdf expanded.log \
-	cnfline.log postV3.afm postV7.afm test-13.pdf test-13.xref \
-	test-15.pdf test-15.xref $(nodist_libluatex_sources) \
-	luaimage.* luajitimage.* $(nodist_xetex_SOURCES) xetex.web \
-	xetex-final.ch xetex-web2c xetex.p xetex.pool xetex-tangle \
-	bug73.fmt bug73.log bug73.out bug73.tex filedump.log \
-	filedump.out filedump.tex $(omegaware_programs:=.c) \
-	$(omegaware_programs:=.h) $(omegaware_programs:=.p) \
-	$(omegaware_programs:=-web2c) ofm2opl.web opl2ofm.web \
-	ovf2ovp.web ovp2ovf.web omegaware/bad*.* \
-	omegaware/tests/charwdr.* omegaware/tests/charwdv.* \
-	omegaware/tests/xcheck* omegaware/tests/xlevel1.* \
-	omegaware/tests/xlig*.* ofont*vf omegaware/tests/xpagenum.* \
-	omegaware/tests/xofont* omegaware/tests/Cherokee.tfm \
-	omegaware/tests/OCherokee.ofm omegaware/tests/OCherokee.opl \
-	omegaware/tests/OCherokee.ovf omegaware/tests/xCherokee.* \
-	omegaware/tests/xOCherokee.* ocftest.* omegaware/tests/xinbmp* \
-	omegaware/tests/xoverbmp* omegaware/tests/xrealnum.* \
-	omegaware/tests/xrepeated.* omegaware/tests/sample*.ofm \
-	omegaware/tests/sample*.ovf omegaware/tests/sample1-h.opl \
-	omegaware/tests/xsample*.out omegaware/tests/shortend.* \
-	omegaware/tests/specialhex.ofm omegaware/tests/specialhex.opl \
-	omegaware/tests/specialhex.ovf omegaware/tests/xspecialhex.* \
-	omegaware/tests/yrepeat* omegaware/tests/*yarabic* \
-	$(nodist_aleph_SOURCES) aleph.web aleph.ch aleph-web2c aleph.p \
-	aleph.pool aleph-tangle
+	cnfline.log partoken-ok.log partoken-xfail.log postV3.afm \
+	postV7.afm test-13.pdf test-13.xref test-15.pdf test-15.xref \
+	$(nodist_libluatex_sources) luaimage.* luajitimage.* \
+	$(nodist_xetex_SOURCES) xetex.web xetex-final.ch xetex-web2c \
+	xetex.p xetex.pool xetex-tangle bug73.fmt bug73.log bug73.out \
+	bug73.tex filedump.log filedump.out filedump.tex \
+	$(omegaware_programs:=.c) $(omegaware_programs:=.h) \
+	$(omegaware_programs:=.p) $(omegaware_programs:=-web2c) \
+	ofm2opl.web opl2ofm.web ovf2ovp.web ovp2ovf.web \
+	omegaware/bad*.* omegaware/tests/charwdr.* \
+	omegaware/tests/charwdv.* omegaware/tests/xcheck* \
+	omegaware/tests/xlevel1.* omegaware/tests/xlig*.* ofont*vf \
+	omegaware/tests/xpagenum.* omegaware/tests/xofont* \
+	omegaware/tests/Cherokee.tfm omegaware/tests/OCherokee.ofm \
+	omegaware/tests/OCherokee.opl omegaware/tests/OCherokee.ovf \
+	omegaware/tests/xCherokee.* omegaware/tests/xOCherokee.* \
+	ocftest.* omegaware/tests/xinbmp* omegaware/tests/xoverbmp* \
+	omegaware/tests/xrealnum.* omegaware/tests/xrepeated.* \
+	omegaware/tests/sample*.ofm omegaware/tests/sample*.ovf \
+	omegaware/tests/sample1-h.opl omegaware/tests/xsample*.out \
+	omegaware/tests/shortend.* omegaware/tests/specialhex.ofm \
+	omegaware/tests/specialhex.opl omegaware/tests/specialhex.ovf \
+	omegaware/tests/xspecialhex.* omegaware/tests/yrepeat* \
+	omegaware/tests/*yarabic* $(nodist_aleph_SOURCES) aleph.web \
+	aleph.ch aleph-web2c aleph.p aleph.pool aleph-tangle
 CLEANFILES = $(EXTRA_PROGRAMS) $(EXTRA_LIBRARIES) $(EXTRA_LTLIBRARIES)
 TRIPTRAP_CLEAN = $(am__append_8) $(am__append_18) $(am__append_27) \
 	$(am__append_36) $(am__append_44) $(am__append_60) \
@@ -4308,6 +4309,7 @@
 	tex.web \
 	tex.ch \
 	tracingstacklevels.ch \
+	partoken.ch \
 	zlib-fmt.ch
 
 ptex_ch_srcs = \
@@ -4368,6 +4370,7 @@
 	etexdir/tex.ch0 \
 	tex.ch \
 	tracingstacklevels.ch \
+	partoken.ch \
 	zlib-fmt.ch \
 	etexdir/tex.ech
 
@@ -4413,6 +4416,7 @@
 	tex.web \
 	tex.ch \
 	tracingstacklevels.ch \
+	partoken.ch \
 	zlib-fmt.ch
 
 uptex_ch_srcs = \
@@ -4478,6 +4482,7 @@
 	etexdir/tex.ch0 \
 	tex.ch \
 	tracingstacklevels.ch \
+	partoken.ch \
 	zlib-fmt.ch \
 	etexdir/tex.ech
 
@@ -4549,6 +4554,8 @@
 	pdftexdir/tex.ch0 \
 	tex.ch \
 	tracingstacklevels.ch \
+	partoken-102.ch \
+	partoken.ch \
 	zlib-fmt.ch \
 	enctexdir/enctex1.ch \
 	enctexdir/enctex-pdftex.ch \
@@ -4563,7 +4570,7 @@
 #
 pdftex_tests = pdftexdir/wprob.test pdftexdir/pdftex.test \
   pdftexdir/pdfimage.test pdftexdir/expanded.test \
-  pdftexdir/tests/cnfline.test
+  pdftexdir/tests/cnfline.test pdftexdir/tests/partoken.test
 
 ttf2afm_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/pdftexdir
 ttf2afm_SOURCES = pdftexdir/ttf2afm.c
@@ -5241,6 +5248,8 @@
 	xetexdir/tex.ch0 \
 	tex.ch \
 	tracingstacklevels.ch \
+	partoken-102.ch \
+	partoken.ch \
 	$(xetex_ch_synctex) \
 	xetexdir/xetex.ch \
 	$(xetex_post_ch_synctex) \
@@ -21828,7 +21837,7 @@
 
 pdftexdir/wprob.log pdftexdir/pdftex.log \
   pdftexdir/pdfimage.log pdftexdir/expanded.log \
-  pdftexdir/cnfline.log: pdftex$(EXEEXT)
+  pdftexdir/tests/cnfline.log pdftexdir/tests/partoken.log: pdftex$(EXEEXT)
 pdftexdir/ttf2afm.log: ttf2afm$(EXEEXT)
 
 $(pdftosrc_OBJECTS): $(ZLIB_DEPEND) $(LIBPNG_DEPEND) $(XPDF_DEPEND)

Modified: trunk/Build/source/texk/web2c/NEWS
===================================================================
--- trunk/Build/source/texk/web2c/NEWS	2021-07-25 16:07:08 UTC (rev 60053)
+++ trunk/Build/source/texk/web2c/NEWS	2021-07-25 16:07:35 UTC (rev 60054)
@@ -1,5 +1,10 @@
 This file records noteworthy changes.  (Public domain.)
 
+* for all engines except original TeX:
+- new primitives \partokenname and \partokencontext allow overriding the
+  name of the internally-emitted \par token at blank lines, the end of
+  vboxes, etc.
+
 

 2021 (for TeX Live 2021, 23 March 2021)
 * Knuth 2021 tune-up, with fixes to all of his *.web files. Overview:

Modified: trunk/Build/source/texk/web2c/enctexdir/enctex-pdftex.ch
===================================================================
--- trunk/Build/source/texk/web2c/enctexdir/enctex-pdftex.ch	2021-07-25 16:07:08 UTC (rev 60053)
+++ trunk/Build/source/texk/web2c/enctexdir/enctex-pdftex.ch	2021-07-25 16:07:35 UTC (rev 60054)
@@ -1,16 +1,16 @@
 % $Id$
 % enctex1.ch is applied first.
 % Then this change is applied for pdfTeX et al.,
-% assuming that tracingstacklevels.ch has been included,
+% assuming that tracingstacklevels.ch plus partoken.ch has been included,
 % as specified in the *.am files.
 
 % encTeX: \mubytein \mubyteout \mubytelog and \specialout
 @x [17.236] l.4954
- at d web2c_int_pars=web2c_int_base+4 {total number of web2c's integer parameters}
+ at d web2c_int_pars=web2c_int_base+5 {total number of web2c's integer parameters}
 @y
- at d mubyte_in_code=web2c_int_base+4{if positive then reading mubytes is active}
- at d mubyte_out_code=web2c_int_base+5{if positive then printing mubytes is active}
- at d mubyte_log_code=web2c_int_base+6{if positive then print mubytes to log and terminal}
- at d spec_out_code=web2c_int_base+7 {if positive then print specials by mubytes}
- at d web2c_int_pars=web2c_int_base+8 {total number of web2c's integer parameters}
+ at d mubyte_in_code=web2c_int_base+5{if positive then reading mubytes is active}
+ at d mubyte_out_code=web2c_int_base+6{if positive then printing mubytes is active}
+ at d mubyte_log_code=web2c_int_base+7{if positive then print mubytes to log and terminal}
+ at d spec_out_code=web2c_int_base+8 {if positive then print specials by mubytes}
+ at d web2c_int_pars=web2c_int_base+9 {total number of web2c's integer parameters}
 @z

Modified: trunk/Build/source/texk/web2c/eptexdir/am/eptex.am
===================================================================
--- trunk/Build/source/texk/web2c/eptexdir/am/eptex.am	2021-07-25 16:07:08 UTC (rev 60053)
+++ trunk/Build/source/texk/web2c/eptexdir/am/eptex.am	2021-07-25 16:07:35 UTC (rev 60054)
@@ -55,6 +55,7 @@
 	etexdir/tex.ch0 \
 	tex.ch \
 	tracingstacklevels.ch \
+	partoken.ch \
 	zlib-fmt.ch \
 	etexdir/tex.ech
 

Modified: trunk/Build/source/texk/web2c/euptexdir/am/euptex.am
===================================================================
--- trunk/Build/source/texk/web2c/euptexdir/am/euptex.am	2021-07-25 16:07:08 UTC (rev 60053)
+++ trunk/Build/source/texk/web2c/euptexdir/am/euptex.am	2021-07-25 16:07:35 UTC (rev 60054)
@@ -51,6 +51,7 @@
 	etexdir/tex.ch0 \
 	tex.ch \
 	tracingstacklevels.ch \
+	partoken.ch \
 	zlib-fmt.ch \
 	etexdir/tex.ech
 

Added: trunk/Build/source/texk/web2c/partoken-102.ch
===================================================================
--- trunk/Build/source/texk/web2c/partoken-102.ch	                        (rev 0)
+++ trunk/Build/source/texk/web2c/partoken-102.ch	2021-07-25 16:07:35 UTC (rev 60054)
@@ -0,0 +1,14 @@
+% $Id$
+% Public domain. See partoken.ch (and pdfTeX manual) for main information.
+
+% New internal constant for the main command |\partokenname|.
+% This redefinition of max_command varies, but the rest of the change
+% file works across all engines, so separate it out. This version is
+% used for pdftex and xetex. For the pTeX family, the max_command update
+% is done in the main change files (ptex-base.ch and uptex-m.ch).
+ at x
+ at d max_command=102 {the largest command code seen at |big_switch|}
+ at y
+ at d partoken_name=103 {set |par_token| name}
+ at d max_command=103 {the largest command code seen at |big_switch|}
+ at z


Property changes on: trunk/Build/source/texk/web2c/partoken-102.ch
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Date Author Id Revision
\ No newline at end of property
Added: trunk/Build/source/texk/web2c/partoken.ch
===================================================================
--- trunk/Build/source/texk/web2c/partoken.ch	                        (rev 0)
+++ trunk/Build/source/texk/web2c/partoken.ch	2021-07-25 16:07:35 UTC (rev 60054)
@@ -0,0 +1,175 @@
+% $Id$
+% Implementation of |\partokenname| and |\partokencontext| primitives.
+% Public domain. Originally written by Petr Olsak, 2021.
+
+% TeX inserts (let's say) "par-token" at empty lines and in other situations.
+% The primitive meaning of "par-token" is (let's say) "end-paragraph",
+%   but it can be changed by the macro programmer (by |\def\par|, for example).
+% The name of the auto-emitted "par-token" is fixed as |\par| in
+%   classical TeX. 
+% The new |\partokenname| primitive defined here allows changing this cs name.
+% After |\partokenname <control-sequence>| is given, the specified
+%   <control-sequence> will be emitted at empty lines, etc., not |\par|. 
+% Moreover, the given <control-sequence> plays the role of |\par| when
+%   processing not-\long macros ("runaway error").
+% The setting of |\partokenname| is global.
+%
+% The integer register |\partokencontext| allows controlling the places where
+% "par-token" is auto-emitted. The value of |\partokencontext| can be:
+%   0 ... "par-token" is emitted as in classical TeX, i.e. at empty lines,
+%         before \end, \vskip, \hrule, \unvbox, and \halign (if horizontal mode
+%         is current) and in several error recovery situations.
+%         This is the default value.
+%   1 ... "par-token" is emitted as before and at the end of \vbox,
+%         \vtop, and \vcenter if horizontal mode is current here.
+%   2 ... "par-token" is emitted as before and at the end of \noalign,
+%         \vadjust, \output, \insert, and \valign items, if horizontal
+%         mode is current here.
+% Classical TeX does a direct call of the "end-paragraph" routine at the
+% places mentioned in cases 1 and 2.
+% 
+% See the user documentation in the pdftex manual for more,
+% the tests/partoken-test.tex file for basic examples,
+% and the OpTeX format (eventually) for the practical case inspiring
+% this idea.
+
+% New internal constant for integer register |\partokencontext|
+ at x
+ at d web2c_int_pars=web2c_int_base+4 {total number of web2c's integer parameters}
+ at y
+ at d partoken_context_code=web2c_int_base+4 {controlling where |partoken| inserted}
+ at d web2c_int_pars=web2c_int_base+5 {total number of web2c's integer parameters}
+ at z
+
+% Allocation of integer register |\partokencontext|
+ at x
+ at d tracing_stack_levels==int_par(tracing_stack_levels_code)
+ at y
+ at d tracing_stack_levels==int_par(tracing_stack_levels_code)
+ at d partoken_context==int_par(partoken_context_code)
+ at z
+
+% Printing |\show\partokencontext|
+ at x
+tracing_stack_levels_code:print_esc("tracingstacklevels");
+ at y
+tracing_stack_levels_code:print_esc("tracingstacklevels");
+partoken_context_code:print_esc("partokencontext");
+ at z
+
+% Declaration of primitives |\patokenname| and |\partokencontext|
+ at x
+  primitive("tracingstacklevels",assign_int,int_base+tracing_stack_levels_code);@/
+@!@:tracing_stack_levels_}{\.{\\tracingstacklevels} primitive@>
+ at y
+  primitive("tracingstacklevels",assign_int,int_base+tracing_stack_levels_code);@/
+@!@:tracing_stack_levels_}{\.{\\tracingstacklevels} primitive@>
+  primitive("partokenname",partoken_name,0);@/
+@!@:partoken_name_}{\.{\\partokenname} primitive@>
+  primitive("partokencontext",assign_int,int_base+partoken_context_code);@/
+@!@:partoken_context_}{\.{\\partokencontext} primitive@>
+ at z
+
+% Printing |\show\partokenname|
+ at x
+vrule: print_esc("vrule");
+ at y
+vrule: print_esc("vrule");
+partoken_name: print_esc("partokenname");
+ at z
+
+% End of |\vbox| and |\vtop|
+ at x
+vbox_group: begin end_graf; package(0);
+  end;
+vtop_group: begin end_graf; package(vtop_code);
+  end;
+ at y
+vbox_group: if (partoken_context>0) and (mode=hmode) then 
+  begin
+     back_input; cur_tok := par_token; back_input; token_type := inserted;
+  end
+  else  begin end_graf; package(0); end;
+vtop_group: if (partoken_context>0) and (mode=hmode) then
+  begin
+     back_input; cur_tok := par_token; back_input; token_type := inserted;
+  end 
+  else begin end_graf; package(vtop_code); end;
+ at z
+
+% End of |\insert| or |\vadjust|
+ at x
+insert_group: begin end_graf; q:=split_top_skip; add_glue_ref(q);
+ at y
+insert_group: if (partoken_context>1) and (mode=hmode) then
+  begin
+     back_input; cur_tok := par_token; back_input; token_type := inserted;
+  end 
+  else begin end_graf; q:=split_top_skip; add_glue_ref(q);
+ at z
+
+% End of |\output|
+ at x
+output_group: @<Resume the page builder...@>;
+ at y
+output_group: if (partoken_context>1) and (mode=hmode) then
+  begin
+     back_input; cur_tok := par_token; back_input; token_type := inserted;
+  end 
+  else @<Resume the page builder...@>;
+ at z
+
+% End of item in |\valign|
+ at x
+vmode+endv,hmode+endv: do_endv;
+ at y
+vmode+endv,hmode+endv: if (partoken_context>1) and (mode=hmode) then
+  begin
+     back_input; cur_tok := par_token; back_input; token_type := inserted;
+  end
+  else do_endv;
+ at z
+
+% End of |\noalign| in |\halign|
+ at x
+no_align_group: begin end_graf; unsave; align_peek;
+  end;
+ at y
+no_align_group: if (partoken_context>1) and (mode=hmode) then
+  begin
+     back_input; cur_tok := par_token; back_input; token_type := inserted;
+  end 
+  else begin end_graf; unsave; align_peek;
+  end;
+ at z
+
+% End of |\vcenter|
+ at x
+vcenter_group: begin end_graf; unsave; save_ptr:=save_ptr-2;
+ at y
+vcenter_group: if (partoken_context>0) and (mode=hmode) then 
+  begin
+     back_input; cur_tok := par_token; back_input; token_type := inserted;
+  end else begin end_graf; unsave; save_ptr:=save_ptr-2;
+ at z
+
+% Setting new name of the |par-token|
+ at x
+any_mode(after_group):begin get_token; save_for_after(cur_tok);
+  end;
+ at y
+any_mode(after_group):begin get_token; save_for_after(cur_tok);
+  end;
+any_mode(partoken_name):begin get_token;
+  if cur_cs > 0 then begin
+     par_loc := cur_cs; par_token := cur_tok;
+     end; 
+  end;
+ at z
+
+% Undump |par-token| from the format
+ at x
+undump(hash_base)(hash_top)(par_loc);
+ at y
+undump_int(par_loc);
+ at z


Property changes on: trunk/Build/source/texk/web2c/partoken.ch
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Date Author Id Revision
\ No newline at end of property
Modified: trunk/Build/source/texk/web2c/pdftexdir/am/pdftex.am
===================================================================
--- trunk/Build/source/texk/web2c/pdftexdir/am/pdftex.am	2021-07-25 16:07:08 UTC (rev 60053)
+++ trunk/Build/source/texk/web2c/pdftexdir/am/pdftex.am	2021-07-25 16:07:35 UTC (rev 60054)
@@ -71,6 +71,8 @@
 	pdftexdir/tex.ch0 \
 	tex.ch \
 	tracingstacklevels.ch \
+	partoken-102.ch \
+	partoken.ch \
 	zlib-fmt.ch \
 	enctexdir/enctex1.ch \
 	enctexdir/enctex-pdftex.ch \
@@ -102,11 +104,11 @@
 #
 pdftex_tests = pdftexdir/wprob.test pdftexdir/pdftex.test \
   pdftexdir/pdfimage.test pdftexdir/expanded.test \
-  pdftexdir/tests/cnfline.test
+  pdftexdir/tests/cnfline.test pdftexdir/tests/partoken.test
 
 pdftexdir/wprob.log pdftexdir/pdftex.log \
   pdftexdir/pdfimage.log pdftexdir/expanded.log \
-  pdftexdir/cnfline.log: pdftex$(EXEEXT)
+  pdftexdir/tests/cnfline.log pdftexdir/tests/partoken.log: pdftex$(EXEEXT)
 
 EXTRA_DIST += $(pdftex_tests)
 
@@ -130,3 +132,7 @@
 ## cnfline.test
 EXTRA_DIST += tests/cnfline.tex
 DISTCLEANFILES += cnfline.log
+
+## partoken.test
+EXTRA_DIST += tests/partoken-ok.tex tests/partoken-xfail.tex
+DISTCLEANFILES += partoken-ok.log partoken-xfail.log

Modified: trunk/Build/source/texk/web2c/pdftexdir/tests/cnfline.test
===================================================================
--- trunk/Build/source/texk/web2c/pdftexdir/tests/cnfline.test	2021-07-25 16:07:08 UTC (rev 60053)
+++ trunk/Build/source/texk/web2c/pdftexdir/tests/cnfline.test	2021-07-25 16:07:35 UTC (rev 60054)
@@ -8,7 +8,7 @@
 TEXMFCNF=$srcdir/../kpathsea; export TEXMFCNF
 TEXINPUTS=$srcdir/pdftexdir/tests; export TEXINPUTS
 
-./pdftex -ini --interaction=batchmode \
+./pdftex -ini --interaction=nonstopmode \
   --cnf-line=max_print_line=500 cnfline.tex || exit $?
 
 if grep 'those hyphens are' cnfline.log >/dev/null; then

Added: trunk/Build/source/texk/web2c/pdftexdir/tests/partoken.test
===================================================================
--- trunk/Build/source/texk/web2c/pdftexdir/tests/partoken.test	                        (rev 0)
+++ trunk/Build/source/texk/web2c/pdftexdir/tests/partoken.test	2021-07-25 16:07:35 UTC (rev 60054)
@@ -0,0 +1,25 @@
+#! /bin/sh -vx
+# $Id$
+# Public domain. Originally written by Karl Berry, 2021.
+# Check for new \partokenname primitives.
+
+LC_ALL=C; export LC_ALL;  LANGUAGE=C; export LANGUAGE
+
+# running in Build/source/Work/texk/web2c
+# srcdir  is Build/source/texk/web2c
+: ${srcdir=../../../texk/web2c}
+TEXMFCNF=$srcdir/../kpathsea; export TEXMFCNF
+TEXMFDOTDIR=$srcdir/tests; export TEXMFDOTDIR # both fonts and inputs
+
+: ${testengine=pdftex}
+
+# should succeed. nonstopmode instead of batchmode so normal errors are
+# printed on the terminal, and thus show up in test-suite.log.
+if ./$testengine -ini --interaction=nonstopmode partoken-ok.tex; then :; else
+  exit 1; fi
+
+# should fail
+if ./$testengine -ini --interaction=nonstopmode partoken-xfail.tex; then
+  exit 1; fi
+
+exit 0


Property changes on: trunk/Build/source/texk/web2c/pdftexdir/tests/partoken.test
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Date Author Id Revision
\ No newline at end of property
Modified: trunk/Build/source/texk/web2c/ptexdir/am/ptex.am
===================================================================
--- trunk/Build/source/texk/web2c/ptexdir/am/ptex.am	2021-07-25 16:07:08 UTC (rev 60053)
+++ trunk/Build/source/texk/web2c/ptexdir/am/ptex.am	2021-07-25 16:07:35 UTC (rev 60054)
@@ -1,3 +1,4 @@
+## $Id$
 ## texk/web2c/ptexdir/am/ptex.am: Makefile fragment for pTeX.
 ##
 ## Copyright 2015-2021 Karl Berry <tex-live at tug.org>
@@ -75,6 +76,7 @@
 	tex.web \
 	tex.ch \
 	tracingstacklevels.ch \
+	partoken.ch \
 	zlib-fmt.ch
 
 # Generate ptex.ch


Property changes on: trunk/Build/source/texk/web2c/ptexdir/am/ptex.am
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Date Author Id Revision
\ No newline at end of property
Modified: trunk/Build/source/texk/web2c/ptexdir/ptex-base.ch
===================================================================
--- trunk/Build/source/texk/web2c/ptexdir/ptex-base.ch	2021-07-25 16:07:08 UTC (rev 60053)
+++ trunk/Build/source/texk/web2c/ptexdir/ptex-base.ch	2021-07-25 16:07:35 UTC (rev 60054)
@@ -1,3 +1,4 @@
+% $Id$
 % This is a change file for pTeX
 % By Sadayuki Tanaka and ASCII MEDIA WORKS.
 %
@@ -1009,7 +1010,8 @@
 @d set_interaction=hyph_data+1 {define level of interaction ( \.{\\batchmode}, etc.~)}
 @d set_auto_spacing=set_interaction+1 {set auto spacing mode
   ( \.{\\autospacing}, \.{\\noautospacing}, \.{\\autoxspacing}, \.{\\noautoxspacing} )}
- at d max_command=set_auto_spacing {the largest command code seen at |big_switch|}
+ at d partoken_name=set_auto_spacing+1 {set |par_token| name}
+ at d max_command=partoken_name {the largest command code seen at |big_switch|}
 @z
 
 @x [16.212] l.4437 - pTeX: last_jchr, direction, adjust direction
@@ -5340,8 +5342,6 @@
 @z
 
 @x [47.1100] l.21189 - pTeX: free box node, ins_dir
-insert_group: begin end_graf; q:=split_top_skip; add_glue_ref(q);
-  d:=split_max_depth; f:=floating_penalty; unsave; decr(save_ptr);
   {now |saved(0)| is the insertion number, or 255 for |vadjust|}
   p:=vpack(link(head),natural); pop_nest;
   if saved(0)<255 then
@@ -5359,8 +5359,6 @@
   if nest_ptr=0 then build_page;
   end;
 @y
-insert_group: begin end_graf; q:=split_top_skip; add_glue_ref(q);
-  d:=split_max_depth; f:=floating_penalty; unsave; decr(save_ptr);
   {now |saved(0)| is the insertion number, or 255 for |vadjust|}
   p:=vpack(link(head),natural); set_box_dir(p)(direction); pop_nest;
   if saved(0)<255 then
@@ -5938,13 +5936,11 @@
 @z
 
 @x [48.1164] l.22790 - pTeX: vcenter : dir
-vcenter_group: begin end_graf; unsave; save_ptr:=save_ptr-2;
   p:=vpack(link(head),saved(1),saved(0)); pop_nest;
   tail_append(new_noad); type(tail):=vcenter_noad;
   math_type(nucleus(tail)):=sub_box; info(nucleus(tail)):=p;
   end;
 @y
-vcenter_group: begin end_graf; unsave; save_ptr:=save_ptr-2;
   p:=vpack(link(head),saved(1),saved(0));
   set_box_dir(p)(direction); pop_nest;
   if abs(box_dir(p))<>abs(direction) then p:=new_dir_node(p,abs(direction));


Property changes on: trunk/Build/source/texk/web2c/ptexdir/ptex-base.ch
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Date Author Id Revision
\ No newline at end of property
Added: trunk/Build/source/texk/web2c/tests/cmr10.pfb
===================================================================
(Binary files differ)

Index: trunk/Build/source/texk/web2c/tests/cmr10.pfb
===================================================================
--- trunk/Build/source/texk/web2c/tests/cmr10.pfb	2021-07-25 16:07:08 UTC (rev 60053)
+++ trunk/Build/source/texk/web2c/tests/cmr10.pfb	2021-07-25 16:07:35 UTC (rev 60054)

Property changes on: trunk/Build/source/texk/web2c/tests/cmr10.pfb
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: trunk/Build/source/texk/web2c/tests/partoken-ok.tex
===================================================================
--- trunk/Build/source/texk/web2c/tests/partoken-ok.tex	                        (rev 0)
+++ trunk/Build/source/texk/web2c/tests/partoken-ok.tex	2021-07-25 16:07:35 UTC (rev 60054)
@@ -0,0 +1,48 @@
+% $Id$
+% Public domain. Originally written by Petr Olsak, 2021.
+% Testing \partokenname and \partokencontext primitives: successful tests.
+% 
+% We want to test in iniTeX state, use "pdftex -ini partoken-test.tex" 
+% Generating dvi output.
+%
+\catcode`\{=1 \catcode`\}=2 \catcode`\#=6
+\hsize=4in \vsize=4in \baselineskip=12pt
+\font\f=cmr10 \f % we want to typeset some text
+
+% Seting different partoken name
+\catcode`\_=11
+\partokenname \_par
+\let \_par = \par
+\def\par{hello}
+% This empty line emits \_par (i.e., no output), no "hello":
+
+% Not-\long macro accepts \par in its argument, but does not accept \_par
+% (emitted here from blank line):
+\def\macro#1{}
+\macro{long test: \par} % without error
+% see partoken-xfail.tex for failing test.
+%
+\let \_endgraf=\_par
+\def \_par{PAR-TOKEN\_endgraf}
+% This empty line prints PAR-TOKEN (plus underfull \hbox
+%   due to \parfillskip=0pt):
+
+% This \vskip prints Test PAR-TOKEN (plus underfull \hbox warning):
+Test \vskip1pt \relax
+%
+% This end-of-\vbox prints 0: Test text. (standard behavior):
+\vbox{\the\partokencontext: Test text.}
+%
+\partokencontext=1
+% This prints 1: Test text.PAR-TOKEN (\_par called at end of \vbox):
+\vbox{\the\partokencontext: Test text.}
+%
+% This prints 1: no-align text (standard behavior):
+\halign{#\cr \noalign{\the\partokencontext: no-align text}}
+%
+\partokencontext=2
+% This prints: 2: no-align textPAR-TOKEN (\_par called at end of \noalign):
+\halign{#\cr \noalign{\the\partokencontext: no-align text}}
+%
+% no blank line to elide final PAR-TOKEN.
+\end


Property changes on: trunk/Build/source/texk/web2c/tests/partoken-ok.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Date Author Id Revision
\ No newline at end of property
Added: trunk/Build/source/texk/web2c/tests/partoken-xfail.tex
===================================================================
--- trunk/Build/source/texk/web2c/tests/partoken-xfail.tex	                        (rev 0)
+++ trunk/Build/source/texk/web2c/tests/partoken-xfail.tex	2021-07-25 16:07:35 UTC (rev 60054)
@@ -0,0 +1,31 @@
+% $Id$
+% Public domain. Originally written by Petr Olsak, 2021.
+% Testing \partokenname and \partokencontext primitives: an expected failure.
+% 
+% We want to test in iniTeX state, use "pdftex -ini partoken-test.tex" 
+%
+\catcode`\{=1 \catcode`\}=2 \catcode`\#=6
+\hsize=4in \vsize=4in \baselineskip=12pt
+\font\f=cmr10 \f
+\nonstopmode
+
+% Seting different partoken name
+\catcode`\_=11
+\let \_par = \par
+\partokenname \_par
+\def\par{hello}
+
+% Not-\long macro does not accept \_par
+% (emitted here from blank line):
+\def\macro#1{}
+% see partoken-ok.tex for successful test.
+\macro{failing long test:
+
+} % generates error: 
+% ! Paragraph ended before \macro was complete.
+% <to be read again> 
+%                    \_par 
+% l.20
+% plus dependent error: Too many }'s.
+
+\end


Property changes on: trunk/Build/source/texk/web2c/tests/partoken-xfail.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Date Author Id Revision
\ No newline at end of property
Modified: trunk/Build/source/texk/web2c/uptexdir/am/uptex.am
===================================================================
--- trunk/Build/source/texk/web2c/uptexdir/am/uptex.am	2021-07-25 16:07:08 UTC (rev 60053)
+++ trunk/Build/source/texk/web2c/uptexdir/am/uptex.am	2021-07-25 16:07:35 UTC (rev 60054)
@@ -1,3 +1,4 @@
+## $Id$
 ## texk/web2c/uptexdir/am/uptex.am: Makefile fragment for upTeX.
 ##
 ## Copyright 2016-2021 Karl Berry <tex-live at tug.org>
@@ -68,6 +69,7 @@
 	tex.web \
 	tex.ch \
 	tracingstacklevels.ch \
+	partoken.ch \
 	zlib-fmt.ch
 
 # Generate uptex.ch


Property changes on: trunk/Build/source/texk/web2c/uptexdir/am/uptex.am
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Date Author Id Revision
\ No newline at end of property
Modified: trunk/Build/source/texk/web2c/uptexdir/uptex-m.ch
===================================================================
--- trunk/Build/source/texk/web2c/uptexdir/uptex-m.ch	2021-07-25 16:07:08 UTC (rev 60053)
+++ trunk/Build/source/texk/web2c/uptexdir/uptex-m.ch	2021-07-25 16:07:35 UTC (rev 60054)
@@ -1,3 +1,4 @@
+% $Id$
 % This is a change file for upTeX u1.27
 % By Takuji Tanaka.
 %
@@ -184,9 +185,9 @@
 @z
 
 @x
- at d max_command=set_auto_spacing {the largest command code seen at |big_switch|}
+ at d max_command=partoken_name {the largest command code seen at |big_switch|}
 @y
- at d set_enable_cjk_token=set_auto_spacing+1 {set cjk mode ( \.{\\enablecjktoken}, \.{\\disablecjktoken}, \.{\\forcecjktoken} )}
+ at d set_enable_cjk_token=partoken_name+1 {set cjk mode ( \.{\\enablecjktoken}, \.{\\disablecjktoken}, \.{\\forcecjktoken} )}
 @d max_command=set_enable_cjk_token {the largest command code seen at |big_switch|}
 @z
 


Property changes on: trunk/Build/source/texk/web2c/uptexdir/uptex-m.ch
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Date Author Id Revision
\ No newline at end of property
Modified: trunk/Build/source/texk/web2c/xetexdir/am/xetex.am
===================================================================
--- trunk/Build/source/texk/web2c/xetexdir/am/xetex.am	2021-07-25 16:07:08 UTC (rev 60053)
+++ trunk/Build/source/texk/web2c/xetexdir/am/xetex.am	2021-07-25 16:07:35 UTC (rev 60054)
@@ -114,6 +114,8 @@
 	xetexdir/tex.ch0 \
 	tex.ch \
 	tracingstacklevels.ch \
+	partoken-102.ch \
+	partoken.ch \
 	$(xetex_ch_synctex) \
 	xetexdir/xetex.ch \
 	$(xetex_post_ch_synctex) \



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