summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/web2c')
-rw-r--r--Build/source/texk/web2c/ChangeLog28
-rw-r--r--Build/source/texk/web2c/Makefile.in90
-rw-r--r--Build/source/texk/web2c/ctiedir/ctie-k.ch123
-rw-r--r--Build/source/texk/web2c/cwebdir/ChangeLog41
-rw-r--r--Build/source/texk/web2c/cwebdir/comm-mini.ch2
-rw-r--r--Build/source/texk/web2c/cwebdir/comm-w2c.ch134
-rw-r--r--Build/source/texk/web2c/cwebdir/ctang-w2c.ch96
-rw-r--r--Build/source/texk/web2c/cwebdir/ctwill-w2c.ch276
-rw-r--r--Build/source/texk/web2c/cwebdir/cweav-w2c.ch146
-rw-r--r--Build/source/texk/web2c/cwebdir/cwebacromac.tex15
-rw-r--r--Build/source/texk/web2c/cwebdir/cwebmac.tex16
-rw-r--r--Build/source/texk/web2c/cwebdir/texinputs/dcwebmac.tex5
-rw-r--r--Build/source/texk/web2c/cwebdir/texinputs/fcwebmac.tex5
-rw-r--r--Build/source/texk/web2c/cwebdir/texinputs/icwebmac.tex5
-rw-r--r--Build/source/texk/web2c/cwebdir/texinputs/pdfctproofmac.tex12
-rw-r--r--Build/source/texk/web2c/cwebdir/texinputs/pdfctwimac.tex10
-rw-r--r--Build/source/texk/web2c/cwebdir/texinputs/pdfwebtocfront.tex37
-rw-r--r--Build/source/texk/web2c/dvicopy.ch8
-rw-r--r--Build/source/texk/web2c/euptexdir/ChangeLog21
-rw-r--r--Build/source/texk/web2c/euptexdir/am/euptex.am8
-rwxr-xr-xBuild/source/texk/web2c/euptexdir/euptex-ctrlsym.test28
-rw-r--r--Build/source/texk/web2c/euptexdir/pdfutils.ch15
-rw-r--r--Build/source/texk/web2c/euptexdir/suppresserrors.ch12
-rw-r--r--Build/source/texk/web2c/euptexdir/tests/ctrlsym.log20
-rw-r--r--Build/source/texk/web2c/euptexdir/tests/ctrlsym.tex34
-rw-r--r--Build/source/texk/web2c/euptexdir/unbalanced-braces-eptex.ch4
-rw-r--r--Build/source/texk/web2c/gftodvi.ch4
-rw-r--r--Build/source/texk/web2c/gftopk.ch30
-rw-r--r--Build/source/texk/web2c/gftype.ch8
-rw-r--r--Build/source/texk/web2c/hitexdir/hitex.w685
-rw-r--r--Build/source/texk/web2c/luatexdir/ChangeLog19
-rw-r--r--Build/source/texk/web2c/luatexdir/image/epdf.h2
-rw-r--r--Build/source/texk/web2c/luatexdir/image/pdftoepdf.c7
-rw-r--r--Build/source/texk/web2c/luatexdir/image/writeimg.c2
-rw-r--r--Build/source/texk/web2c/luatexdir/image/writeimg.h2
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/lpdflib.c33
-rw-r--r--Build/source/texk/web2c/luatexdir/luatex.c4
-rw-r--r--Build/source/texk/web2c/luatexdir/luatex_svnversion.h2
-rw-r--r--Build/source/texk/web2c/luatexdir/pdf/pdfgen.c9
-rw-r--r--Build/source/texk/web2c/luatexdir/pdf/pdfgen.h3
-rw-r--r--Build/source/texk/web2c/luatexdir/pdf/pdflink.c2
-rw-r--r--Build/source/texk/web2c/luatexdir/pdf/pdflistout.c7
-rw-r--r--Build/source/texk/web2c/luatexdir/pdf/pdftables.h6
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/textoken.c4
-rw-r--r--Build/source/texk/web2c/mf.ch292
-rw-r--r--Build/source/texk/web2c/mplibdir/ChangeLog15
-rw-r--r--Build/source/texk/web2c/mplibdir/mp.w2821
-rw-r--r--Build/source/texk/web2c/mplibdir/mpmathbinary.w6
-rw-r--r--Build/source/texk/web2c/mplibdir/mpmathdouble.w5
-rw-r--r--Build/source/texk/web2c/mplibdir/mpmathinterval.w8
-rw-r--r--Build/source/texk/web2c/omegafonts/Makefile.in1
-rw-r--r--Build/source/texk/web2c/patgen.ch36
-rw-r--r--Build/source/texk/web2c/pktogf.ch4
-rw-r--r--Build/source/texk/web2c/pktype.ch20
-rw-r--r--Build/source/texk/web2c/pltotf.ch2
-rw-r--r--Build/source/texk/web2c/pmpostdir/ChangeLog4
-rw-r--r--Build/source/texk/web2c/pmpostdir/pmp.ch8
-rw-r--r--Build/source/texk/web2c/pooltype.ch16
-rw-r--r--Build/source/texk/web2c/ptexdir/ChangeLog6
-rw-r--r--Build/source/texk/web2c/ptexdir/ptex-base.ch17
-rw-r--r--Build/source/texk/web2c/tangle.ch117
-rwxr-xr-xBuild/source/texk/web2c/tests/fix-changefile-lines.py218
-rw-r--r--Build/source/texk/web2c/tex.ch686
-rw-r--r--Build/source/texk/web2c/tftopl.ch2
-rw-r--r--Build/source/texk/web2c/tiedir/tie-w2c.ch5
-rw-r--r--Build/source/texk/web2c/unbalanced-braces.ch4
-rw-r--r--Build/source/texk/web2c/uptexdir/ChangeLog17
-rw-r--r--Build/source/texk/web2c/uptexdir/ptex-base.ch17
-rw-r--r--Build/source/texk/web2c/uptexdir/tests/ctlsym_num.tex69
-rw-r--r--Build/source/texk/web2c/uptexdir/uptex-m.ch42
-rw-r--r--Build/source/texk/web2c/vftovp.ch31
-rw-r--r--Build/source/texk/web2c/weave.ch102
-rw-r--r--Build/source/texk/web2c/xetexdir/ChangeLog10
-rw-r--r--Build/source/texk/web2c/xetexdir/am/xetex.am8
-rw-r--r--Build/source/texk/web2c/xetexdir/tests/ctrlsym.log20
-rw-r--r--Build/source/texk/web2c/xetexdir/tests/ctrlsym.tex34
-rwxr-xr-xBuild/source/texk/web2c/xetexdir/xetex-ctrlsym.test28
-rw-r--r--Build/source/texk/web2c/xetexdir/xetex.ch8
-rw-r--r--Build/source/texk/web2c/xetexdir/xetex.web22
79 files changed, 3707 insertions, 3014 deletions
diff --git a/Build/source/texk/web2c/ChangeLog b/Build/source/texk/web2c/ChangeLog
index e5d85a5f2fe..025a70eb69c 100644
--- a/Build/source/texk/web2c/ChangeLog
+++ b/Build/source/texk/web2c/ChangeLog
@@ -1,3 +1,31 @@
+2024-06-05 Andreas Scherer <https://ascherer.github.io>
+
+ * tests/fix-changefile-lines.py,
+ * tangle.ch,
+ * weave.ch: Correctly count section start markers.
+ * mf.ch,
+ * tex.ch: Recount parts and sections.
+
+2024-06-03 David Fuchs <drfuchs@yahoo.com>
+
+ * tex.ch (check_outer_validity): don't check unless OK_to_interrupt,
+ to avoid getting into an erroneous state if an \outer token
+ is deleted interactively.
+ Report from Tyge Thiessen:
+ https://tug.org/pipermail/tex-k/2024-March/004021.html
+ DEK bug entry: https://tug.org/texmfbug/newbug.html#B142outer
+
+2024-06-03 Karl Berry <karl@freefriends.org>
+
+ * tests/fix-changefile-lines.py: new script from Tyge Thiessen
+ to update the chapter/section/line numbers in a .ch file,
+ following my request:
+ https://tug.org/pipermail/tex-k/2024-June/004064.html
+ * tex.ch,
+ * mf.ch: update with the script.
+
+ * unbalanced-braces.ch: tweak text.
+
2024-04-28 Luigi Scarso <luigi.scarso@gmail.com>
* configure.ac (LUA53_DEFINES, LUA52_DEFINES, LUAJIT_DEFINES):
diff --git a/Build/source/texk/web2c/Makefile.in b/Build/source/texk/web2c/Makefile.in
index 98813e30249..9f1c3cab36d 100644
--- a/Build/source/texk/web2c/Makefile.in
+++ b/Build/source/texk/web2c/Makefile.in
@@ -3244,22 +3244,24 @@ EXTRA_DIST = PROJECTS cftests cpascal.h help.h w2c/config.h \
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 \
@@ -3445,7 +3447,8 @@ EXTRA_DIST = PROJECTS cftests cpascal.h help.h w2c/config.h \
xetexdir/unicode-char-prep.pl xetexdir/xewebmac.tex \
$(xetex_tests) xetexdir/tests/bug73.log \
xetexdir/tests/bug73.tex xetexdir/tests/filedump.log \
- xetexdir/tests/filedump.tex omegaware/README \
+ xetexdir/tests/filedump.tex xetexdir/tests/ctrlsym.log \
+ xetexdir/tests/ctrlsym.tex omegaware/README \
omegaware/ChangeLog $(odvicopy_sources) $(odvitype_sources) \
omegaware/ofm2opl.web omegaware/ofm2opl.up \
omegaware/ofm2opl.ch omegaware/opl2ofm.web \
@@ -3568,7 +3571,8 @@ DISTCLEANFILES = CXXLD.sh tangle.c tangle.h tangle.p tangle-web2c \
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 \
@@ -3579,26 +3583,28 @@ DISTCLEANFILES = CXXLD.sh tangle.c tangle.h tangle.p tangle-web2c \
$(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 xetests/fn*.* \
- $(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
+ bug73.tex filedump.log filedump.out filedump.tex \
+ xe-ctrlsym.fmt xe-ctrlsym.log xe-ctrlsym.out xe-ctrlsym.tex \
+ xetests/fn*.* $(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) \
@@ -4511,6 +4517,7 @@ euptex_ch_srcs = \
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
@@ -5370,6 +5377,7 @@ libxetex_prereq = xetexd.h $(xetex_dependencies)
xetex_tests = \
xetexdir/xetex-filedump.test \
xetexdir/xetex-bug73.test \
+ xetexdir/xetex-ctrlsym.test \
xetexdir/xetex.test \
xetexdir/wcfname.test
@@ -21980,7 +21988,8 @@ euptex.ch: tie$(EXEEXT) euptex.web $(euptex_ch_srcs)
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) $@
@@ -22202,7 +22211,8 @@ $(srcdir)/xetexdir/xetex_version.h: @MAINTAINER_MODE_TRUE@ xetexdir/xetex.web
xetex-final.ch: tie$(EXEEXT) $(xetex_ch_srcs)
$(tie_c) $(xetex_ch_srcs)
$(libxetex_a_OBJECTS): $(libxetex_prereq)
-xetexdir/xetex-filedump.log xetexdir/xetex-bug73.log xetexdir/xetex.log \
+xetexdir/xetex-filedump.log xetexdir/xetex-bug73.log \
+ xetexdir/xetex-ctrlsym.log xetexdir/xetex.log \
xetexdir/wcfname.log: xetex$(EXEEXT)
# (end of xetex.am)
diff --git a/Build/source/texk/web2c/ctiedir/ctie-k.ch b/Build/source/texk/web2c/ctiedir/ctie-k.ch
index 3bb1f763e6b..e4f258ffbaf 100644
--- a/Build/source/texk/web2c/ctiedir/ctie-k.ch
+++ b/Build/source/texk/web2c/ctiedir/ctie-k.ch
@@ -17,7 +17,7 @@
% the web2c system and on comm-w2c.ch from the Web2C 7.4.5 distribution
% by Wlodek Bzyl and Olaf Weber.
-@x l.19 Add macro definitions
+@x [0] l.19 Add macro definitions
\def\title{The CTIE processor}
\def\botofcontents{%
\vfill
@@ -64,7 +64,7 @@ permission notice identical to this one.
\datecontentspage
@z
-@x l.81
+@x [1] l.81
@d copyright
"Copyright 2002,2003 Julian Gilbey. All rights reserved. There is no warranty.\n\
Run with the --version option for other important information."
@@ -75,28 +75,27 @@ Run with the --version option for other important information."
"Run with the --version option for other important information."
@z
-@x l.102
+@x [3] l.102
main(argc, argv)
int argc; string *argv;
@y
int main (int argc, string *argv)
@z
-@x l.105 Set up kpathsea stuff
+@x [3] l.105 Set up kpathsea stuff
@<Initialise parameters@>;
@y
@<Set up |PROGNAME| feature and initialise the search path mechanism@>@;
@<Initialise parameters@>@;
@z
-@x l.107
+@x [3] l.107
@<Print the banners@>;
@y
@<Print the banners@>@;
@z
-boolean and string are defined by kpathsea.
-@x l.116
+@x [4] l.116 boolean and string are defined by kpathsea.
@ We include the additional types |boolean| and |string|. \.{CTIE}
replaces the complex \.{TIE} character set handling (based on that of
the original \.{WEB} system) with the standard \.{CWEB} behaviour, and
@@ -124,7 +123,7 @@ them here.
@s const_string int
@z
-@x l.129 The kpathsea include files find the right header file for these.
+@x [5] l.129 The kpathsea include files find the right header file for these.
@ We predeclare some standard string-handling functions here instead of
including their system header files, because the names of the header files
are not as standard as the names of the functions. (There's confusion
@@ -142,19 +141,19 @@ the \.{kpathsea} headers do the right thing by including \.{<string.h>}
behind the scenes.
@z
-@x l.149
+@x [6] l.149
@d xisupper(c) (isupper(c)&&((unsigned char)c<0200))
@y
@d xisupper(c) (isupper((unsigned char)c)&&((unsigned char)c<0200))
@z
-@x l.155
+@x [7] l.155
This variable must be initialized.
@y
This variable must be initialised.
@z
-@x l.158
+@x [7] l.158
@d spotless 0
@d troublesome 1
@d fatal 2
@@ -170,7 +169,7 @@ typedef enum {
static return_code history=spotless;
@z
-@x l.170 The kpathsea include files must be first.
+@x [8] l.170 The kpathsea include files must be first.
predefined as we include the \.{stdio.h} definitions.
@<Global \&{\#include}s@>=
@@ -185,7 +184,7 @@ through the \.{kpathsea} interface.
#include <lib/lib.h>
@z
-@x l.176 And this.
+@x [9] l.176 And this.
@ And we need dynamic memory allocation.
This should cause no trouble in any \CEE/ program.
@^system dependencies@>
@@ -203,7 +202,7 @@ The \.{kpathsea} include files handle the definition of |@!malloc|, too.
@^system dependencies@>
@z
-@x l.190
+@x [10] l.190
files) are treated the same way. To organize the
@y
files) are treated the same way. To organise the
@@ -211,19 +210,19 @@ files) are treated the same way. To organise the
Sections 10 and 11: use enum as requested in ctie.w
-@x l.204
+@x [10] l.204
\leavevmode |file_types| is used to describe whether a file
@y
\leavevmode \&{file\_types} is used to describe whether a file
@z
-@x l.208
+@x [10] l.208
the kind of output. (this would even be necessary if we
@y
the kind of output. (This would even be necessary if we
@z
-@x l.212
+@x [10] l.212
#define search 0
#define test 1
#define reading 2
@@ -245,13 +244,13 @@ typedef enum {
@!chf } file_types;
@z
-@x l.223
+@x [11] l.223
@ A variable of type |out_md_type| will tell us in what state the output
@y
@ A variable of type \&{out\_md\_type} will tell us in what state the output
@z
-@x l.230 dito
+@x [11] l.230 dito
#define normal 0
#define pre 1
#define post 2
@@ -263,13 +262,13 @@ typedef enum {
@!post } out_md_type;
@z
-@x l.284 way too short!
+@x [15] l.284 way too short!
@d max_file_name_length 60
@y
@d max_file_name_length 1024
@z
-@x l.329
+@x [19] l.329
boolean get_line(i, do_includes)
file_index i; boolean do_includes;
@y
@@ -277,27 +276,25 @@ static boolean
get_line (file_index i, boolean do_includes)
@z
-@x l.361
+@x [20] l.361
replacement part of a change file, or in an incomplerte check if the
@y
replacement part of a change file, or in an incomplete check if the
@z
-Handle input lines with CRLF
-
-@x l.376
+@x [20] l.376 Handle input lines with CRLF
if ((*(k++) = c) != ' ') inp_desc->limit = k;
@y
if ((*(k++) = c) != ' ' && c != '\r') inp_desc->limit = k;
@z
-@x l.386
+@x [20] l.386
@<Increment the line number and print a progess report at
@y
@<Increment the line number and print a progress report at
@z
-@x l.436
+@x [24] l.436
if ((*(k++) = c) != ' ') inp_desc->limit = k;
@y
if ((*(k++) = c) != ' ' && c != '\r') inp_desc->limit = k;
@@ -306,7 +303,7 @@ Handle input lines with CRLF
The next piece is simplified using the kpathsea kpse_find_file
function.
-@x l.497
+@x [27] l.497
If the environment variable \.{CWEBINPUTS} is set, or if the compiler flag
of the same name was defined at compile time,
\.{CWEB} will look for include files in the directory thus named, if
@@ -317,7 +314,7 @@ We use the \Kpathsea/ library (in particular, the \.{CWEBINPUTS}
variable) to search for this file.@.CWEBINPUTS@>
@z
-@x l.510 Don't need the same variables any longer
+@x [27] l.510 Don't need the same variables any longer
char temp_file_name[max_file_name_length];
char *file_name_end;
char *k, *kk;
@@ -328,7 +325,7 @@ variable) to search for this file.@.CWEBINPUTS@>
char *k;
@z
-@x l.534 Replace with kpse_find_file
+@x [27] l.534 Replace with kpse_find_file
if ((new_inc->the_file=fopen(new_inc->file_name, "r"))!=NULL) {
@y
if ((fullname=kpse_find_cweb(new_inc->file_name))!=NULL @|
@@ -336,7 +333,7 @@ variable) to search for this file.@.CWEBINPUTS@>
free(fullname);
@z
-@x l.539 And this part is replaced by kpse_find_file
+@x [27] l.539 And this part is replaced by kpse_find_file
kk=getenv("CWEBINPUTS");
if (kk!=NULL) {
if ((l=strlen(kk))>max_file_name_length-2) too_long();
@@ -364,7 +361,7 @@ variable) to search for this file.@.CWEBINPUTS@>
@y
@z
-@x l.565 slightly more useful error message
+@x [27] l.565 slightly more useful error message
err_print(i, "! Cannot open include file");
@y
if (fullname) {
@@ -375,13 +372,13 @@ variable) to search for this file.@.CWEBINPUTS@>
@z
-@x l.585
+@x [28] l.585
void err_print();
@y
void err_print (file_index, const char *);
@z
-@x l.590
+@x [29] l.590
void err_print(i, s) /* prints `\..' and location of error message */
file_index i; char *s;
@y
@@ -389,13 +386,13 @@ void err_print (file_index i, const char *s)
/* prints `\..' and location of error message */
@z
-@x l.664
+@x [32] l.664
int wrap_up()
@y
int wrap_up (void)
@z
-@x l.667
+@x [32] l.667
if (history > spotless) return 1;
else return 0;
@y
@@ -403,32 +400,32 @@ int wrap_up (void)
else return EXIT_SUCCESS;
@z
-@x l.674
+@x [33] l.674
int wrap_up();
@y
int wrap_up (void);
@z
-@x l.697
+@x [35] l.697
void pfatal_error();
@y
void pfatal_error (const char *, const char *);
@z
-@x l.700
+@x [36] l.700
void pfatal_error(s, t)
char *s, *t;
@y
void pfatal_error (const char *s, const char *t)
@z
-@x l.707
+@x [36] l.707
else fprintf(stderr, "\n");
@y
else putc('\n', stderr);
@z
-@x l.713
+@x [37] l.713
@ We need an include file for the above.
@<Global \&{\#include}s@>=
@@ -438,20 +435,20 @@ void pfatal_error (const char *s, const char *t)
interface.
@z
-@x l.731 Use binary mode for output files
+@x [38] l.731 Use binary mode for output files
out_file=fopen(out_name, "w");
if (out_file==NULL) {
@y
if ((out_file=fopen(out_name, "wb"))==NULL) {
@z
-@x l.739
+@x [39] l.739
@ The name of the file and the file desciptor are stored in
@y
@ The name of the file and the file descriptor are stored in
@z
-@x l.747 Use the kpathsea library to do this
+@x [40] l.747 Use the kpathsea library to do this
@ For the master file we start by reading its first line into the
buffer, if we could open it.
@@ -486,7 +483,7 @@ the file.
@.Cannot find master file@>
@z
-@x l.768 And this
+@x [41] l.768 And this
@<Prepare the change files@>=
{
file_index i;
@@ -521,7 +518,7 @@ the file.
@.Cannot find change file@>
@z
-@x l.792
+@x [42] l.792
boolean lines_dont_match(i, j)
file_index i, j;
@y
@@ -529,7 +526,7 @@ static boolean
lines_dont_match (file_index i, file_index j)
@z
-@x l.809
+@x [43] l.809
void init_change_file(i)
file_index i;
@y
@@ -537,13 +534,13 @@ static void
init_change_file (file_index i)
@z
-@x l.833
+@x [44] l.833
if (xisupper(ccode)) ccode=tolower(ccode);
@y
if (xisupper(ccode)) ccode=tolower((unsigned char)ccode);
@z
-@x l.858
+@x [46] l.858
void put_line(j)
file_index j;
@y
@@ -551,7 +548,7 @@ static void
put_line (file_index j)
@z
-@x l.873
+@x [47] l.873
boolean e_of_ch_module(i)
file_index i;
@y
@@ -559,7 +556,7 @@ static boolean
e_of_ch_module (file_index i)
@z
-@x l.894
+@x [48] l.894
boolean e_of_ch_preamble(i)
file_index i;
@y
@@ -567,7 +564,7 @@ static boolean
e_of_ch_preamble (file_index i)
@z
-@x l.1079
+@x [57] l.1079
if (out_mode==post) /* last line has been changed */
fprintf(out_file, "@@z\n");
@y
@@ -577,7 +574,7 @@ if (out_mode==post) /* last line has been changed */
fprintf(out_file, "@@z\n");
@z
-@x l.1106
+@x [59] l.1106
void usage_error()
{
@<Print the banners@>;
@@ -590,13 +587,13 @@ usage_error (void)
fprintf(stderr, "Usage: ctie -m|-c outfile master changefile(s)\n");
@z
-@x l.1111
+@x [59] l.1111
exit(1);
@y
exit(EXIT_FAILURE);
@z
-@x l.1119 Add Web2C version to banner string
+@x [60] l.1119 Add Web2C version to banner string
printf("%s\n", banner); /* print a ``banner line'' */
@y
printf("%s%s\n", banner, versionstring); /* print a ``banner line'' */
@@ -604,19 +601,19 @@ printf("%s%s\n", banner, versionstring); /* print a ``banner line'' */
Section 63: use 'none' more than once.
-@x l.1169
+@x [63] l.1169
(which is the case if |no_ch==(-1)|) or if the next element of
@y
(which is the case if |no_ch==none|) or if the next element of
@z
-@x l.1174
+@x [63] l.1174
if (no_ch==(-1)) {
@y
if (no_ch==none) {
@z
-@x l.1218
+@x [66] l.1218
string CTIEHELP[] = {
"Usage: ctie -[mc] outfile master changefile(s)",
@y
@@ -624,7 +621,7 @@ const_string CTIEHELP[] = {
"Usage: ctie -m|-c outfile master changefile(s)",
@z
-@x l.1233
+@x [67] l.1233
void usage_help();
void print_version_and_exit();
@y
@@ -632,7 +629,7 @@ static void usage_help (void);
static void print_version_and_exit (const_string, const_string);
@z
-@x l.1238
+@x [68] l.1238
void usage_help()
{
string *message=CTIEHELP;
@@ -643,13 +640,13 @@ usage_help (void)
const_string *message=CTIEHELP;
@z
-@x l.1248
+@x [68] l.1248
exit(0);
@y
exit(EXIT_SUCCESS);
@z
-@x l.1253
+@x [69] l.1253
void print_version_and_exit(name, version)
string name, version;
{
@@ -687,7 +684,7 @@ print_version_and_exit (const_string name, const_string version)
We use the path-searching initialisation code
taken almost verbatim from comm-w2c.ch.
-@x l.1267
+@x [70] l.1267
@* System-dependent changes.
This section should be replaced, if necessary, by
changes to the program that are necessary to make \.{CTIE}
diff --git a/Build/source/texk/web2c/cwebdir/ChangeLog b/Build/source/texk/web2c/cwebdir/ChangeLog
index 8add6dcc29b..d770c50051a 100644
--- a/Build/source/texk/web2c/cwebdir/ChangeLog
+++ b/Build/source/texk/web2c/cwebdir/ChangeLog
@@ -1,3 +1,44 @@
+2024-06-09 Andreas Scherer <https://ascherer.github.io>
+
+ * comm-w2c.ch,
+ * ctang-w2c.ch,
+ * ctwill-w2c.ch,
+ * cweav-w2c.ch: Fix typo (upstream).
+
+2024-06-09 Andreas Scherer <https://ascherer.github.io>
+
+ * comm-mini.ch,
+ * comm-w2c.ch: Section 'Index.' is on Level 1, not 0.
+ * ctwill-w2c.ch,
+ * ../tests/fix-changefile-lines.py: Ignore CWEB @qcomment@> line(s).
+
+2024-06-06 Andreas Scherer <https://ascherer.github.io>
+
+ * comm-w2c.ch,
+ * ctang-w2c.ch,
+ * ctwill-w2c.ch,
+ * cweav-w2c.ch: Add [part.section] l.ine information.
+
+2024-05-25 Andreas Scherer <https://ascherer.github.io>
+
+ * cwebacromac.tex: HiTeX has a three-page table-of-contents.
+ * texinputs/pdfwebtocfront.tex: Add \space in PDF code.
+
+2024-05-25 Andreas Scherer <https://ascherer.github.io>
+
+ * texinputs/pdfwebtocfront.tex: More room for long ToCs.
+
+2024-05-24 Andreas Scherer <https://ascherer.github.io>
+
+ * cwebacromac.tex,
+ * cwebmac.tex,
+ * texinputs/dcwebmac.tex,
+ * texinputs/fcwebmac.tex,
+ * texinputs/icwebmac.tex,
+ * texinputs/pdfctproofmac.tex,
+ * texinputs/pdfctwimac.tex,
+ * texinputs/pdfwebtocfront.tex: Extend and reshuffle \startpdf.
+
2024-03-13 Andreas Scherer <https://ascherer.github.io>
* ctwill-mini.ch: Fix page breaks in sections 164 and 173.
diff --git a/Build/source/texk/web2c/cwebdir/comm-mini.ch b/Build/source/texk/web2c/cwebdir/comm-mini.ch
index 56356a366a3..d1bd623b2a2 100644
--- a/Build/source/texk/web2c/cwebdir/comm-mini.ch
+++ b/Build/source/texk/web2c/cwebdir/comm-mini.ch
@@ -283,6 +283,6 @@ Section 96.
Section 85/102.
@x
-@** Index.
+@* Index.
@y
@z
diff --git a/Build/source/texk/web2c/cwebdir/comm-w2c.ch b/Build/source/texk/web2c/cwebdir/comm-w2c.ch
index 005817d831f..4035a633ffb 100644
--- a/Build/source/texk/web2c/cwebdir/comm-w2c.ch
+++ b/Build/source/texk/web2c/cwebdir/comm-w2c.ch
@@ -16,143 +16,143 @@
@q Please send comments, suggestions, etc. to tex-k@@tug.org. @>
-@x
+@x [0.0] l.25
\def\title{Common code for CTANGLE and CWEAVE (Version 4.11)}
@y
\def\Kpathsea/{{\mc KPATHSEA\spacefactor1000}} \ifacro\sanitizecommand\Kpathsea{KPATHSEA}\fi
\def\title{Common code for CTANGLE and CWEAVE (4.11 [\TeX~Live])}
@z
-@x
+@x [0.0] l.30
\centerline{(Version 4.11)}
@y
\centerline{(Version 4.11 [\TeX~Live])}
@z
-@x
+@x [0.0] l.32
\def\botofcontents{\vfill
@y
\def\covernote{\vbox{%
@z
-@x
+@x [0.0] l.45
}
@y
}}\datecontentspage
@z
-@x
+@x [1.1] l.51
to both \.{CTANGLE} and \.{CWEAVE}, which roughly concerns the following
@y
to \.{CTANGLE}, \.{CWEAVE}, and \.{CTWILL},
which roughly concerns the following
@z
-@x
+@x [1.1] l.57
sometimes use \.{CWEB} to refer to either of the two component
@y
sometimes use \.{CWEB} to refer to any of the three component
@z
-@x
+@x [1.2] l.72
@i common.h
@y
@i comm-w2c.h
@z
-@x
+@x [1.18] l.77
|program|.
@y
|program|. And \.{CTWILL} adds some extra twists.
@z
-@x
+@x [1.18] l.80
boolean program; /* \.{CWEAVE} or \.{CTANGLE}? */
@y
cweb program; /* \.{CTANGLE} or \.{CWEAVE} or \.{CTWILL}? */
@z
-@x
+@x [1.20] l.99
@<Initialize pointers@>@;
@y
@<Initialize pointers@>@;
@<Set up \.{PROGNAME} feature and initialize the search path mechanism@>@;
@z
-@x
+@x [1.20] l.100
@<Set the default options common to \.{CTANGLE} and \.{CWEAVE}@>@;
@y
@<Set locale and bind language catalogs@>@;
@<Set the default options common to \.{CTANGLE} and \.{CWEAVE}@>@;
@z
-@x
+@x [3.23] l.165
if ((*(k++) = c) != ' ') limit = k;
@y
if ((*(k++) = c) != ' ' && c != '\r') limit = k;
@z
-@x
+@x [3.23] l.168
loc=buffer; err_print("! Input line too long");
@y
loc=buffer; err_print(_("! Input line too long"));
@z
-@x
+@x [4.25] l.197
static char alt_web_file_name[max_file_name_length]; /* alternate name to try */
@y
char *found_filename; /* filename found by |kpse_find_file| */
@z
-@x
+@x [4.29] l.253
err_print("! Missing @@x in change file");
@y
err_print(_("! Missing @@x in change file"));
@z
-@x
+@x [4.30] l.264
err_print("! Change file ended after @@x");
@y
err_print(_("! Change file ended after @@x"));
@z
-@x
+@x [4.32] l.310
err_print("! Change file ended before @@y");
@y
err_print(_("! Change file ended before @@y"));
@z
-@x
+@x [4.32] l.324
err_print("! CWEB file ended during a change");
@y
err_print(_("! CWEB file ended during a change"));
@z
-@x
+@x [4.34] l.338
loc=buffer+2; err_print("! Where is the matching @@y?");
@y
loc=buffer+2; err_print(_("! Where is the matching @@y?"));
@z
-@x
+@x [4.34] l.345
err_print("of the preceding lines failed to match");
@y
err_print(_("of the preceding lines failed to match"));
@z
-@x
+@x [4.35] l.378
err_print("! Include file name not given");
@y
err_print(_("! Include file name not given"));
@z
-@x
+@x [4.35] l.383
err_print("! Too many nested includes");
@y
err_print(_("! Too many nested includes"));
@z
-@x
+@x [4.36] l.393
@ When an \.{@@i} line is found in the |cur_file|, we must temporarily
stop reading it and start reading from the named include file. The
\.{@@i} line should give a complete file name with or without
@@ -174,13 +174,13 @@ The remainder of the \.{@@i} line after the file name is ignored.
@^system dependencies@>
@z
-@x
+@x [4.36] l.405
err_print("! Include file name too long"); goto restart;}
@y
err_print(_("! Include file name too long")); goto restart;}
@z
-@x
+@x [4.36] l.408
char temp_file_name[max_file_name_length];
char *cur_file_name_end=cur_file_name+max_file_name_length-1;
char *kk, *k=cur_file_name;
@@ -190,7 +190,7 @@ The remainder of the \.{@@i} line after the file name is ignored.
char *k=cur_file_name;
@z
-@x
+@x [4.36] l.422
if ((cur_file=fopen(cur_file_name,"r"))!=NULL) {
@y
if ((found_filename=kpse_find_cweb(cur_file_name))!=NULL @|
@@ -204,7 +204,7 @@ The remainder of the \.{@@i} line after the file name is ignored.
} else fatal(_("! Filename too long\n"), found_filename);
@z
-@x
+@x [4.36] l.426
if ((kk=getenv("CWEBINPUTS"))!=NULL) {
if ((l=strlen(kk))>max_file_name_length-2) too_long();
strcpy(temp_file_name,kk);
@@ -234,25 +234,25 @@ The remainder of the \.{@@i} line after the file name is ignored.
include_depth--; err_print(_("! Cannot open include file")); goto restart;
@z
-@x
+@x [4.38] l.473
err_print("! Change file ended without @@z");
@y
err_print(_("! Change file ended without @@z"));
@z
-@x
+@x [4.38] l.489
err_print("! Where is the matching @@z?");
@y
err_print(_("! Where is the matching @@z?"));
@z
-@x
+@x [4.39] l.509
err_print("! Change file entry did not match");
@y
err_print(_("! Change file entry did not match"));
@z
-@x
+@x [4.41] l.534
if ((web_file=fopen(web_file_name,"r"))==NULL) {
strcpy(web_file_name,alt_web_file_name);
if ((web_file=fopen(web_file_name,"r"))==NULL)
@@ -271,7 +271,7 @@ else if (strlen(found_filename) < max_file_name_length) {
} else fatal(_("! Filename too long\n"), found_filename);
@z
-@x
+@x [4.41] l.542
if ((change_file=fopen(change_file_name,"r"))==NULL)
fatal("! Cannot open change file ", change_file_name);
@y
@@ -287,13 +287,13 @@ else if (strlen(found_filename) < max_file_name_length) {
} else fatal(_("! Filename too long\n"), found_filename);
@z
-@x
+@x [5.46] l.619
@d hash_size 353 /* should be prime */
@y
@d hash_size 8501 /* should be prime */
@z
-@x
+@x [5.51] l.673
if (byte_ptr+l>byte_mem_end) overflow("byte memory");
if (name_ptr>=name_dir_end) overflow("name");
@y
@@ -301,13 +301,13 @@ else if (strlen(found_filename) < max_file_name_length) {
if (name_ptr>=name_dir_end) overflow(_("name"));
@z
-@x
+@x [5.51] l.677
if (program==cweave) p->ilk=t, init_node(p);
@y
if (program!=ctangle) p->ilk=t, init_node(p);
@z
-@x
+@x [5.57] l.806
if (s+name_len>byte_mem_end) overflow("byte memory");
if (name_ptr+1>=name_dir_end) overflow("name");
@y
@@ -315,55 +315,55 @@ else if (strlen(found_filename) < max_file_name_length) {
if (name_ptr+1>=name_dir_end) overflow(_("name"));
@z
-@x
+@x [5.58] l.833
if (name_ptr>=name_dir_end) overflow("name");
@y
if (name_ptr>=name_dir_end) overflow(_("name"));
@z
-@x
+@x [5.58] l.838
if (s+name_len>byte_mem_end) overflow("byte memory");
@y
if (s+name_len>byte_mem_end) overflow(_("byte memory"));
@z
-@x
+@x [5.60] l.883
printf("%s","\n! Ambiguous prefix: matches <");
@y
printf("%s",_("\n! Ambiguous prefix: matches <"));
@z
-@x
+@x [5.60] l.886
printf("%s",">\n and <");
@y
printf("%s",_(">\n and <"));
@z
-@x
+@x [5.62] l.912
printf("%s","\n! New name is a prefix of <");
@y
printf("%s",_("\n! New name is a prefix of <"));
@z
-@x
+@x [5.62] l.924
printf("%s","\n! New name extends <");
@y
printf("%s",_("\n! New name extends <"));
@z
-@x
+@x [5.62] l.930
printf("%s","\n! Section name incompatible with <");
@y
printf("%s",_("\n! Section name incompatible with <"));
@z
-@x
+@x [5.62] l.933
printf("%s",">,\n which abbreviates <");
@y
printf("%s",_(">,\n which abbreviates <"));
@z
-@x
+@x [6.67] l.1031
printf(". (l. %d of change file)\n", change_line);
else if (cur_line>0) {
if (include_depth==0) printf(". (l. %d)\n", cur_line);
@@ -375,7 +375,7 @@ else if (cur_line>0) {
else printf(_(". (l. %d of include file %s)\n"), cur_line, cur_file_name);
@z
-@x
+@x [6.68] l.1057
Some implementations may wish to pass the |history| value to the
operating system so that it can be used to govern whether or not other
programs are started. Here, for instance, we pass the operating system
@@ -397,14 +397,14 @@ can be made sensitive to these conditions.
@d RETURN_FAIL 20 /* Complete or severe failure */
@z
-@x
+@x [6.68] l.1068
@<Print the job |history|@>@;
@y
@<Print the job |history|@>@;
@<Remove the temporary file if not already done@>@;
@z
-@x
+@x [6.68] l.1069
if (history > harmless_message) return EXIT_FAILURE;
else return EXIT_SUCCESS;
@y
@@ -416,7 +416,7 @@ can be made sensitive to these conditions.
}
@z
-@x
+@x [6.69] l.1075
case spotless:
if (show_happiness) puts("(No errors were found.)"); break;
case harmless_message:
@@ -436,13 +436,13 @@ case fatal_message: default:
puts(_("(That was a fatal error, my friend.)"));
@z
-@x
+@x [6.71] l.1106
printf("\n! Sorry, %s capacity exceeded",t); fatal("","");
@y
printf(_("\n! Sorry, %s capacity exceeded"),t); fatal("","");
@z
-@x
+@x [7.73] l.1118
or flags to be turned on (beginning with |"+"|).
@y
or flags to be turned on (beginning with |"+"|).
@@ -450,20 +450,20 @@ or flags to be turned on (beginning with |"+"|).
see section |@<Handle flag arg...@>| for details.
@z
-@x
+@x [7.73] l.1130
char scn_file_name[max_file_name_length]; /* name of |scn_file| */
@y
char scn_file_name[max_file_name_length]; /* name of |scn_file| */
char check_file_name[max_file_name_length]; /* name of |check_file| */
@z
-@x
+@x [7.74] l.1138
show_banner=show_happiness=show_progress=make_xrefs=true;
@y
make_xrefs=true;
@z
-@x
+@x [7.75] l.1142
file. It may have an extension, or it may omit the extension to get |".w"| or
|".web"| added. The \TEX/ output file name is formed by replacing the \.{CWEB}
@y
@@ -471,7 +471,7 @@ file. It may have an extension, or it may omit the extension to get |".w"|
added. The \TEX/ output file name is formed by replacing the \.{CWEB}
@z
-@x
+@x [7.75] l.1149
An omitted change file argument means that |"/dev/null"| should be used,
when no changes are desired.
@y
@@ -480,7 +480,7 @@ systems the contents of the compile-time variable |DEV_NULL| (\TeX~Live) or
|_DEV_NULL| (Amiga)---should be used, when no changes are desired.
@z
-@x
+@x [7.75] l.1165
strcpy(change_file_name,"/dev/null");
@y
strcpy(change_file_name,"/dev/null");
@@ -494,7 +494,7 @@ systems the contents of the compile-time variable |DEV_NULL| (\TeX~Live) or
@^system dependencies@>
@z
-@x
+@x [7.75] l.1171
if (*s=='.') dot_pos=s++;
else if (*s=='/') dot_pos=NULL,name_pos=++s;
else s++;
@@ -506,7 +506,7 @@ systems the contents of the compile-time variable |DEV_NULL| (\TeX~Live) or
@^system dependencies@>
@z
-@x
+@x [7.77] l.1186
@ We use all of |*argv| for the |web_file_name| if there is a |'.'| in it,
otherwise we add |".w"|. If this file can't be opened, we prepare an
|alt_web_file_name| by adding |"web"| after the dot.
@@ -515,12 +515,12 @@ otherwise we add |".w"|. If this file can't be opened, we prepare an
otherwise we add |".w"|.
@z
-@x
+@x [7.77] l.1203
sprintf(alt_web_file_name,"%s.web",*argv);
@y
@z
-@x
+@x [7.80] l.1246
for(dot_pos=*argv+1;*dot_pos>'\0';dot_pos++)
flags[(eight_bits)*dot_pos]=flag_change;
@y
@@ -554,7 +554,7 @@ for(dot_pos=*argv+1;*dot_pos>'\0';dot_pos++)
}
@z
-@x
+@x [7.81] l.1249
@ @<Print usage error message and quit@>=
{
if (program==ctangle)
@@ -572,20 +572,20 @@ cb_usage(program==ctangle ? "ctangle" : program==cweave ? "cweave" : "ctwill");
@.Usage:@>
@z
-@x
+@x [7.82] l.1261
@ @<Complain about arg...@>= fatal("! Filename too long\n", *argv);
@y
@ @<Complain about arg...@>= fatal(_("! Filename too long\n"), *argv);
@z
-@x
+@x [8.83] l.1272
FILE *active_file; /* currently active file for \.{CWEAVE} output */
@y
FILE *active_file; /* currently active file for \.{CWEAVE} output */
FILE *check_file; /* temporary output file */
@z
-@x
+@x [8.84] l.1274
@ @<Scan arguments and open output files@>=
scan_args();
if (program==ctangle) {
@@ -613,7 +613,7 @@ else {
}
@z
-@x
+@x [9.85] l.1286
@* Index.
@y
@** Extensions to {\tentex CWEB}. The following sections introduce new or
@@ -648,7 +648,7 @@ string texmf_locale;@/
char separators[]=SEPARATORS;
@* Temporary file output. Most \CEE/ projects are controlled by a \.{Makefile}
-that automatically takes care of the temporal dependecies between the different
+that automatically takes care of the temporal dependencies between the different
source modules. It may be convenient that \.{CWEB} doesn't create new output
for all existing files, when there are only changes to some of them. Thus the
\.{make} process will only recompile those modules where necessary. You can
@@ -888,5 +888,5 @@ void cb_show_banner (void)
@.cweb.mo@>
}
-@** Index.
+@* Index.
@z
diff --git a/Build/source/texk/web2c/cwebdir/ctang-w2c.ch b/Build/source/texk/web2c/cwebdir/ctang-w2c.ch
index c6d74ba5d28..177daac7ab2 100644
--- a/Build/source/texk/web2c/cwebdir/ctang-w2c.ch
+++ b/Build/source/texk/web2c/cwebdir/ctang-w2c.ch
@@ -16,50 +16,50 @@
@q Please send comments, suggestions, etc. to tex-k@@tug.org. @>
-@x
+@x [0.0] l.30
\def\title{CTANGLE (Version 4.11)}
@y
\def\title{CTANGLE (Version 4.11 [\TeX~Live])}
@z
-@x
+@x [0.0] l.34
\centerline{(Version 4.11)}
@y
\centerline{(Version 4.11 [\TeX~Live])}
@z
-@x
+@x [0.0] l.36
\def\botofcontents{\vfill
@y
\def\covernote{\vbox{%
@z
-@x
+@x [0.0] l.49
}
@y
}}\datecontentspage
@z
-@x
+@x [1.1] l.64
@d banner "This is CTANGLE (Version 4.11)"
@y
@d banner "This is CTANGLE, Version 4.11"
/* will be extended by the \TeX~Live |versionstring| */
@z
-@x
+@x [1.2] l.90
if (show_banner) puts(banner); /* print a ``banner line'' */
@y
if (show_banner) cb_show_banner(); /* print a ``banner line'' */
@z
-@x
+@x [1.3] l.101
@i common.h
@y
@i comm-w2c.h
@z
-@x
+@x [2.20] l.129
@ @d max_texts 4000 /* number of replacement texts, must be less than 10240 */
@d max_toks 270000 /* number of bytes in compressed \CEE/ code */
@y
@@ -67,37 +67,37 @@
@d max_toks 1000000 /* number of bytes in compressed \CEE/ code */
@z
-@x
+@x [3.29] l.237
if (tok_ptr+2>tok_mem_end) overflow("token");
@y
if (tok_ptr+2>tok_mem_end) overflow(_("token"));
@z
-@x
+@x [4.35] l.320
if (stack_ptr==stack_end) overflow("stack");
@y
if (stack_ptr==stack_end) overflow(_("stack"));
@z
-@x
+@x [4.40] l.412
printf("%s","\n! Not present: <");
@y
printf("%s",_("\n! Not present: <"));
@z
-@x
+@x [5.47] l.510
else overflow("output files");
@y
else overflow(_("output files"));
@z
-@x
+@x [6.48] l.526
printf("%s","\n! No program text was specified."); mark_harmless();
@y
printf("%s",_("\n! No program text was specified.")); mark_harmless();
@z
-@x
+@x [6.48] l.532
"\nWriting the output file (%s):" : @|
"\nWriting the output files: (%s)",C_file_name);
@y
@@ -105,13 +105,13 @@
_("\nWriting the output files: (%s)"),C_file_name);
@z
-@x
+@x [6.48] l.542
printf("%s","Done.");
@y
printf("%s",_("Done."));
@z
-@x
+@x [6.50] l.556
@<Write all the named output files@>=
for (an_output_file=end_output_files; an_output_file>cur_out_file;) {
an_output_file--;
@@ -154,13 +154,13 @@ if (check_for_change)
strcpy(check_file_name,""); /* We want to get rid of the temporary file */
@z
-@x
+@x [6.54] l.616
else if (a<050000) confusion("macro defs have strange char");
@y
else if (a<050000) confusion(_("macro defs have strange char"));
@z
-@x
+@x [6.59] l.703
@ @<Case of an identifier@>=@t\1\quad@>
@y
@ Nowadays, most computer files are encoded in some form of ``Unicode''. A very
@@ -192,7 +192,7 @@ quarter) with its two-byte encoding \.{c2 bc}.
@<Case of an identifier@>=@t\1\quad@>
@z
-@x
+@x [6.59] l.708
if ((eight_bits)(*j)<0200) C_putc(*j);
@^high-bit character handling@>
else C_printf("%s",translit[(eight_bits)(*j)-0200]);
@@ -209,91 +209,91 @@ quarter) with its two-byte encoding \.{c2 bc}.
else C_putc(*j);
@z
-@x
+@x [7.67] l.840
err_print("! Input ended in mid-comment");
@y
err_print(_("! Input ended in mid-comment"));
@z
-@x
+@x [7.67] l.853
err_print("! Section name ended in mid-comment"); loc--;
@y
err_print(_("! Section name ended in mid-comment")); loc--;
@z
-@x
+@x [8.74] l.1004
err_print("! String didn't end"); loc=limit; break;
@y
err_print(_("! String didn't end")); loc=limit; break;
@z
-@x
+@x [8.74] l.1008
err_print("! Input ended in middle of string"); loc=buffer; break;
@y
err_print(_("! Input ended in middle of string")); loc=buffer; break;
@z
-@x
+@x [8.74] l.1026
printf("%s","\n! String too long: ");
@y
printf("%s",_("\n! String too long: "));
@z
-@x
+@x [8.75] l.1041
case translit_code: err_print("! Use @@l in limbo only"); continue;
@y
case translit_code: err_print(_("! Use @@l in limbo only")); continue;
@z
-@x
+@x [8.75] l.1046
err_print("! Double @@ should be used in control text");
@y
err_print(_("! Double @@ should be used in control text"));
@z
-@x
+@x [8.76] l.1070
err_print("! Double @@ should be used in ASCII constant");
@y
err_print(_("! Double @@ should be used in ASCII constant"));
@z
-@x
+@x [8.76] l.1076
err_print("! String didn't end"); loc=limit-1; break;
@y
err_print(_("! String didn't end")); loc=limit-1; break;
@z
-@x
+@x [8.79] l.1108
err_print("! Input ended in section name");
@y
err_print(_("! Input ended in section name"));
@z
-@x
+@x [8.79] l.1121
printf("%s","\n! Section name too long: ");
@y
printf("%s",_("\n! Section name too long: "));
@z
-@x
+@x [8.80] l.1135
err_print("! Section name didn't end"); break;
@y
err_print(_("! Section name didn't end")); break;
@z
-@x
+@x [8.80] l.1139
err_print("! Nesting of section names not allowed"); break;
@y
err_print(_("! Nesting of section names not allowed")); break;
@z
-@x
+@x [8.81] l.1153
if (loc>=limit) err_print("! Verbatim string didn't end");
@y
if (loc>=limit) err_print(_("! Verbatim string didn't end"));
@z
-@x
+@x [9.82] l.1177
@d app_repl(c) {
if (tok_ptr==tok_mem_end) overflow("token");
else *(tok_ptr++)=(eight_bits)c;
@@ -305,55 +305,55 @@ if (loc>=limit) err_print(_("! Verbatim string didn't end"));
}
@z
-@x
+@x [9.83] l.1204
if (text_ptr>text_info_end) overflow("text");
@y
if (text_ptr>text_info_end) overflow(_("text"));
@z
-@x
+@x [9.86] l.1250
case output_defs_code: if (t!=section_name) err_print("! Misplaced @@h");
@y
case output_defs_code: if (t!=section_name) err_print(_("! Misplaced @@h"));
@z
-@x
+@x [9.86] l.1268
err_print("! @@d, @@f and @@c are ignored in C text"); continue;
@y
err_print(_("! @@d, @@f and @@c are ignored in C text")); continue;
@z
-@x
+@x [9.87] l.1278
if (*try_loc=='=') err_print ("! Missing `@@ ' before a named section");
@y
if (*try_loc=='=') err_print (_("! Missing `@@ ' before a named section"));
@z
-@x
+@x [9.88] l.1295
else err_print("! Double @@ should be used in string");
@y
else err_print(_("! Double @@ should be used in string"));
@z
-@x
+@x [9.89] l.1344
default: err_print("! Unrecognized escape sequence");
@y
default: err_print(_("! Unrecognized escape sequence"));
@z
-@x
+@x [10.93] l.1417
err_print("! Definition flushed, must start with identifier");
@y
err_print(_("! Definition flushed, must start with identifier"));
@z
-@x
+@x [10.100] l.1498
err_print("! Double @@ should be used in control text");
@y
err_print(_("! Double @@ should be used in control text"));
@z
-@x
+@x [10.100] l.1501
} @=/* otherwise fall through */@>@;
default: err_print("! Double @@ should be used in limbo");
@y
@@ -361,19 +361,19 @@ case output_defs_code: if (t!=section_name) err_print(_("! Misplaced @@h"));
default: err_print(_("! Double @@ should be used in limbo"));
@z
-@x
+@x [10.102] l.1516
err_print("! Improper hex number following @@l");
@y
err_print(_("! Improper hex number following @@l"));
@z
-@x
+@x [10.102] l.1526
err_print("! Replacement string in @@l too long");
@y
err_print(_("! Replacement string in @@l too long"));
@z
-@x
+@x [10.103] l.1540
puts("\nMemory usage statistics:");
printf("%td names (out of %ld)\n",@^system dependencies@>
(ptrdiff_t)(name_ptr-name_dir),(long)max_names);
@@ -393,7 +393,7 @@ case output_defs_code: if (t!=section_name) err_print(_("! Misplaced @@h"));
printf(_("%td tokens (out of %ld)\n"),
@z
-@x
+@x [11.104] l.1551
@** Index.
@y
@** Extensions to {\tentex CWEB}. The following sections introduce new or
@@ -404,7 +404,7 @@ Care has been taken to keep the original section numbering intact, so this new
material should nicely integrate with the original ``\&{104.~Index}.''
@* Output file update. Most \CEE/ projects are controlled by a \.{Makefile}
-that automatically takes care of the temporal dependecies between the different
+that automatically takes care of the temporal dependencies between the different
source modules. It may be convenient that \.{CWEB} doesn't create new output
for all existing files, when there are only changes to some of them. Thus the
\.{make} process will only recompile those modules where necessary. You can
diff --git a/Build/source/texk/web2c/cwebdir/ctwill-w2c.ch b/Build/source/texk/web2c/cwebdir/ctwill-w2c.ch
index f7e4895aeeb..de038897845 100644
--- a/Build/source/texk/web2c/cwebdir/ctwill-w2c.ch
+++ b/Build/source/texk/web2c/cwebdir/ctwill-w2c.ch
@@ -16,7 +16,7 @@
@q Please send comments, suggestions, etc. to tex-k@@tug.org. @>
-@x
+@x [0.0] l.1
% This file is part of CWEB.
% This program by Silvio Levy and Donald E. Knuth
% is based on a program by Knuth.
@@ -26,7 +26,7 @@
% It's somewhat flaky, so you probably shouldn't try to use it.
@z
-@x
+@x [0.0] l.23
% Here is TeX material that gets inserted after \input cwebmac
@y
% Here is TeX material that gets inserted after \input ctwimac
@@ -34,38 +34,38 @@
\datethis % Put timestamp before section 1
@z
-@x
+@x [0.0] l.35
\def\title{CWEAVE (Version 4.11)}
@y
\def\Kpathsea/{{\mc KPATHSEA\spacefactor1000}} \ifacro\sanitizecommand\Kpathsea{KPATHSEA}\fi
\def\title{CTWILL (Version 4.11 [\TeX~Live])}
@z
-@x
+@x [0.0] l.37
\centerline{\titlefont The {\ttitlefont CWEAVE} processor}
@y
\centerline{\titlefont The {\ttitlefont CTWILL} processor}
@z
-@x
+@x [0.0] l.39
\centerline{(Version 4.11)}
@y
\centerline{(Version 4.11 [\TeX~Live])}
@z
-@x
+@x [0.0] l.41
\def\botofcontents{\vfill
@y
\def\covernote{\vbox{%
@z
-@x
+@x [0.0] l.54
}
@y
}}\datecontentspage
@z
-@x
+@x [1.1] l.59
This is the \.{CWEAVE} program by Silvio Levy and Donald E. Knuth,
based on \.{WEAVE} by Knuth.
We are thankful to Steve Avery,
@@ -105,25 +105,25 @@ modified. The version number parallels the corresponding version of \.{CWEAVE}.
/* will be extended by the \TeX~Live |versionstring| */
@z
-@x
+@x [1.2] l.94
program=cweave;
@y
program=ctwill;
@z
-@x
+@x [1.2] l.98
if (show_banner) puts(banner); /* print a ``banner line'' */
@y
if (show_banner) cb_show_banner(); /* print a ``banner line'' */
@z
-@x
+@x [1.3] l.112
@i common.h
@y
@i comm-w2c.h
@z
-@x
+@x [2.21] l.183
turned on during the first phase.
@<Private...@>=
@@ -132,19 +132,19 @@ static boolean change_exists; /* has any section changed? */
turned on during the first phase---NOT!
@z
-@x
+@x [2.23] l.217
@ @d max_refs 30000 /* number of cross-references; must be less than 65536 */
@y
@ @d max_refs 65535 /* number of cross-references; must be less than 65536 */
@z
-@x
+@x [2.25] l.246
@d append_xref(c) if (xref_ptr==xmem_end) overflow("cross-reference");
@y
@d append_xref(c) if (xref_ptr==xmem_end) overflow(_("cross-reference"));
@z
-@x
+@x [2.30] l.337
@d max_toks 30000 /* number of symbols in \CEE/ texts being parsed;
must be less than 65536 */
@d max_texts 8000 /* number of phrases in \CEE/ texts being parsed;
@@ -156,14 +156,14 @@ turned on during the first phase---NOT!
must be less than 10240 */
@z
-@x
+@x [2.32] l.357
@ Here are the two procedures needed to complete |id_lookup|:
@y
@ Here are the two procedures needed to complete |id_lookup|:
@s perm_meaning int
@z
-@x
+@x [2.32] l.374
p->xref=(void *)xmem;
@y
p->xref=(void *)xmem;
@@ -177,7 +177,7 @@ turned on during the first phase---NOT!
}
@z
-@x
+@x [2.33] l.377
@ And here's a small helper function to simplify the code.
@d update_node(p) (p)->xref=(void *)xref_ptr
@@ -188,7 +188,7 @@ turned on during the first phase---NOT!
@d get_meaning(p) (p)-name_dir+cur_meaning
@z
-@x
+@x [2.34] l.436
id_lookup("extern",NULL,int_like);
@y
@#
@@ -196,7 +196,7 @@ ext_loc=id_lookup("extern",NULL,int_like)-name_dir;
@#
@z
-@x
+@x [2.34] l.449
id_lookup("int",NULL,raw_int);
@y
@#
@@ -204,7 +204,7 @@ int_loc=id_lookup("int",NULL,raw_int)-name_dir;
@#
@z
-@x
+@x [3.36] l.544
@d ord 0207 /* control code for `\.{@@'}' */
@d join 0210 /* control code for `\.{@@\&}' */
@d thin_space 0211 /* control code for `\.{@@,}' */
@@ -248,7 +248,7 @@ int_loc=id_lookup("int",NULL,raw_int)-name_dir;
@d new_section 0235 /* control code for `\.{@@\ }' and `\.{@@*}' */
@z
-@x
+@x [3.38] l.587
ccode['\'']=ord;
@y
ccode['\'']=ord;
@@ -256,7 +256,7 @@ ccode['$']=meaning; ccode['%']=temp_meaning; ccode['-']=suppress;
ccode['r']=ccode['R']=right_start;
@z
-@x
+@x [3.40] l.608
static eight_bits skip_TeX(void);
@ @c
@@ -269,7 +269,7 @@ part of all meanings.
@c
@z
-@x
+@x [3.41] l.614
if (loc>limit && get_line()==false) return;
@y
if (loc>limit && get_line()==false) return;
@@ -279,44 +279,44 @@ part of all meanings.
}
@z
-@x
+@x [4.43] l.670
\yskip\hang |xref_roman|, |xref_wildcard|, |xref_typewriter|, |TeX_string|,
@y
\yskip\hang |xref_roman|, |xref_wildcard|, |xref_typewriter|, |TeX_string|,
|meaning|, |suppress|,
@z
-@x
+@x [4.46] l.731
@d right_preproc 0217 /* ends a preprocessor command */
@y
@d right_preproc 0223 /* ends a preprocessor command */
@z
-@x
+@x [4.57] l.888
err_print("! String didn't end"); loc=limit; break;
@y
err_print(_("! String didn't end")); loc=limit; break;
@z
-@x
+@x [4.57] l.892
err_print("! Input ended in middle of string"); loc=buffer; break;
@y
err_print(_("! Input ended in middle of string")); loc=buffer; break;
@z
-@x
+@x [4.57] l.911
printf("%s","\n! String too long: ");
@y
printf("%s",_("\n! String too long: "));
@z
-@x
+@x [4.59] l.930
case translit_code: err_print("! Use @@l in limbo only"); continue;
@y
case translit_code: err_print(_("! Use @@l in limbo only")); continue;
@z
-@x
+@x [4.59] l.932
case underline: xref_switch=def_flag; continue;
@y
case underline: xref_switch=def_flag; continue;
@@ -324,38 +324,38 @@ part of all meanings.
case right_start: right_start_switch=true; continue;
@z
-@x
+@x [4.59] l.938
case xref_roman: case xref_wildcard: case xref_typewriter: case noop:
@y
case xref_roman: case xref_wildcard: case xref_typewriter: case noop:
case meaning: case suppress:
@z
-@x
+@x [4.62] l.968
err_print("! Input ended in section name");
@y
err_print(_("! Input ended in section name"));
@z
-@x
+@x [4.62] l.981
printf("%s","\n! Section name too long: ");
@y
printf("%s",_("\n! Section name too long: "));
@z
-@x
+@x [4.63] l.995
err_print("! Section name didn't end"); break;
@y
err_print(_("! Section name didn't end")); break;
@z
-@x
+@x [4.63] l.999
err_print("! Control codes are forbidden in section name"); break;
@y
err_print(_("! Control codes are forbidden in section name")); break;
@z
-@x
+@x [4.64] l.1009
skip_restricted(void)
{
@y
@@ -363,19 +363,19 @@ skip_restricted(void)
{ int c=ccode[(eight_bits)*(loc-1)];
@z
-@x
+@x [4.64] l.1016
err_print("! Control text didn't end"); loc=limit;
@y
err_print(_("! Control text didn't end")); loc=limit;
@z
-@x
+@x [4.64] l.1021
err_print("! Control codes are forbidden in control text");
@y
err_print(_("! Control codes are forbidden in control text"));
@z
-@x
+@x [4.64] l.1022
@.Control codes are forbidden...@>
@y
@.Control codes are forbidden...@>
@@ -383,68 +383,68 @@ skip_restricted(void)
else if (c==suppress && phase==2) @<Suppress mini-index entry@>@;
@z
-@x
+@x [4.66] l.1036
if (loc>=limit) err_print("! Verbatim string didn't end");
@y
if (loc>=limit) err_print(_("! Verbatim string didn't end"));
@z
-@x
+@x [5.68] l.1061
skip_limbo(); change_exists=false;
@y
skip_limbo();
@<Give a default title to the program, if necessary@>@;
@z
-@x
+@x [5.68] l.1064
changed_section[section_count]=change_exists;
/* the index changes if anything does */
@y
@z
-@x
+@x [5.70] l.1073
if (++section_count==max_sections) overflow("section number");
@y
if (++section_count==max_sections) overflow(_("section number"));
@z
-@x
+@x [5.70] l.1074
changed_section[section_count]=changing;
/* it will become |true| if any line changes */
@y
@z
-@x
+@x [5.70] l.1083
if (changed_section[section_count]) change_exists=true;
@y
@z
-@x
+@x [5.74] l.1162
case translit_code: err_print("! Use @@l in limbo only"); continue;
@y
case translit_code: err_print(_("! Use @@l in limbo only")); continue;
@z
-@x
+@x [5.74] l.1167
case xref_roman: case xref_wildcard: case xref_typewriter:
@y
case xref_roman: case xref_wildcard: case xref_typewriter:
case meaning: case suppress:
@z
-@x
+@x [5.79] l.1249
err_print("! Missing left identifier of @@s");
@y
err_print(_("! Missing left identifier of @@s"));
@z
-@x
+@x [5.79] l.1254
err_print("! Missing right identifier of @@s");
@y
err_print(_("! Missing right identifier of @@s"));
@z
-@x
+@x [5.82] l.1302
printf("%s","\n! Never defined: <");
print_section_name(p); putchar('>'); mark_harmless();
@y
@@ -452,7 +452,7 @@ if (loc>=limit) err_print(_("! Verbatim string didn't end"));
print_section_name(p); putchar('>'); mark_harmless();
@z
-@x
+@x [5.82] l.1308
printf("%s","\n! Never used: <");
print_section_name(p); putchar('>'); mark_harmless();
@y
@@ -460,7 +460,7 @@ if (loc>=limit) err_print(_("! Verbatim string didn't end"));
print_section_name(p); putchar('>'); mark_harmless();
@z
-@x
+@x [6.89] l.1397
@ In particular, the |finish_line| procedure is called near the very
beginning of phase two. We initialize the output variables in a slightly
tricky way so that the first line of the output file will be
@@ -494,7 +494,7 @@ tex_puts(proofing?"ctproofma":"ctwima");
*out_ptr='c';
@z
-@x
+@x [6.90] l.1414
@d out(c) {if (out_ptr>=out_buf_end) break_out(); *(++out_ptr)=c;}
@y
@d out(c)
@@ -508,102 +508,102 @@ tex_puts(proofing?"ctproofma":"ctwima");
}
@z
-@x
+@x [6.94] l.1462
printf("\n! Line had to be broken (output l. %d):\n",out_line);
@y
printf(_("\n! Line had to be broken (output l. %d):\n"),out_line);
@z
-@x
+@x [6.95] l.1471
|def_flag|, so it cannot have more than five decimal digits. If
the section is changed, we output `\.{\\*}' just after the number.
@y
|def_flag|, so it cannot have more than five decimal digits.
@z
-@x
+@x [6.96] l.1485
if (changed_section[n]) out_str("\\*");
@.\\*@>
@y
@z
-@x
+@x [7.99] l.1543
default: err_print("! Double @@ should be used in limbo");
@y
case right_start: right_start_switch=true; break;
default: err_print(_("! Double @@ should be used in limbo"));
@z
-@x
+@x [7.101] l.1585
@d app_tok(c) {if (tok_ptr+2>tok_mem_end) overflow("token"); *(tok_ptr++)=c;}
@y
@d app_tok(c) {if (tok_ptr+2>tok_mem_end) overflow(_("token")); *(tok_ptr++)=c;}
@z
-@x
+@x [7.101] l.1597
err_print("! Input ended in mid-comment");
@y
err_print(_("! Input ended in mid-comment"));
@z
-@x
+@x [7.101] l.1602
if (bal>1) err_print("! Missing } in comment");
@y
if (bal>1) err_print(_("! Missing } in comment"));
@z
-@x
+@x [7.101] l.1618
else {err_print("! Extra } in comment");
@y
else {err_print(_("! Extra } in comment"));
@z
-@x
+@x [7.102] l.1630
if (bal>1) err_print("! Missing } in comment");
@y
if (bal>1) err_print(_("! Missing } in comment"));
@z
-@x
+@x [7.103] l.1638
err_print("! Illegal use of @@ in comment");
@y
err_print(_("! Illegal use of @@ in comment"));
@z
-@x
+@x [8.106] l.1755
@d attr_head 69 /* denotes beginning of attribute */
@y
@d attr_head 69 /* denotes beginning of attribute */
@d title 70 /* program name or header name in a ``meaning'' */
@z
-@x
+@x [8.110] l.2129
@i prod.w
@y
@i prod-twill.w
@z
-@x
+@x [9.113] l.2179
static scrap scrap_info[max_scraps]; /* memory array for scraps */
@y
static scrap scrap_info[max_scraps]; /* memory array for scraps */
static scrap null_scrap; /* a scrap with empty translation */
@z
-@x
+@x [9.114] l.2188
@ @<Set init...@>=
@y
@ @<Set init...@>=
null_scrap.trans=&tok_start[0];
@z
-@x
+@x [9.116] l.2249
update_terminal();
@y
puts("|"); update_terminal();
@z
-@x
+@x [9.124] l.2560
the |for| loop below.
@c
@@ -618,7 +618,7 @@ static token_pointer tok_loc; /* where the first identifier appears */
@#
@z
-@x
+@x [9.124] l.2568
token_pointer tok_loc; /* pointer to |tok_value| */
if ((tok_loc=find_first_ident(p->trans))<=operator_found)
return; /* this should not happen */
@@ -626,12 +626,12 @@ static token_pointer tok_loc; /* where the first identifier appears */
if (tok_loc<=operator_found) return; /* this should not happen */
@z
-@x
+@x [9.125] l.2597
token_pointer tok_loc; /* where the first identifier appears */
@y
@z
-@x
+@x [9.128] l.2651
@<Cases for |exp|@>=
if (cat1==lbrace || cat1==int_like || cat1==decl) {
make_underlined(pp); big_app(dindent); big_app1(pp);
@@ -646,7 +646,7 @@ if(cat1==lbrace || cat1==int_like || cat1==decl) {
}
@z
-@x
+@x [9.128] l.2666
make_underlined (pp); squash(pp,2,tag,-1,7);
@y
make_underlined (pp);
@@ -657,7 +657,7 @@ if(cat1==lbrace || cat1==int_like || cat1==decl) {
squash(pp,2,tag,-1,7);
@z
-@x
+@x [9.138] l.2755
@ @<Cases for |decl_head|@>=
if (cat1==comma) {
big_app2(pp); app(opt); app('9'); reduce(pp,2,decl_head,-1,33);
@@ -700,7 +700,7 @@ else if (cat1==int_like || cat1==lbrace || cat1==decl) {
else if (cat1==semi) squash(pp,2,decl,-1,39);
@z
-@x
+@x [9.139] l.2777
@ @<Cases for |decl|@>=
if (cat1==decl) {
big_app1_insert(pp,force); reduce(pp,2,decl,-1,40);
@@ -719,13 +719,13 @@ else if (cat1==stmt || cat1==function) {
}
@z
-@x
+@x [9.141] l.2803
make_underlined(pp+1); make_reserved(pp+1);
@y
make_underlined(pp+1); make_reserved(pp+1); make_ministring(pp+1);
@z
-@x
+@x [9.143] l.2834
@ @<Cases for |fn_decl|@>=
if (cat1==decl) {
big_app1_insert(pp,force); reduce(pp,2,fn_decl,0,51);
@@ -748,14 +748,14 @@ else if (cat1==stmt) {
}
@z
-@x
+@x [9.153] l.2938
big_app1_insert(pp,dindent); reduce(pp,2,fn_decl,0,73);
@y
big_app1(pp); if (indent_param_decl) big_app(dindent);
big_app1(pp+1); reduce(pp,2,fn_decl,0,73);
@z
-@x
+@x [9.156] l.2964
big_app1_insert(pp, (cat1==decl || cat1==function) ? big_force :
force_lines ? force : break_space); reduce(pp,2,cat1,-1,76);
@y
@@ -764,7 +764,7 @@ else if (cat1==stmt) {
( force_lines ? force : break_space ) ); reduce(pp,2,cat1,-1,76);
@z
-@x
+@x [9.158] l.2972
if (cat1==define_like) make_underlined(pp+2);
@y
if (cat1==define_like) { /* \#\&{define} is analogous to \&{extern} */
@@ -776,7 +776,7 @@ if (cat1==define_like) { /* \#\&{define} is analogous to \&{extern} */
}
@z
-@x
+@x [9.167] l.3069
if (cat1==prelangle) reduce(pp+1,0,langle,1,100);
else reduce(pp,0,exp,-2,101);
@y
@@ -784,13 +784,13 @@ if (cat1==prelangle) reduce(pp+1,0,langle,1,121);
else reduce(pp,0,exp,-2,122);
@z
-@x
+@x [9.168] l.3074
big_app1_insert(pp,' '); reduce(pp,2,else_like,-2,102);
@y
big_app1_insert(pp,' '); reduce(pp,2,else_like,-2,123);
@z
-@x
+@x [9.173] l.3106
@ @<Cases for |typedef_like|@>=
if ((cat1==int_like || cat1==cast) && (cat2==comma || cat2==semi))
reduce(pp+1,0,exp,-1,115);
@@ -826,56 +826,56 @@ if (cat1==decl_head) {
(cat3==semi || cat3==comma)) reduce(pp+2,0,exp,1,202);
@z
-@x
+@x [9.186] l.3293
overflow("token");
@y
overflow(_("token"));
@z
-@x
+@x [9.186] l.3297
overflow("text");
@y
overflow(_("text"));
@z
-@x
+@x [9.190] l.3352
if (tok_ptr+6>tok_mem_end) overflow("token");
@y
if (tok_ptr+6>tok_mem_end) overflow(_("token"));
@z
-@x
+@x [9.191] l.3358
printf("\nIrreducible scrap sequence in section %d:",(int)section_count);
@y
printf(_("\nIrreducible scrap sequence in section %d:"),(int)section_count);
@z
-@x
+@x [9.192] l.3368
printf("\nTracing after l. %d:\n",cur_line); mark_harmless();
@y
printf(_("\nTracing after l. %d:\n"),cur_line); mark_harmless();
@z
-@x
+@x [10.196] l.3454
case ignore: case xref_roman: case xref_wildcard:
@y
case ignore: case xref_roman: case xref_wildcard:
case meaning: case suppress:
@z
-@x
+@x [10.197] l.3500
overflow("scrap/token/text");
@y
overflow(_("scrap/token/text"));
@z
-@x
+@x [10.199] l.3585
else err_print("! Double @@ should be used in strings");
@y
else err_print(_("! Double @@ should be used in strings"));
@z
-@x
+@x [10.202] l.3650
else app_scrap(p->ilk,maybe_math);
}
}
@@ -886,62 +886,62 @@ if (cat1==decl_head) {
@<Flag the usage of this identifier, for the mini-index@>@;
@z
-@x
+@x [10.203] l.3668
if (next_control!='|') err_print("! Missing '|' after C text");
@y
if (next_control!='|') err_print(_("! Missing '|' after C text"));
@z
-@x
+@x [10.204] l.3683
to \.{\\PB}. Although \.{cwebmac} ignores \.{\\PB}, other macro packages
@y
to \.{\\PB}. Although \.{ctwimac} ignores \.{\\PB}, other macro packages
@z
-@x
+@x [10.205] l.3713
app(tok_flag+(int)(p-tok_start));
@y
app(tok_flag+(int)(p-tok_start));
app(inserted);
@z
-@x
+@x [11.211] l.3809
if (stack_ptr==stack_end) overflow("stack");
@y
if (stack_ptr==stack_end) overflow(_("stack"));
@z
-@x
+@x [11.224] l.4132
printf("%s","\n! Illegal control code in section name: <");
@y
printf("%s",_("\n! Illegal control code in section name: <"));
@z
-@x
+@x [11.225] l.4147
printf("%s","\n! C text in section name didn't end: <");
@y
printf("%s",_("\n! C text in section name didn't end: <"));
@z
-@x
+@x [11.225] l.4159
if (j>buffer+long_buf_size-3) overflow("buffer");
@y
if (j>buffer+long_buf_size-3) overflow(_("buffer"));
@z
-@x
+@x [11.226] l.4167
if (j>buffer+long_buf_size-4) overflow("buffer");
@y
if (j>buffer+long_buf_size-4) overflow(_("buffer"));
@z
-@x
+@x [12.227] l.4182
if (show_progress) printf("%s","\nWriting the output file...");
@y
if (show_progress) printf("%s",_("\nWriting the output file..."));
@z
-@x
+@x [12.227] l.4184
section_count=0; format_visible=true; copy_limbo();
@y
temp_switch=false; temp_meaning_ptr=temp_meaning_stack;
@@ -949,7 +949,7 @@ temp_switch=false; temp_meaning_ptr=temp_meaning_stack;
section_count=0; format_visible=true; right_start_switch=false; copy_limbo();
@z
-@x
+@x [12.229] l.4213
static boolean group_found=false; /* has a starred section occurred? */
@ @<Translate the current section@>= {
@@ -966,12 +966,12 @@ static boolean temp_switch; /* has `\.{@@\%}' occurred recently? */
top_usage=usage_sentinel;
@z
-@x
+@x [12.231] l.4231
If the section has changed, we put \.{\\*} just after the section number.
@y
@z
-@x
+@x [12.231] l.4234
if (*(loc-1)!='*') out_str("\\M");
@y
if (*(loc-1)!='*') {
@@ -983,7 +983,7 @@ if (*(loc-1)!='*') {
}
@z
-@x
+@x [12.231] l.4249
@.\\N@>
@y
@.\\N@>
@@ -993,14 +993,14 @@ if (*(loc-1)!='*') {
}
@z
-@x
+@x [12.231] l.4256
out('{'); out_section(section_count); out('}');
@y
out('{'); out_section(section_count); out('}');
flush_buffer(out_ptr,false,false);
@z
-@x
+@x [12.232] l.4264
case '@@': out('@@'); break;
@y
case '@@': out('@@'); break;
@@ -1008,26 +1008,26 @@ flush_buffer(out_ptr,false,false);
case right_start: right_start_switch=true; break;
@z
-@x
+@x [12.232] l.4267
case section_name: loc-=2; next_control=get_next(); /* skip to \.{@@>} */
@y
case meaning: case suppress:
case section_name: loc-=2; next_control=get_next(); /* reprocess */
@z
-@x
+@x [12.232] l.4269
err_print("! TeX string should be in C text only"); break;
@y
err_print(_("! TeX string should be in C text only")); break;
@z
-@x
+@x [12.232] l.4275
err_print("! You can't do that in TeX text"); break;
@y
err_print(_("! You can't do that in TeX text")); break;
@z
-@x
+@x [12.233] l.4289
outer_parse(); finish_C(format_visible); format_visible=true;
doing_format=false;
}
@@ -1039,20 +1039,20 @@ flush_buffer(out_ptr,false,false);
}
@z
-@x
+@x [12.236] l.4341
@<Start a macro...@>= {
@y
@<Start a macro...@>= {
is_macro=true;
@z
-@x
+@x [12.236] l.4347
err_print("! Improper macro definition");
@y
err_print(_("! Improper macro definition"));
@z
-@x
+@x [12.236] l.4348
@.Improper macro definition@>
else {
app('$'); app_cur_id(false);
@@ -1064,7 +1064,7 @@ flush_buffer(out_ptr,false,false);
def_diff=(*loc!='(');
@z
-@x
+@x [12.236] l.4360
} @=/* otherwise fall through */@>@;
default: err_print("! Improper macro definition"); break;
@y
@@ -1072,7 +1072,7 @@ flush_buffer(out_ptr,false,false);
default: err_print(_("! Improper macro definition")); break;
@z
-@x
+@x [12.236] l.4370
@ @<Start a format...@>= {
doing_format=true;
@y
@@ -1082,25 +1082,25 @@ flush_buffer(out_ptr,false,false);
is_macro=false;
@z
-@x
+@x [12.237] l.4387
if (scrap_ptr!=scrap_info+2) err_print("! Improper format definition");
@y
if (scrap_ptr!=scrap_info+2) err_print(_("! Improper format definition"));
@z
-@x
+@x [12.240] l.4422
err_print("! You need an = sign after the section name");
@y
err_print(_("! You need an = sign after the section name"));
@z
-@x
+@x [12.241] l.4444
err_print("! You can't do that in C text");
@y
err_print(_("! You can't do that in C text"));
@z
-@x
+@x [12.246] l.4514
out_str("\\fi"); finish_line();
@.\\fi@>
@y
@@ -1111,13 +1111,13 @@ out_str("}\\FI"); finish_line();
@.\\FI@>
@z
-@x
+@x [13.247] l.4535
if (show_progress) printf("%s","\nWriting the index...");
@y
if (show_progress) printf("%s",_("\nWriting the index..."));
@z
-@x
+@x [13.247] l.4537
if (change_exists) {
@<Tell about changed sections@>@;
finish_line(); flush_buffer(out_buf,false,false);
@@ -1126,32 +1126,32 @@ out_str("}\\FI"); finish_line();
@y
@z
-@x
+@x [13.247] l.4546
fatal("! Cannot open index file ",idx_file_name);
@y
fatal(_("! Cannot open index file "),idx_file_name);
@z
-@x
+@x [13.247] l.4558
fatal("! Cannot open section file ",scn_file_name);
@y
fatal(_("! Cannot open section file "),scn_file_name);
@z
-@x
+@x [13.247] l.4570
fclose(active_file);
@y
fclose(active_file); active_file=tex_file=NULL;
if (check_for_change) @<Update the result when it has changed@>@;
@z
-@x
+@x [13.247] l.4573
printf("%s","Done.");
@y
printf("%s",_("Done."));
@z
-@x
+@x [13.249] l.4581
the index section itself.
@<Tell about changed sections@>=
@@ -1170,13 +1170,13 @@ out('.');
the index section itself---NOT!
@z
-@x
+@x [13.257] l.4725
if (sort_ptr>=scrap_info_end) overflow("sorting");
@y
if (sort_ptr>=scrap_info_end) overflow(_("sorting"));
@z
-@x
+@x [13.262] l.4770
@ @<Output the name...@>=
switch (cur_name->ilk) {@+char *p; /* index into |byte_mem| */@+@t}\6{\4@>
@y
@@ -1187,20 +1187,20 @@ rest of the job. Compare this code with section |@<Mini-output...@>|.
switch (cur_name->ilk) {
@z
-@x
+@x [13.262] l.4772
case normal: case func_template:
@y
case normal:
@z
-@x
+@x [13.262] l.4774
else {@+boolean all_caps=true;@+@t}\6{@>
@y
else {@+boolean all_caps=true;@+char *p;
/* index into |byte_mem| */ @+@t}\6{@>
@z
-@x
+@x [13.262] l.4789
case roman: not_an_identifier: out_name(cur_name,false); goto name_done;
case custom:
out_str("$\\");
@@ -1215,13 +1215,13 @@ not_an_identifier: out_name(cur_name,false); goto name_done;
@.\\\$@>
@z
-@x
+@x [13.262] l.4799
out_name(cur_name,true);
@y
out_name(cur_name,proofing);
@z
-@x
+@x [13.269] l.4862
puts("\nMemory usage statistics:");
@.Memory usage statistics:@>
printf("%td names (out of %ld)\n",@^system dependencies@>
@@ -1270,7 +1270,7 @@ out_name(cur_name,proofing);
(ptrdiff_t)(max_sort_ptr-scrap_info),(long)max_scraps);
@z
-@x
+@x [14.270] l.4884
@** Index.
@y
@q Section 270. @>
@@ -1927,7 +1927,7 @@ a function block.
order_decl_stmt=true;
@* Output file update. Most \CEE/ projects are controlled by a \.{Makefile}
-that automatically takes care of the temporal dependecies between the different
+that automatically takes care of the temporal dependencies between the different
source modules. It may be convenient that \.{CWEB} doesn't create new output
for all existing files, when there are only changes to some of them. Thus the
\.{make} process will only recompile those modules where necessary. You can
diff --git a/Build/source/texk/web2c/cwebdir/cweav-w2c.ch b/Build/source/texk/web2c/cwebdir/cweav-w2c.ch
index 9ddc3f00f79..73b9ab4b2c9 100644
--- a/Build/source/texk/web2c/cwebdir/cweav-w2c.ch
+++ b/Build/source/texk/web2c/cwebdir/cweav-w2c.ch
@@ -16,62 +16,62 @@
@q Please send comments, suggestions, etc. to tex-k@@tug.org. @>
-@x
+@x [0.0] l.35
\def\title{CWEAVE (Version 4.11)}
@y
\def\title{CWEAVE (Version 4.11 [\TeX~Live])}
@z
-@x
+@x [0.0] l.39
\centerline{(Version 4.11)}
@y
\centerline{(Version 4.11 [\TeX~Live])}
@z
-@x
+@x [0.0] l.41
\def\botofcontents{\vfill
@y
\def\covernote{\vbox{%
@z
-@x
+@x [0.0] l.54
}
@y
}}\datecontentspage
@z
-@x
+@x [1.1] l.70
@d banner "This is CWEAVE (Version 4.11)"
@y
@d banner "This is CWEAVE, Version 4.11"
/* will be extended by the \TeX~Live |versionstring| */
@z
-@x
+@x [1.2] l.98
if (show_banner) puts(banner); /* print a ``banner line'' */
@y
if (show_banner) cb_show_banner(); /* print a ``banner line'' */
@z
-@x
+@x [1.3] l.112
@i common.h
@y
@i comm-w2c.h
@z
-@x
+@x [2.23] l.217
@ @d max_refs 30000 /* number of cross-references; must be less than 65536 */
@y
@ @d max_refs 65535 /* number of cross-references; must be less than 65536 */
@z
-@x
+@x [2.25] l.246
@d append_xref(c) if (xref_ptr==xmem_end) overflow("cross-reference");
@y
@d append_xref(c) if (xref_ptr==xmem_end) overflow(_("cross-reference"));
@z
-@x
+@x [2.30] l.337
@d max_toks 30000 /* number of symbols in \CEE/ texts being parsed;
must be less than 65536 */
@d max_texts 8000 /* number of phrases in \CEE/ texts being parsed;
@@ -83,97 +83,97 @@
must be less than 10240 */
@z
-@x
+@x [4.57] l.888
err_print("! String didn't end"); loc=limit; break;
@y
err_print(_("! String didn't end")); loc=limit; break;
@z
-@x
+@x [4.57] l.892
err_print("! Input ended in middle of string"); loc=buffer; break;
@y
err_print(_("! Input ended in middle of string")); loc=buffer; break;
@z
-@x
+@x [4.57] l.911
printf("%s","\n! String too long: ");
@y
printf("%s",_("\n! String too long: "));
@z
-@x
+@x [4.59] l.930
case translit_code: err_print("! Use @@l in limbo only"); continue;
@y
case translit_code: err_print(_("! Use @@l in limbo only")); continue;
@z
-@x
+@x [4.62] l.968
err_print("! Input ended in section name");
@y
err_print(_("! Input ended in section name"));
@z
-@x
+@x [4.62] l.981
printf("%s","\n! Section name too long: ");
@y
printf("%s",_("\n! Section name too long: "));
@z
-@x
+@x [4.63] l.995
err_print("! Section name didn't end"); break;
@y
err_print(_("! Section name didn't end")); break;
@z
-@x
+@x [4.63] l.999
err_print("! Control codes are forbidden in section name"); break;
@y
err_print(_("! Control codes are forbidden in section name")); break;
@z
-@x
+@x [4.64] l.1016
err_print("! Control text didn't end"); loc=limit;
@y
err_print(_("! Control text didn't end")); loc=limit;
@z
-@x
+@x [4.64] l.1021
err_print("! Control codes are forbidden in control text");
@y
err_print(_("! Control codes are forbidden in control text"));
@z
-@x
+@x [4.66] l.1036
if (loc>=limit) err_print("! Verbatim string didn't end");
@y
if (loc>=limit) err_print(_("! Verbatim string didn't end"));
@z
-@x
+@x [5.70] l.1073
if (++section_count==max_sections) overflow("section number");
@y
if (++section_count==max_sections) overflow(_("section number"));
@z
-@x
+@x [5.74] l.1162
case translit_code: err_print("! Use @@l in limbo only"); continue;
@y
case translit_code: err_print(_("! Use @@l in limbo only")); continue;
@z
-@x
+@x [5.79] l.1249
err_print("! Missing left identifier of @@s");
@y
err_print(_("! Missing left identifier of @@s"));
@z
-@x
+@x [5.79] l.1254
err_print("! Missing right identifier of @@s");
@y
err_print(_("! Missing right identifier of @@s"));
@z
-@x
+@x [5.82] l.1302
printf("%s","\n! Never defined: <");
print_section_name(p); putchar('>'); mark_harmless();
@y
@@ -181,7 +181,7 @@ if (loc>=limit) err_print(_("! Verbatim string didn't end"));
print_section_name(p); putchar('>'); mark_harmless();
@z
-@x
+@x [5.82] l.1308
printf("%s","\n! Never used: <");
print_section_name(p); putchar('>'); mark_harmless();
@y
@@ -189,7 +189,7 @@ if (loc>=limit) err_print(_("! Verbatim string didn't end"));
print_section_name(p); putchar('>'); mark_harmless();
@z
-@x
+@x [6.89] l.1397
@ In particular, the |finish_line| procedure is called near the very
beginning of phase two. We initialize the output variables in a slightly
tricky way so that the first line of the output file will be
@@ -218,61 +218,61 @@ tex_puts("cwebma");
*out_ptr='c';
@z
-@x
+@x [6.94] l.1462
printf("\n! Line had to be broken (output l. %d):\n",out_line);
@y
printf(_("\n! Line had to be broken (output l. %d):\n"),out_line);
@z
-@x
+@x [7.99] l.1543
default: err_print("! Double @@ should be used in limbo");
@y
default: err_print(_("! Double @@ should be used in limbo"));
@z
-@x
+@x [7.101] l.1585
@d app_tok(c) {if (tok_ptr+2>tok_mem_end) overflow("token"); *(tok_ptr++)=c;}
@y
@d app_tok(c) {if (tok_ptr+2>tok_mem_end) overflow(_("token")); *(tok_ptr++)=c;}
@z
-@x
+@x [7.101] l.1597
err_print("! Input ended in mid-comment");
@y
err_print(_("! Input ended in mid-comment"));
@z
-@x
+@x [7.101] l.1602
if (bal>1) err_print("! Missing } in comment");
@y
if (bal>1) err_print(_("! Missing } in comment"));
@z
-@x
+@x [7.101] l.1618
else {err_print("! Extra } in comment");
@y
else {err_print(_("! Extra } in comment"));
@z
-@x
+@x [7.102] l.1630
if (bal>1) err_print("! Missing } in comment");
@y
if (bal>1) err_print(_("! Missing } in comment"));
@z
-@x
+@x [7.103] l.1638
err_print("! Illegal use of @@ in comment");
@y
err_print(_("! Illegal use of @@ in comment"));
@z
-@x
+@x [8.110] l.2129
@i prod.w
@y
@i prod-cweave.w
@z
-@x
+@x [9.128] l.2651
@<Cases for |exp|@>=
if (cat1==lbrace || cat1==int_like || cat1==decl) {
make_underlined(pp); big_app(dindent); big_app1(pp);
@@ -286,7 +286,7 @@ if(cat1==lbrace || cat1==int_like || cat1==decl) {
}
@z
-@x
+@x [9.138] l.2755
@ @<Cases for |decl_head|@>=
if (cat1==comma) {
big_app2(pp); app(opt); app('9'); reduce(pp,2,decl_head,-1,33);
@@ -328,7 +328,7 @@ else if (cat1==int_like || cat1==lbrace || cat1==decl) {
else if (cat1==semi) squash(pp,2,decl,-1,39);
@z
-@x
+@x [9.139] l.2777
@ @<Cases for |decl|@>=
if (cat1==decl) {
big_app1_insert(pp,force); reduce(pp,2,decl,-1,40);
@@ -347,7 +347,7 @@ else if (cat1==stmt || cat1==function) {
}
@z
-@x
+@x [9.143] l.2834
@ @<Cases for |fn_decl|@>=
if (cat1==decl) {
big_app1_insert(pp,force); reduce(pp,2,fn_decl,0,51);
@@ -370,14 +370,14 @@ else if (cat1==stmt) {
}
@z
-@x
+@x [9.153] l.2938
big_app1_insert(pp,dindent); reduce(pp,2,fn_decl,0,73);
@y
big_app1(pp); if (indent_param_decl) big_app(dindent);
big_app1(pp+1); reduce(pp,2,fn_decl,0,73);
@z
-@x
+@x [9.156] l.2964
big_app1_insert(pp, (cat1==decl || cat1==function) ? big_force :
force_lines ? force : break_space); reduce(pp,2,cat1,-1,76);
@y
@@ -386,109 +386,109 @@ else if (cat1==stmt) {
( force_lines ? force : break_space ) ); reduce(pp,2,cat1,-1,76);
@z
-@x
+@x [9.186] l.3293
overflow("token");
@y
overflow(_("token"));
@z
-@x
+@x [9.186] l.3297
overflow("text");
@y
overflow(_("text"));
@z
-@x
+@x [9.190] l.3352
if (tok_ptr+6>tok_mem_end) overflow("token");
@y
if (tok_ptr+6>tok_mem_end) overflow(_("token"));
@z
-@x
+@x [9.191] l.3358
printf("\nIrreducible scrap sequence in section %d:",(int)section_count);
@y
printf(_("\nIrreducible scrap sequence in section %d:"),(int)section_count);
@z
-@x
+@x [9.192] l.3368
printf("\nTracing after l. %d:\n",cur_line); mark_harmless();
@y
printf(_("\nTracing after l. %d:\n"),cur_line); mark_harmless();
@z
-@x
+@x [10.197] l.3500
overflow("scrap/token/text");
@y
overflow(_("scrap/token/text"));
@z
-@x
+@x [10.199] l.3585
else err_print("! Double @@ should be used in strings");
@y
else err_print(_("! Double @@ should be used in strings"));
@z
-@x
+@x [10.203] l.3668
if (next_control!='|') err_print("! Missing '|' after C text");
@y
if (next_control!='|') err_print(_("! Missing '|' after C text"));
@z
-@x
+@x [11.211] l.3809
if (stack_ptr==stack_end) overflow("stack");
@y
if (stack_ptr==stack_end) overflow(_("stack"));
@z
-@x
+@x [11.224] l.4132
printf("%s","\n! Illegal control code in section name: <");
@y
printf("%s",_("\n! Illegal control code in section name: <"));
@z
-@x
+@x [11.225] l.4147
printf("%s","\n! C text in section name didn't end: <");
@y
printf("%s",_("\n! C text in section name didn't end: <"));
@z
-@x
+@x [11.225] l.4159
if (j>buffer+long_buf_size-3) overflow("buffer");
@y
if (j>buffer+long_buf_size-3) overflow(_("buffer"));
@z
-@x
+@x [11.226] l.4167
if (j>buffer+long_buf_size-4) overflow("buffer");
@y
if (j>buffer+long_buf_size-4) overflow(_("buffer"));
@z
-@x
+@x [12.227] l.4182
if (show_progress) printf("%s","\nWriting the output file...");
@y
if (show_progress) printf("%s",_("\nWriting the output file..."));
@z
-@x
+@x [12.232] l.4269
err_print("! TeX string should be in C text only"); break;
@y
err_print(_("! TeX string should be in C text only")); break;
@z
-@x
+@x [12.232] l.4275
err_print("! You can't do that in TeX text"); break;
@y
err_print(_("! You can't do that in TeX text")); break;
@z
-@x
+@x [12.236] l.4347
err_print("! Improper macro definition");
@y
err_print(_("! Improper macro definition"));
@z
-@x
+@x [12.236] l.4360
} @=/* otherwise fall through */@>@;
default: err_print("! Improper macro definition"); break;
@y
@@ -496,62 +496,62 @@ if (show_progress) printf("%s",_("\nWriting the output file..."));
default: err_print(_("! Improper macro definition")); break;
@z
-@x
+@x [12.237] l.4387
if (scrap_ptr!=scrap_info+2) err_print("! Improper format definition");
@y
if (scrap_ptr!=scrap_info+2) err_print(_("! Improper format definition"));
@z
-@x
+@x [12.240] l.4422
err_print("! You need an = sign after the section name");
@y
err_print(_("! You need an = sign after the section name"));
@z
-@x
+@x [12.241] l.4444
err_print("! You can't do that in C text");
@y
err_print(_("! You can't do that in C text"));
@z
-@x
+@x [13.247] l.4535
if (show_progress) printf("%s","\nWriting the index...");
@y
if (show_progress) printf("%s",_("\nWriting the index..."));
@z
-@x
+@x [13.247] l.4546
fatal("! Cannot open index file ",idx_file_name);
@y
fatal(_("! Cannot open index file "),idx_file_name);
@z
-@x
+@x [13.247] l.4558
fatal("! Cannot open section file ",scn_file_name);
@y
fatal(_("! Cannot open section file "),scn_file_name);
@z
-@x
+@x [13.247] l.4570
fclose(active_file);
@y
fclose(active_file); active_file=tex_file=NULL;
if (check_for_change) @<Update the result when it has changed@>@;
@z
-@x
+@x [13.247] l.4573
printf("%s","Done.");
@y
printf("%s",_("Done."));
@z
-@x
+@x [13.257] l.4725
if (sort_ptr>=scrap_info_end) overflow("sorting");
@y
if (sort_ptr>=scrap_info_end) overflow(_("sorting"));
@z
-@x
+@x [13.269] l.4862
puts("\nMemory usage statistics:");
@.Memory usage statistics:@>
printf("%td names (out of %ld)\n",@^system dependencies@>
@@ -595,7 +595,7 @@ if (check_for_change) @<Update the result when it has changed@>@;
(ptrdiff_t)(max_sort_ptr-scrap_info),(long)max_scraps);
@z
-@x
+@x [14.270] l.4884
@** Index.
@y
@** Extensions to {\tentex CWEB}. The following sections introduce new or
@@ -626,7 +626,7 @@ a function block.
order_decl_stmt=true;
@* Output file update. Most \CEE/ projects are controlled by a \.{Makefile}
-that automatically takes care of the temporal dependecies between the different
+that automatically takes care of the temporal dependencies between the different
source modules. It may be convenient that \.{CWEB} doesn't create new output
for all existing files, when there are only changes to some of them. Thus the
\.{make} process will only recompile those modules where necessary. You can
diff --git a/Build/source/texk/web2c/cwebdir/cwebacromac.tex b/Build/source/texk/web2c/cwebdir/cwebacromac.tex
index 4c12e413827..f8462d06a37 100644
--- a/Build/source/texk/web2c/cwebdir/cwebacromac.tex
+++ b/Build/source/texk/web2c/cwebdir/cwebacromac.tex
@@ -1,5 +1,5 @@
% hypertext macros for CWEB listings (in addition to cwebmac.tex)
-% Version 1.1 --- September 2023
+% Version 2.0 --- May 2024
\ifx\ifacrohint\undefined\endinput\fi % these are not standalone macros
\ifluatex % LuaTeX is almost like pdfTeX
\protected\def\pdfliteral {\pdfextension literal}
@@ -15,6 +15,19 @@
\let\pdfoutput=\outputmode
\fi % end of LuaTeX->pdfTeX redirection macros
+% Used in cwebmac.tex, pdfctwimac.tex, pdfproofmac.tex
+\def\tocpages{1} % Most programs have one-page Table-of-Contents
+\def\startpdf{\def\pagemode{/PageMode /UseOutlines}
+ \ifnum\contentspagenumber=0 \advance \pageno by -\tocpages
+ \def\pagelabels{/PageLabels << /Nums [ 0 << /S/D/St \tocpages >>
+ \the\pageno << /P(Contents) >> ] >>}
+ \else \twodigits=\pageno \pageno=\contentspagenumber
+ \advance \pageno by \tocpages \advance \twodigits by -\pageno
+ \def\pagelabels{/PageLabels << /Nums [ 0 << /S/D/St \the\pageno >>
+ \the\twodigits << /S/D/St \contentspagenumber >> ] >>} \fi
+ \ifpdflua\pdfcatalog{\pagemode\space\pagelabels}
+ \else \special{pdf: docview << \pagemode\space\pagelabels >>}\fi}
+
\ifacro % The following are general pdf macros
\def\thewidth{\the\wd0 \space}
\def\theheight{\the\ht\strutbox\space}
diff --git a/Build/source/texk/web2c/cwebdir/cwebmac.tex b/Build/source/texk/web2c/cwebdir/cwebmac.tex
index a59f15b4441..99e899476ce 100644
--- a/Build/source/texk/web2c/cwebdir/cwebmac.tex
+++ b/Build/source/texk/web2c/cwebdir/cwebmac.tex
@@ -1,8 +1,8 @@
% standard macros for CWEB listings (in addition to plain.tex)
-% Version 4.11 --- October 2023
+% Version 4.12 --- May 2024
\ifx\renewenvironment\undefined\else\endinput\fi % LaTeX will use other macros
-\xdef\fmtversion{\fmtversion+CWEB4.11}
-\chardef\cwebversion=4 \chardef\cwebrevision=11
+\xdef\fmtversion{\fmtversion+CWEB4.12}
+\chardef\cwebversion=4 \chardef\cwebrevision=12
\let\:=\. % preserve a way to get the dot accent
% (all other accents will still work as usual)
@@ -215,8 +215,8 @@
\def\T#1{\leavevmode % octal, hex or decimal constant
\hbox{$\def\?{\kern.2em}%$%
\let\ \, % C++ digit separator becomes a little white space
-% \def\$##1{\egroup_{\,\rm##1}\bgroup}% suffix to constant % versions < 3.67
- \def\$##1{\egroup_{\rm##1}\bgroup}% suffix to constant % in version 3.67
+% \def\$##1{\egroup_{\,\rm##1}\bgroup}% suffix to constant %$% versions < 3.67
+ \def\$##1{\egroup_{\rm##1}\bgroup}% suffix to constant %$% in version 3.67
\def\_{\cdot 10^{\aftergroup}}% power of ten (via dirty trick)
\let\~=\oct \let\^=\hex \let\\=\bin {#1}$}}%$%
\def\U{\note{This code is used in section}} % xref for use of a section
@@ -276,8 +276,6 @@
\def\title{\expandafter\uppercase\expandafter{\jobname}}
\def\topofcontents{\centerline{\titlefont\title}\vskip.7in
\vfill} % this material will start the table of contents page
-\def\startpdf{\ifpdf \ifpdflua\pdfcatalog{/PageMode /UseOutlines}
- \else {\special{pdf: docview << /PageMode /UseOutlines >>}}\fi\fi}
\def\botofcontents{\vfill
\centerline{\covernote}} % this material will end the table of contents page
\def\covernote{}
@@ -383,12 +381,12 @@
% \ifodd\pageno\else\titletrue\null\vfill\eject\fi % for duplex printers
\rightskip 0pt \hyphenpenalty 50 \tolerance 200
\setpage \output={\normaloutput\page\lheader\rheader}
- \titletrue % prepare to output the table of contents
+ \ifpdf\startpdf\fi \titletrue % prepare to output the table of contents
\pageno=\contentspagenumber
\def\grouptitle{TABLE OF CONTENTS}
\message{Table of contents:}
\ifhint\HINThome\fi% Mark the Table of contents as home page
- \topofcontents \startpdf
+ \topofcontents
\line{\hfil Section\ifhint\else\hbox to3em{\hss Page}\fi}% No Page in HINT
\let\ZZ=\contentsline
\readcontents\relax % read the contents info
diff --git a/Build/source/texk/web2c/cwebdir/texinputs/dcwebmac.tex b/Build/source/texk/web2c/cwebdir/texinputs/dcwebmac.tex
index 40343ff6225..09e222d3c3a 100644
--- a/Build/source/texk/web2c/cwebdir/texinputs/dcwebmac.tex
+++ b/Build/source/texk/web2c/cwebdir/texinputs/dcwebmac.tex
@@ -28,6 +28,7 @@
% Version 3.64 [p21] --- Andreas Scherer, Octobre 2005
% Version 3.64 [p22] --- Andreas Scherer, March 2016
% Version 4.9 --- Andreas Scherer, June 2022
+% Version 4.12 --- Andreas Scherer, May 2024
\ifx\undefined\botofcontents\input cwebmac.tex\fi
@@ -81,11 +82,11 @@
% \ifodd\pageno\else\titletrue\null\vfill\eject\fi % for duplex printers
\rightskip 0pt \hyphenpenalty 50 \tolerance 200
\setpage \output={\normaloutput\page\lheader\rheader}
- \titletrue % prepare to output the table of contents
+ \ifpdf\startpdf\fi \titletrue % prepare to output the table of contents
\pageno=\contentspagenumber
\redefcon
\ifhint\HINThome\fi% Mark the Table of contents as home page
- \topofcontents \startpdf
+ \topofcontents
\line{\headerline}
\let\ZZ=\contentsline
\readcontents\relax % read the contents info
diff --git a/Build/source/texk/web2c/cwebdir/texinputs/fcwebmac.tex b/Build/source/texk/web2c/cwebdir/texinputs/fcwebmac.tex
index d7e65ec7854..82d67edb1a5 100644
--- a/Build/source/texk/web2c/cwebdir/texinputs/fcwebmac.tex
+++ b/Build/source/texk/web2c/cwebdir/texinputs/fcwebmac.tex
@@ -28,6 +28,7 @@
% Version 3.64 [p21] --- Andreas Scherer, October 2005
% Version 3.64 [p22] --- Andreas Scherer, March 2016
% Version 4.9 --- Andreas Scherer, June 2022
+% Version 4.12 --- Andreas Scherer, May 2024
% french translations --- Denis Roegel, 18 September 1994
@@ -107,12 +108,12 @@
% \ifodd\pageno\else\titletrue\null\vfill\eject\fi % for duplex printers
\rightskip 0pt \hyphenpenalty 50 \tolerance 200
\setpage \output={\normaloutput\page\lheader\rheader}
- \titletrue % prepare to output the table of contents
+ \ifpdf\startpdf\fi \titletrue % prepare to output the table of contents
\pageno=\contentspagenumber
\def\grouptitle{SOMMAIRE:}
\message{Sommaire:}
\ifhint\HINThome\fi% Mark the Table of contents as home page
- \topofcontents \startpdf
+ \topofcontents
\line{\hfil Section\ifhint\else\hbox to3em{\hss Page}\fi}% No Page in HINT
\let\ZZ=\contentsline
\readcontents\relax % read the contents info
diff --git a/Build/source/texk/web2c/cwebdir/texinputs/icwebmac.tex b/Build/source/texk/web2c/cwebdir/texinputs/icwebmac.tex
index 81c425207c0..5f2e7d3a45a 100644
--- a/Build/source/texk/web2c/cwebdir/texinputs/icwebmac.tex
+++ b/Build/source/texk/web2c/cwebdir/texinputs/icwebmac.tex
@@ -28,6 +28,7 @@
% Version 3.64 [p21] --- Andreas Scherer, October 2005
% Version 3.64 [p22] --- Andreas Scherer, March 2016
% Version 4.9 --- Andreas Scherer, June 2022
+% Version 4.12 --- Andreas Scherer, May 2024
\ifx\undefined\botofcontents\input cwebmac.tex\fi
@@ -133,12 +134,12 @@
% \ifodd\pageno\else\titletrue\null\vfill\eject\fi % for duplex printers
\rightskip 0pt \hyphenpenalty 50 \tolerance 200
\setpage \output={\normaloutput\page\lheader\rheader}
- \titletrue % prepare to output the table of contents
+ \ifpdf\startpdf\fi \titletrue % prepare to output the table of contents
\pageno=\contentspagenumber
\def\grouptitle{INDICE}
\message{Indice:}
\ifhint\HINThome\fi% Mark the Table of contents as home page
- \topofcontents \startpdf
+ \topofcontents
\line{\hfil Sezione\ifhint\else\hbox to3em{\hss Pag.}\fi}% No Page in HINT
\let\ZZ=\contentsline
\readcontents\relax % read the contents info
diff --git a/Build/source/texk/web2c/cwebdir/texinputs/pdfctproofmac.tex b/Build/source/texk/web2c/cwebdir/texinputs/pdfctproofmac.tex
index 7abb58d883d..f41ad4d6334 100644
--- a/Build/source/texk/web2c/cwebdir/texinputs/pdfctproofmac.tex
+++ b/Build/source/texk/web2c/cwebdir/texinputs/pdfctproofmac.tex
@@ -1,10 +1,10 @@
% standard macros for CWEB listings (in addition to plain.tex)
-% Version 4.11 --- October 2023
+% Version 4.12 --- May 2024
% modified for proofs in CTWILL
% modified for PDF/HINT output with 'tex "\let\pdf+' or '{hi|lua|pdf|xe}tex'
% This file is not copyrighted and can be used freely.
\ifx\renewenvironment\undefined\else\endinput\fi % LaTeX will use other macros
-\xdef\fmtversion{\fmtversion+CTWILL4.11+PROOFS+PDF}
+\xdef\fmtversion{\fmtversion+CTWILL4.12+PROOFS+PDF}
\let\:=\. % preserve a way to get the dot accent
% (all other accents will still work as usual)
@@ -216,7 +216,7 @@
\def\T#1{\leavevmode % octal, hex or decimal constant
\hbox{$\def\?{\kern.2em}%$%
\let\ \, % C++ digit separator becomes a little white space
- \def\$##1{\egroup_{\rm##1}\bgroup}% suffix to constant
+ \def\$##1{\egroup_{\rm##1}\bgroup}%$% suffix to constant
\def\_{\cdot 10^{\aftergroup}}% power of ten (via dirty trick)
\let\~=\oct \let\^=\hex \let\\=\bin {#1}$}}%$%
\def\U{\note{This code is used in section}} % xref for use of a section
@@ -274,8 +274,6 @@
\def\title{\expandafter\uppercase\expandafter{\jobname}}
\def\topofcontents{\centerline{\titlefont\title}\vskip.7in
\vfill} % this material will start the table of contents page
-\def\startpdf{\ifpdf \ifpdflua\pdfcatalog{/PageMode /UseOutlines}
- \else {\special{pdf: docview << /PageMode /UseOutlines >>}}\fi\fi}
\def\botofcontents{\vfill
\centerline{\covernote}} % this material will end the table of contents page
\def\covernote{}
@@ -400,12 +398,12 @@
% \ifodd\pageno\else\titletrue\null\vfill\eject\fi % for duplex printers
\rightskip 0pt \hyphenpenalty 50 \tolerance 200
\setpage \output={\normaloutput\page\lheader\rheader}
- \titletrue % prepare to output the table of contents
+ \ifpdf\startpdf\fi \titletrue % prepare to output the table of contents
\pageno=\contentspagenumber
\def\grouptitle{TABLE OF CONTENTS}
\message{Table of contents:}
\ifhint\HINThome\fi% Mark the Table of contents as home page
- \topofcontents \startpdf
+ \topofcontents
\line{\hfil Section\ifhint\else\hbox to3em{\hss Page}\fi}% No Page in HINT
\let\ZZ=\contentsline
\readcontents\relax % read the contents info
diff --git a/Build/source/texk/web2c/cwebdir/texinputs/pdfctwimac.tex b/Build/source/texk/web2c/cwebdir/texinputs/pdfctwimac.tex
index 1eb66a2db8b..2a0499949e6 100644
--- a/Build/source/texk/web2c/cwebdir/texinputs/pdfctwimac.tex
+++ b/Build/source/texk/web2c/cwebdir/texinputs/pdfctwimac.tex
@@ -1,11 +1,11 @@
% standard macros for CWEB listings (in addition to plain.tex)
-% Version 4.11 --- October 2023
+% Version 4.12 --- May 2024
% modified for pages produced by CTWILL
% further modified for page size of the MMIXware book
% modified for PDF output with 'tex "\let\pdf+' or '{lua|pdf|xe}tex'
% This file is not copyrighted and can be used freely.
\ifx\renewenvironment\undefined\else\endinput\fi % LaTeX will use other macros
-\xdef\fmtversion{\fmtversion+CTWILL4.11+LNCS+PDF}
+\xdef\fmtversion{\fmtversion+CTWILL4.12+LNCS+PDF}
\let\:=\. % preserve a way to get the dot accent
% (all other accents will still work as usual)
@@ -515,8 +515,6 @@
%\global\advance\pageno by1}
%\def\topofcontents{\centerline{\titlefont\title}\vskip.7in
%\vfill} % this material will start the table of contents page
-%\def\startpdf{\ifpdf \ifpdflua\pdfcatalog{/PageMode /UseOutlines}
- %\else {\special{pdf: docview << /PageMode /UseOutlines >>}}\fi\fi}
%\def\botofcontents{\vfill
%\centerline{\covernote}} % this material will end the table of contents page
%\def\covernote{}
@@ -569,11 +567,11 @@
% \ifodd\pageno\else\titletrue\null\vfill\eject\fi % for duplex printers
%\rightskip 0pt \hyphenpenalty 50 \tolerance 200
%\setpage \output={\normaloutput\page\lheader\rheader}
- %\titletrue % prepare to output the table of contents
+ %\ifpdf\startpdf\fi \titletrue % prepare to output the table of contents
%\pageno=\contentspagenumber
%\def\grouptitle{TABLE OF CONTENTS}
%\message{Table of contents:}
- %\topofcontents \startpdf
+ %\topofcontents
%\line{\hfil Section\hbox to3em{\hss Page}}
%\let\ZZ=\contentsline
%\readcontents\relax % read the contents info
diff --git a/Build/source/texk/web2c/cwebdir/texinputs/pdfwebtocfront.tex b/Build/source/texk/web2c/cwebdir/texinputs/pdfwebtocfront.tex
index e26e628b0bb..237b9f39c38 100644
--- a/Build/source/texk/web2c/cwebdir/texinputs/pdfwebtocfront.tex
+++ b/Build/source/texk/web2c/cwebdir/texinputs/pdfwebtocfront.tex
@@ -1,28 +1,42 @@
-% pdfwebtofront.tex
+% pdfwebtocfront.tex
% Code from knuth.drv in https://github.com/oberdiek/latex-tds
-% 2020/06/20 v2.0 by Andreas Scherer.
+% 2024/05/25 v3.1 by Andreas Scherer.
%
% This file is part of project https://github.com/ascherer/cwebbin
% and may be distributed under the MIT License or the LaTeX Project
% Public License.
%
% Move table-of-contents page to the front in PDF output.
-% Works with pdftex and xetex in connection with either 'webmac.tex'
-% for Pascal/WEB programs or 'cwebmac.tex' for C/CWEB programs.
+% Works with pdftex/xetex/luatex and plain tex/dvipdf in connection
+% with either 'pwebmac.tex' for Pascal/WEB programs or 'cwebmac.tex'
+% for C/CWEB programs.
%
\ifx\detokenize\undefined\endinput\fi
+\ifx\twodigits\undefined\endinput\fi
\def\contentsfile{\jobname.toc} % file that gets table of contents info
\newif\iftexmf\texmffalse % special toc treatment for TeX, Metafont, etc.
\newread\testread
\openin\testread=\contentsfile\relax
\ifeof\testread % First run
\else % Second run
+ % Fix page numbers in the PDF bootmarks with 'Page Labels'
+ \def\tocpages{1} % Most programs have one-page Table-of-Contents
+ \def\tocstart{2} % so we start with (fake) page 2 for the rest
+ \def\pagemode{/PageMode /UseOutlines}
+ \def\pagelabels{/PageLabels << /Nums [
+ \ifnum\contentspagenumber=0 0 << /P(Contents) >> \tocpages << /S/D/St 1 >>
+ \else 0 << /S/D/St \contentspagenumber >> \fi ] >> }
+ \def\startpdf{\ifpdflua\pdfcatalog{\pagemode\space\pagelabels}
+ \else {\special{pdf: docview << \pagemode\space\pagelabels >>}}\fi}
% Redefine '\con' to be invoked before the first '\N' (starred section).
\let\ORGcon\con
\def\con{%
% reduce size of PDF pages for more screen space
\pdfpagewidth=\pagewidth \advance\pdfpagewidth by 1in
\pdfpageheight=\fullpageheight \advance\pdfpageheight by 1in
+ \iftexmf \advance\pdfpageheight by 0.5in
+ \gtitle={Table of Contents} % overwrite default 'WEB output'
+ \mark{\noexpand\nullsec{\the\gtitle}} \fi
\ifpdflua \pdfhorigin=0.5in \pdfvorigin=0.5in
\else \global\pageshift=-0.5in
\global\hoffset=-0.5in \global\voffset=-0.5in \fi
@@ -34,27 +48,34 @@
}%
% Special variant for 'mf.web' and 'tex.web' (et al.).
% They all define a peculiar version of '\N' in their preamble.
- % And they put their tables-of-contents on a sparse 'page 2' and
- % start the main body on page '3'.
+ % And they put their tables-of-contents on sparse 'Contents' page(s)
+ % and start the main body on page '3'.
\edef\x{\jobname}%
\edef\y{\detokenize{tex}}%
\ifx\x\y \texmftrue\else
\edef\y{\detokenize{mf}}%
\ifx\x\y \texmftrue\else
\edef\y{\detokenize{pdftex}}%
- \ifx\x\y \texmftrue\else
+ \ifx\x\y \texmftrue \def\tocpages{2}\else
\edef\y{\detokenize{xetex}}%
\ifx\x\y \texmftrue\fi\fi\fi\fi
\iftexmf
+ % These main programs start on page '3' (after any number of ToC pages)
+ \def\pagelabels{/PageLabels << /Nums [
+ 0 << /P(Contents) >> \tocpages << /S/D/St 3 >> ] >> }
\expandafter\let\csname ORGN\expandafter\endcsname
\csname N\endcsname
\expandafter\outer\expandafter\def\csname N\endcsname{%
- \titletrue \con \pageno=2
+ \titletrue \con \pageno=\tocstart
\expandafter\let\csname N\expandafter\endcsname
\csname ORGN\endcsname
\csname N\endcsname
}%
\else % Much more general approach for WEB and CWEB programs.
+ \edef\y{\detokenize{mp}}%
+ % This main program starts on page '3' (after any number of ToC pages)
+ \ifx\x\y \def\pagelabels{/PageLabels << /Nums [
+ 0 << /P(Contents) >> \tocpages << /S/D/St 3 >> ] >> } \fi
% In fact, '\con' will be invoked _inside_ the first '\N' right _after_
% '\MN', but _before_ '\eject'. And '\topofcontents' gets in the twist
% as well.
diff --git a/Build/source/texk/web2c/dvicopy.ch b/Build/source/texk/web2c/dvicopy.ch
index 1b14c54b760..7ae1ecba2e7 100644
--- a/Build/source/texk/web2c/dvicopy.ch
+++ b/Build/source/texk/web2c/dvicopy.ch
@@ -340,7 +340,7 @@ procedure bad_dvi;
noreturn procedure bad_dvi;
@z
-@x [111] Fix up opening the binary files
+@x [110] Fix up opening the binary files
@ To prepare |dvi_file| for input, we |reset| it.
@<Open input file(s)@>=
@@ -353,7 +353,7 @@ dvi_loc:=0;
dvi_loc:=0;
@z
-@x [113] Make dvi_length() and dvi_move() work.
+@x [112] Make dvi_length() and dvi_move() work.
@p function dvi_length:int_32;
begin set_pos(dvi_file,-1); dvi_length:=cur_pos(dvi_file);
end;
@@ -494,14 +494,14 @@ final_end:end.
end.
@z
-@x [245] Do this later, to avoid creating empty files.
+@x [246] Do this later, to avoid creating empty files.
@<Open output file(s)@>=
rewrite(out_file); {prepares to write packed bytes to |out_file|}
@y
@<Open output file(s)@>=
@z
-@x [247] Use external routine to output bytes.
+@x [248] Use external routine to output bytes.
@d out_byte(#) == write(out_file,#) {write next \.{DVI} byte}
@y
@d out_byte(#) == put_byte(#,out_file) {write next \.{DVI} byte}
diff --git a/Build/source/texk/web2c/euptexdir/ChangeLog b/Build/source/texk/web2c/euptexdir/ChangeLog
index 136715e33be..2f494fb0d90 100644
--- a/Build/source/texk/web2c/euptexdir/ChangeLog
+++ b/Build/source/texk/web2c/euptexdir/ChangeLog
@@ -1,3 +1,24 @@
+2024-06-04 Akira Kakuto <kakuto@jcom.zaq.ne.jp>
+
+ * unbalanced-braces-eptex.ch, suppresserrors.ch: sync with the upstream
+
+2024-06-03 Karl Berry <karl@freefriends.org>
+
+ * suppresserrors.ch (check_outer_validity): comment out hunk
+ for this procedure adding a check for "suppress_outer_error=0", to
+ avoid conflict with new change in tex.ch at the same place.
+
+2024-05-18 TANAKA Takuji <ttk@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@t-lab.opal.ne.jp>
+
+ * pdfutils.ch: Revert some patches.
+
2024-04-27 TANAKA Takuji <ttk@t-lab.opal.ne.jp>
* eptex.ech, pdfutils.ch, euptex.defines:
diff --git a/Build/source/texk/web2c/euptexdir/am/euptex.am b/Build/source/texk/web2c/euptexdir/am/euptex.am
index 1103cc70d83..f961b447fcc 100644
--- a/Build/source/texk/web2c/euptexdir/am/euptex.am
+++ b/Build/source/texk/web2c/euptexdir/am/euptex.am
@@ -98,13 +98,15 @@ EXTRA_DIST += \
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
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 @@ EXTRA_DIST += \
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)
diff --git a/Build/source/texk/web2c/euptexdir/euptex-ctrlsym.test b/Build/source/texk/web2c/euptexdir/euptex-ctrlsym.test
new file mode 100755
index 00000000000..294e0cf0bf1
--- /dev/null
+++ b/Build/source/texk/web2c/euptexdir/euptex-ctrlsym.test
@@ -0,0 +1,28 @@
+#! /bin/sh -vx
+# Copyright 2024 Japanese TeX Development Community <issue@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
+
diff --git a/Build/source/texk/web2c/euptexdir/pdfutils.ch b/Build/source/texk/web2c/euptexdir/pdfutils.ch
index 1f39749cd8a..f62a48be121 100644
--- a/Build/source/texk/web2c/euptexdir/pdfutils.ch
+++ b/Build/source/texk/web2c/euptexdir/pdfutils.ch
@@ -1883,6 +1883,21 @@ if_font_char_code:begin scan_font_ident; n:=cur_val;
@z
@x
+procedure print_kanji(@!s:KANJI_code); {prints a single character}
+@y
+procedure print_kanji(@!s:KANJI_code); {prints a single character}
+@z
+
+@x
+else begin
+ s:=toBUFF(s mod max_cjk_val);
+@y
+else begin
+ if isprint_utf8 then s:=UCStoUTF8(toUCS(s mod max_cjk_val))
+ else s:=toBUFF(s mod max_cjk_val);
+@z
+
+@x
@* \[54] System-dependent changes.
@y
@* \[54/pdf\TeX] System-dependent changes for {\tt\char"5Cpdfstrcmp}.
diff --git a/Build/source/texk/web2c/euptexdir/suppresserrors.ch b/Build/source/texk/web2c/euptexdir/suppresserrors.ch
index 07049dd3533..7876a135537 100644
--- a/Build/source/texk/web2c/euptexdir/suppresserrors.ch
+++ b/Build/source/texk/web2c/euptexdir/suppresserrors.ch
@@ -26,18 +26,6 @@
@d suppress_mathpar_error==int_par(suppress_mathpar_error_code)
@z
-@x {Perhaps this change hunk is not needed}
-@p procedure check_outer_validity;
-var p:pointer; {points to inserted token list}
-@!q:pointer; {auxiliary pointer}
-begin if scanner_status<>normal then
-@y
-@p procedure check_outer_validity;
-var p:pointer; {points to inserted token list}
-@!q:pointer; {auxiliary pointer}
-begin if suppress_outer_error=0 then if scanner_status<>normal then
-@z
-
@x @<Finish line, emit a \.{\\par}@>
if cur_cmd>=outer_call then check_outer_validity;
@y
diff --git a/Build/source/texk/web2c/euptexdir/tests/ctrlsym.log b/Build/source/texk/web2c/euptexdir/tests/ctrlsym.log
new file mode 100644
index 00000000000..1d0eae0c92b
--- /dev/null
+++ b/Build/source/texk/web2c/euptexdir/tests/ctrlsym.log
@@ -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.
diff --git a/Build/source/texk/web2c/euptexdir/tests/ctrlsym.tex b/Build/source/texk/web2c/euptexdir/tests/ctrlsym.tex
new file mode 100644
index 00000000000..f007708a2bc
--- /dev/null
+++ b/Build/source/texk/web2c/euptexdir/tests/ctrlsym.tex
@@ -0,0 +1,34 @@
+% Copyright 2024 Japanese TeX Development Community <issue@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
diff --git a/Build/source/texk/web2c/euptexdir/unbalanced-braces-eptex.ch b/Build/source/texk/web2c/euptexdir/unbalanced-braces-eptex.ch
index ade62e87feb..582df9c9341 100644
--- a/Build/source/texk/web2c/euptexdir/unbalanced-braces-eptex.ch
+++ b/Build/source/texk/web2c/euptexdir/unbalanced-braces-eptex.ch
@@ -75,11 +75,11 @@ begin while (loc=null)and(token_type<>v_template)
@x [24.357] l.7488 p.B150
else if suppress_outer_error=0 then check_outer_validity;
@y
- else if suppress_outer_error=0 then
+ else
begin
if (cur_cs=end_write)and(mode=0) then
fatal_error("Unbalanced write command");
- check_outer_validity;
+ if suppress_outer_error=0 then check_outer_validity;
end;
@z
diff --git a/Build/source/texk/web2c/gftodvi.ch b/Build/source/texk/web2c/gftodvi.ch
index 1c473a863a6..41f793ad124 100644
--- a/Build/source/texk/web2c/gftodvi.ch
+++ b/Build/source/texk/web2c/gftodvi.ch
@@ -143,7 +143,7 @@ for i:=@'177 to @'377 do xchr[i]:=chr(i);
@z
-@x [15] Change `update_terminal' to `flush', `term_in' is stdin.
+@x [16] Change `update_terminal' to `flush', `term_in' is stdin.
Since the terminal is being used for both input and output, some systems
need a special routine to make sure that the user can see a prompt message
before waiting for input based on that message. (Otherwise the message
@@ -586,7 +586,7 @@ loop @+begin continue:
endcases;@/
@z
-@x [still 219] If verbose, output a newline at the end.
+@x [219] If verbose, output a newline at the end.
final_end:end.
@y
if verbose and (total_pages mod 13 <> 0) then print_ln (' ');
diff --git a/Build/source/texk/web2c/gftopk.ch b/Build/source/texk/web2c/gftopk.ch
index 8b9d7d2d9d0..e4ddf19c8b6 100644
--- a/Build/source/texk/web2c/gftopk.ch
+++ b/Build/source/texk/web2c/gftopk.ch
@@ -239,7 +239,7 @@ begin
end ;
@z
-@x [47] Redefine find_gf_length and move_to_byte.
+@x [46] Redefine find_gf_length and move_to_byte.
@p procedure find_gf_length ;
begin
set_pos(gf_file, -1) ; gf_len := cur_pos(gf_file) ;
@@ -263,14 +263,14 @@ begin xfseek (gf_file, n, 0, gf_name);
end;
@z
-@x [49] Dynamic allocation of |row| array.
+@x [48] Dynamic allocation of |row| array.
@!row: array[0..max_row] of integer; {the row counts for working}
@y
@!row: ^integer; {the row counts for working}
@!max_row: integer; {largest index in the main |row| array}
@z
-@x [50] Dynamic allocation of |row| array.
+@x [49] Dynamic allocation of |row| array.
@<Set init...@>=
@y
@<Set init...@>=
@@ -278,7 +278,7 @@ row := xmalloc_array (integer, MAX_ROW);
max_row := MAX_ROW;
@z
-@x [52] Dynamic allocation of |row| array.
+@x [51] Dynamic allocation of |row| array.
procedure convert_gf_file;
@y
procedure row_overflow;
@@ -293,7 +293,7 @@ end;
procedure convert_gf_file;
@z
-@x [still 52] Add do_the_rows to break up huge run of cases.
+@x [still 51] Add do_the_rows to break up huge run of cases.
repeat
gf_com := gf_byte ;
case gf_com of
@@ -304,7 +304,7 @@ procedure convert_gf_file;
case gf_com of
@z
-@x [53] Declare |thirty_seven_cases| to help avoid breaking yacc.
+@x [52] Declare |thirty_seven_cases| to help avoid breaking yacc.
@d one_sixty_five_cases(#)==sixty_four_cases(#),sixty_four_cases(#+64),
sixteen_cases(#+128),sixteen_cases(#+144),four_cases(#+160),#+164
@y
@@ -314,7 +314,7 @@ procedure convert_gf_file;
@d new_row_128=new_row_64 + 64
@z
-@x [57] Dynamic allocation of |row| array.
+@x [56] Dynamic allocation of |row| array.
@d put_in_rows(#)==begin if row_ptr > max_row then bad := true else begin
row[row_ptr]:=#; incr(row_ptr); end ; end
@y
@@ -322,12 +322,12 @@ row[row_ptr]:=#; incr(row_ptr); end ; end
row[row_ptr]:=#; incr(row_ptr); end
@z
-@x [58] Dynamic allocation of |row| array.
+@x [57] Dynamic allocation of |row| array.
bad := false ;
@y
@z
-@x [still 58] Break up an oversized sequence of cases for yacc.
+@x [still 57] Break up an oversized sequence of cases for yacc.
one_sixty_five_cases(new_row_0) : begin
if on = state then put_in_rows(extra) ;
put_in_rows(end_of_row) ;
@@ -339,13 +339,13 @@ sixty_four_cases(new_row_64) : do_the_rows:=true;
thirty_seven_cases(new_row_128) : do_the_rows:=true;
@z
-@x [still 58] Dynamic allocation of |row| array.
+@x [still 57] Dynamic allocation of |row| array.
if bad then abort('Ran out of internal memory for row counts!') ;
@.Ran out of memory@>
@y
@z
-@x [still 58] Break up an oversized sequence of cases for yacc.
+@x [still 57] Break up an oversized sequence of cases for yacc.
endcases ;
@y
endcases ;
@@ -357,7 +357,7 @@ if do_the_rows then begin
end ;
@z
-@x [59] Add do_the_rows to break up huge run of cases.
+@x [58] Add do_the_rows to break up huge run of cases.
@ A few more locals used above and below:
@<Locals to |convert_gf_file|@>=
@@ -368,12 +368,12 @@ end ;
@!do_the_rows:boolean;
@z
-@x [still 59] Dynamic allocation of |row| array.
+@x [still 58] Dynamic allocation of |row| array.
@!bad : boolean ; {did we run out of space?}
@y
@z
-@x [82] Don't add `GFtoPK 2.3 output from ' to the font comment.
+@x [81] Don't add `GFtoPK 2.3 output from ' to the font comment.
@d comm_length = 23 {length of |preamble_comment|}
@d from_length = 6 {length of its |' from '| part}
@y
@@ -394,7 +394,7 @@ final_end : end .
end.
@z
-@x System-dependent changes.
+@x [88] System-dependent changes.
This section should be replaced, if necessary, by changes to the program
that are necessary to make \.{GFtoPK} work at a particular installation.
It is usually best to design your change file so that all changes to
diff --git a/Build/source/texk/web2c/gftype.ch b/Build/source/texk/web2c/gftype.ch
index 143fbb0f5eb..83834e76c26 100644
--- a/Build/source/texk/web2c/gftype.ch
+++ b/Build/source/texk/web2c/gftype.ch
@@ -166,7 +166,7 @@ end;
@d text_char == char {the data type of characters in text files}
@z
-@x [22] Redo open_gf_file to do path searching.
+@x [21] Redo open_gf_file to do path searching.
@ To prepare this file for input, we |reset| it.
@p procedure open_gf_file; {prepares to read packed bytes in |gf_file|}
@@ -374,7 +374,7 @@ othercases abort('internal error')
endcases;
@z
-@x [64] Break up the second oversized case statement.
+@x [51] Break up the second oversized case statement.
sixty_four_cases(new_row_0), sixty_four_cases(new_row_0+64),
thirty_seven_cases(new_row_0+128):
@<Translate a |new_row| command@>;
@@ -398,7 +398,7 @@ othercases error('undefined command ',o:1,'!')
endcases
@z
-@x [65] No label and no dialog; finish last line written.
+@x [66] No label and no dialog; finish last line written.
@p begin initialize; {get all variables initialized}
dialog; {set up all the options}
@<Process the preamble@>;
@@ -423,7 +423,7 @@ print_ln(' altogether.');
end.
@z
-@x System-dependent changes.
+@x [73] System-dependent changes.
This section should be replaced, if necessary, by changes to the program
that are necessary to make \.{GFtype} work at a particular installation.
It is usually best to design your change file so that all changes to
diff --git a/Build/source/texk/web2c/hitexdir/hitex.w b/Build/source/texk/web2c/hitexdir/hitex.w
index cad0605c82f..2ddc5703f71 100644
--- a/Build/source/texk/web2c/hitexdir/hitex.w
+++ b/Build/source/texk/web2c/hitexdir/hitex.w
@@ -224,6 +224,7 @@
@s alpha_file int
@s byte_file int
@s word_file int
+@s int8_t int
@s uint8_t int
@s int16_t int
@s uint16_t int
@@ -249,9 +250,13 @@
@s line normal
@s to do
+\def\contentspagenumber{0}
+\def\tocpages{3} % HiTeX has a long ToC
+\pageno=\contentspagenumber \advance \pageno by \tocpages
+
@* Introduction.
This is Hi\TeX, a program derived from \TeX, extending its capabilities
-using \eTeX and \Prote, and adding functions common to other engines from
+using \eTeX\ and \Prote, and adding functions common to other engines from
the \TeX\ Live distribution. Hi\TeX\ writes output files in
the \HINT\ file format. Like \TeX, it is
a document compiler intended to produce typesetting of high
@@ -375,7 +380,7 @@ known as `\Prote'.
@d Prote_banner "This is Prote, Version " Prote_version_string
/*printed when \Prote\ starts*/
@#
-@d banner "This is HiTeX, Version 3.141592653"
+@d banner "This is HiTeX, Version 3.141592653"@|
eTeX_version_string"-"HINT_VERSION_STRING" "TL_VERSION
/*printed when \TeX\ starts*/
@@ -431,7 +436,7 @@ portions of the program.
The program starts with inserting header files and occassionaly a function
must be placed before declaring \TeX's macros, because the function
-uses identifiers that \TeX will declare as macros.
+uses identifiers that \TeX\ will declare as macros.
@p @<Header files and function declarations@>@;
@h
@@ -442,7 +447,7 @@ enum {@+@<Constants in the outer block@>@+};
@#
static void initialize(void) /*this procedure gets things started properly*/
{@+@<Local variables for initialization@>@;
- @<Initialize whatever \TeX\ might access@>;
+ @<Initialize whatever \TeX\ might access@>@;
} @#
@<Basic printing procedures@>@;
@<Error handling procedures@>@;
@@ -629,7 +634,7 @@ because some fussy \PASCAL\ compilers will complain about redundant labels.
@d negate(A) A=-A /*change the sign of a variable*/
@d loop @+while (true) @+ /*repeat over and over until a |goto| happens*/
@f loop else
- /*\.{WEB}'s |else| acts like `\ignorespaces|while true do|\unskip'*/
+ /*\.{WEB}'s |loop| acts like `\ignorespaces|while true do|\unskip'*/
@d do_nothing /*empty statement*/
@d empty 0 /*symbolic name for a null constant*/
@@ -1329,7 +1334,7 @@ while (j < str_start[s+1])
result=true;
not_found: return result;
}
-@t\4@>@<Declare \Prote\ procedures for strings@>@;
+@#@<Declare \Prote\ procedures for strings@>@;
@ The initial values of |str_pool|, |str_start|, |pool_ptr|,
and |str_ptr| are computed by the \.{INITEX} program, based in part
@@ -1420,6 +1425,8 @@ declaration.
@<Forward declarations@>=
static int s_no(const char *str);
+@ (Empty section to keep numbering intact.)
+
@* On-line and off-line printing.
Messages that are sent to a user's terminal and to the transcript-log file
are produced by several `|print|' procedures. These procedures will
@@ -1491,8 +1498,10 @@ for terminal output, and it is possible to adhere to those conventions
by changing |wterm|, |wterm_ln|, and |wterm_cr| in this section.
@^system dependencies@>
+@s sizeof x
+
@<Basic printing procedures@>=
-#define @[put(F)@] @[fwrite(&((F).d)@],@[sizeof((F).d),1,(F).f)@]@;
+#define @[put(F)@] @[fwrite(&((F).d),sizeof((F).d),1,(F).f)@]
#define @[get(F)@] @[fread(&((F).d),sizeof((F).d),1,(F).f)@]
#define @[pascal_close(F)@] @[fclose((F).f)@]
@@ -1699,8 +1708,8 @@ if (n < 0)
}
}
}
-@/do@+{dig[k]=n%10;n=n/10;incr(k);
-}@+ while (!(n==0));
+do {dig[k]=n%10;n=n/10;incr(k);
+} while (!(n==0));
print_the_digs(k);
}
@@ -1718,8 +1727,8 @@ print_char('0'+(n%10));
/*prints a positive integer in hexadecimal form*/
{@+int k; /*index to current digit; we assume that $0\le n<16^{22}$*/
k=0;print_char('"');
-@/do@+{dig[k]=n%16;n=n/16;incr(k);
-}@+ while (!(n==0));
+do {dig[k]=n%16;n=n/16;incr(k);
+} while (!(n==0));
print_the_digs(k);
}
@@ -1795,7 +1804,7 @@ $$\vbox{\halign{#\hfil\cr
|help3("This is the first line of my offer to help.")|\cr
|("This is the second line. I'm trying to")|\cr
|("explain the best way for you to proceed.");|\cr
-|error;|\cr}}$$
+|error();|\cr}}$$
A two-line help message would be given using |help2|, etc.; these informal
helps should use simple vocabulary that complements the words used in the
official error message that was printed. (Outside the U.S.A., the help
@@ -2094,8 +2103,8 @@ show_context();goto resume;
else{@+if (help_ptr==0)
help2("Sorry, I don't know how to help in this situation.",@/
@t\kern1em@>"Maybe you should try asking a human?");
- @/do@+{decr(help_ptr);print(help_line[help_ptr]);print_ln();
- }@+ while (!(help_ptr==0));
+ do {decr(help_ptr);print(help_line[help_ptr]);print_ln();
+ } while (!(help_ptr==0));
}
help4("Sorry, I already gave what help I could...",@/
"Maybe you should try asking a human?",@/
@@ -2264,7 +2273,7 @@ positions from the right end of a binary computer word.
@<Types...@>=
typedef int scaled; /*this type is used for scaled integers*/
-typedef int32_t nonnegative_integer; /*$0\le x<2^{31}$*/
+typedef uint32_t nonnegative_integer; /*$0\le x<2^{31}$*/
typedef int8_t small_number; /*this type is self-explanatory*/
@ The following function is used to create a scaled integer from a given decimal
@@ -2302,9 +2311,9 @@ if (s < 0)
print_int(s/unity); /*print the integer part*/
print_char('.');
s=10*(s%unity)+5;delta=10;
-@/do@+{if (delta > unity) s=s+0100000-50000; /*round the last digit*/
+do {if (delta > unity) s=s+0100000-50000; /*round the last digit*/
print_char('0'+(s/unity));s=10*(s%unity);delta=delta*10;
-}@+ while (!(s <= delta));
+} while (!(s <= delta));
}
@ Physical sizes that a \TeX\ user specifies for portions of documents are
@@ -2421,7 +2430,7 @@ computing at most 1095 distinct values, but that is plenty.
@d inf_bad 10000 /*infinitely bad value*/
-@p @<Declare \Prote\ arithmetic routines@>@/
+@p @<Declare \Prote\ arithmetic routines@>@;
static halfword badness(scaled @!t, scaled @!s) /*compute badness, given |t >= 0|*/
{@+int r; /*approximation to $\alpha t/s$, where $\alpha^3\approx
100\cdot2^{18}$*/
@@ -2456,12 +2465,16 @@ routines cited there must be modified to allow negative glue ratios.)
@d unfix(A) ((double)(A)) /*convert from |glue_ratio| to type |double|*/
@d fix(A) ((glue_ratio)(A)) /*convert from |double| to type |glue_ratio|*/
@d float_constant(A) ((double)(A)) /*convert |int| constant to |double|*/
+@#
+@d perror e@&r@&r@&o@&r /* this is a \.{CWEB} coding trick: */
+@f perror error /* `\&{perror}' will be equivalent to `\&{error}' */
+@f error x /* but `|error|' will not be treated as a reserved word */
@<Types...@>=
#if __SIZEOF_FLOAT__==4
typedef float float32_t;
#else
-#error @=float type must have size 4@>
+#perror @=float type must have size 4@>
#endif
typedef float @!glue_ratio; /*one-word representation of a glue expansion factor*/
@@ -2571,25 +2584,29 @@ typedef uint16_t quarterword; /*1/4 of a word*/
typedef int32_t halfword; /*1/2 of a word*/
typedef int8_t two_choices; /*used when there are two variants in a record*/
typedef int8_t four_choices; /*used when there are four variants in a record*/
-typedef struct { @;@/
+@#
+typedef struct {
halfword @!rh;
union {
halfword @!lh;
struct { quarterword @!b0;quarterword @!b1;} ;
};} two_halves;
-typedef struct { @;@/
+@#
+typedef struct {
quarterword @!b0;
quarterword @!b1;
quarterword @!b2;
quarterword @!b3;
} four_quarters;
-typedef struct { @;@/
+@#
+typedef struct {
union {
int @!i;
glue_ratio @!gr;
two_halves @!hh;
four_quarters @!qqqq;
};} memory_word;
+@#
typedef struct {@+FILE *f;@+memory_word@,d;@+} word_file;
@ When debugging, we may want to print a |memory_word| without knowing
@@ -2772,11 +2789,11 @@ one-word nodes that starts at position |p|.
{@+pointer @!q, @!r; /*list traversers*/
if (p!=null)
{@+r=p;
- @/do@+{q=r;r=link(r);
+ do {q=r;r=link(r);
#ifdef @!STAT
decr(dyn_used);
#endif
- }@+ while (!(r==null)); /*now |q| is the last node on the list*/
+ } while (!(r==null)); /*now |q| is the last node on the list*/
link(q)=avail;avail=p;
}
}
@@ -2821,11 +2838,11 @@ pointer @!q; /*the node physically after node |p|*/
int @!r; /*the newly allocated node, or a candidate for this honor*/
int @!t; /*temporary register*/
restart: p=rover; /*start at some free node in the ring*/
-@/do@+{@<Try to allocate within node |p| and its physical successors, and
+do {@<Try to allocate within node |p| and its physical successors, and
|goto found| if allocation was possible@>;
@^inner loop@>
p=rlink(p); /*move to the next node in the ring*/
-}@+ while (!(p==rover)); /*repeat until the whole list has been traversed*/
+} while (!(p==rover)); /*repeat until the whole list has been traversed*/
if (s==010000000000)
{@+return max_halfword;
}
@@ -3318,7 +3335,7 @@ current \.{\\lineskip}.
pointer @!q; /*the glue specification*/
p=get_node(small_node_size);type(p)=glue_node;subtype(p)=n+1;
leader_ptr(p)=null;@/
-q=@<Current |mem| equivalent of glue parameter number |n|@>@t@>;
+q=@[@<Current |mem| equivalent of glue parameter number |n|@>@];
glue_ptr(p)=q;incr(glue_ref_count(q));
return p;
}
@@ -3358,6 +3375,8 @@ kerns inserted from font information or math mode calculations) or |explicit|
(for kerns inserted from non-math accents) or |mu_glue| (for kerns
inserted from \.{\\mkern} specifications in math formulas).
+@s explicit true
+
@d kern_node 11 /*|type| of a kern node*/
@d explicit 1 /*|subtype| of kern nodes from \.{\\kern} and \.{\\/}*/
@d acc_kern 2 /*|subtype| of kern nodes from accents*/
@@ -3573,7 +3592,7 @@ done1:
@ @<Check variable-size...@>=
p=rover;q=null;clobbered=false;
-@/do@+{if ((p >= lo_mem_max)||(p < mem_min)) clobbered=true;
+do {if ((p >= lo_mem_max)||(p < mem_min)) clobbered=true;
else if ((rlink(p) >= lo_mem_max)||(rlink(p) < mem_min)) clobbered=true;
else if (!(is_empty(p))||(node_size(p) < 2)||@|
(p+node_size(p) > lo_mem_max)||@|(llink(rlink(p))!=p)) clobbered=true;
@@ -3590,7 +3609,7 @@ for (q=p; q<=p+node_size(p)-1; q++) /*mark all locations free*/
is_free[q]=true;
}
q=p;p=rlink(p);
-}@+ while (!(p==rover));
+} while (!(p==rover));
done2:
@ @<Check flags...@>=
@@ -3685,13 +3704,13 @@ while (p > mem_min)
{@+if ((font(p) < font_base)||(font(p) > font_max))
print_char('*');
@.*\relax@>
- else@<Print the font identifier for |font(p)|@>;
+ else@<Print the font identifier for |font(p)|@>@;
print_char(' ');font_in_short_display=font(p);
}
print_ASCII(qo(character(p)));
}
}
- else@<Print a short indication of the contents of node |p|@>;
+ else@<Print a short indication of the contents of node |p|@>@;
p=link(p);
}
}
@@ -3724,7 +3743,7 @@ its reference count, and one to print a rule dimension.
{@+if (p > mem_end) print_esc("CLOBBERED.");
else{@+if ((font(p) < font_base)||(font(p) > font_max)) print_char('*');
@.*\relax@>
- else@<Print the font identifier for |font(p)|@>;
+ else@<Print the font identifier for |font(p)|@>@;
print_char(' ');print_ASCII(qo(character(p)));
}
}
@@ -4063,7 +4082,7 @@ specification is being withdrawn.
}
@p static void delete_glue_ref(pointer @!p) /*|p| points to a glue specification*/
-fast_delete_glue_ref(p)
+fast_delete_glue_ref(p)@;
static void delete_xdimen_ref(pointer @!p) /*|p| points to a xdimen specification*/
{@+if (p==null) return;
if (xdimen_ref_count(p)==null) free_node(p, xdimen_node_size);
@@ -5004,7 +5023,7 @@ else switch (chr_code) {
case every_vbox_loc: print_esc("everyvbox");@+break;
case every_job_loc: print_esc("everyjob");@+break;
case every_cr_loc: print_esc("everycr");@+break;
- @/@<Cases of |assign_toks| for |print_cmd_chr|@>@/
+ @/@t\4@>@<Cases of |assign_toks| for |print_cmd_chr|@>@;
default:print_esc("errhelp");
} @+break;
@@ -5332,7 +5351,7 @@ case right_hyphen_min_code: print_esc("righthyphenmin");@+break;
case holding_inserts_code: print_esc("holdinginserts");@+break;
case error_context_lines_code: print_esc("errorcontextlines");@+break;
case tracing_stack_levels_code: print_esc("tracingstacklevels");@+break;
-@/@<Cases for |print_param|@>@/
+@/@t\4@>@<Cases for |print_param|@>@;
default:print("[unknown integer parameter!]");
}
}
@@ -5485,6 +5504,7 @@ defined by |SOURCE_DATE_EPOCH|.
@^reference time@>
@^system dependencies@>
\TeX\ Live calls |tl_now| to obtain the current time as a |tm| structure.
+@s tm int
@p static void fix_date_and_time(void)
{@+ struct tm *t=tl_now();
time=sys_time= t->tm_hour*60+t->tm_min;/*minutes since midnight*/
@@ -5814,10 +5834,10 @@ found: return p;
@ @<Insert a new control...@>=
{@+if (text(p) > 0)
- {@+@/do@+{if (hash_is_full) overflow("hash size", hash_size);
+ {@+do {if (hash_is_full) overflow("hash size", hash_size);
@:TeX capacity exceeded hash size}{\quad hash size@>
decr(hash_used);
- }@+ while (!(text(hash_used)==0)); /*search for an empty location in |hash|*/
+ } while (!(text(hash_used)==0)); /*search for an empty location in |hash|*/
next(p)=hash_used;p=hash_used;
}
str_room(l);d=cur_length;
@@ -6035,7 +6055,7 @@ case end_group: print_esc("endgroup");@+break;
case ex_space: print_esc(" ");@+break;
case expand_after: switch (chr_code) {
case 0: print_esc("expandafter");@+break;
-@/@<Cases of |expandafter| for |print_cmd_chr|@>@/
+@/@t\4@>@<Cases of |expandafter| for |print_cmd_chr|@>@;
} @+break; /*there are no other cases*/
case halign: print_esc("halign");@+break;
case hrule: print_esc("hrule");@+break;
@@ -6055,17 +6075,17 @@ case no_expand: print_esc("noexpand");@+break;
case non_script: print_esc("nonscript");@+break;
case omit: print_esc("omit");@+break;
case radical: print_esc("radical");@+break;
-case read_to_cs: if (chr_code==0) print_esc("read")
- @<Cases of |read| for |print_cmd_chr|@>;@+break;
+case read_to_cs: if (chr_code==0) print_esc("read");
+ else @<Cases of |read| for |print_cmd_chr|@>;@+break;
case relax: print_esc("relax");@+break;
case set_box: print_esc("setbox");@+break;
case set_prev_graf: print_esc("prevgraf");@+break;
case set_shape: switch (chr_code) {
case par_shape_loc: print_esc("parshape");@+break;
- @<Cases of |set_shape| for |print_cmd_chr|@>@;@/
+ @/@t\4@>@<Cases of |set_shape| for |print_cmd_chr|@>@;
} @+break; /*there are no other cases*/
-case the: if (chr_code==0) print_esc("the")
- @<Cases of |the| for |print_cmd_chr|@>;@+break;
+case the: if (chr_code==0) print_esc("the");
+ else @<Cases of |the| for |print_cmd_chr|@>;@+break;
case toks_register: @<Cases of |toks_register| for |print_cmd_chr|@>@;@+break;
case vadjust: print_esc("vadjust");@+break;
case valign: print_esc("valign");@+break;
@@ -6086,7 +6106,7 @@ Meanwhile, this is a convenient place to catch up on something we were unable
to do before the hash table was defined:
@<Print the font identifier for |font(p)|@>=
-printn_esc(font_id_text(font(p)))
+printn_esc(font_id_text(font(p)));
@* Saving and restoring equivalents.
The nested structure provided by `$\.{\char'173}\ldots\.{\char'175}$' groups
@@ -6271,7 +6291,7 @@ case shape_ref: {@+q=equiv_field(w); /*we need to free a \.{\\parshape} block*/
if (q!=null) free_node(q, info(q)+info(q)+1);
} @+break; /*such a block is |2 n+1| words long, where |n==info(q)|*/
case box_ref: flush_node_list(equiv_field(w));@+break;
-@/@<Cases for |eq_destroy|@>@/
+@/@t\4@>@<Cases for |eq_destroy|@>@;
default:do_nothing;
}
}
@@ -6309,7 +6329,7 @@ the call, since |eq_save| makes the necessary test.
#ifdef @!STAT
#define assign_trace(A, B) if (tracing_assigns > 0) restore_trace(A, B);
#else
-#define assign_trace(A, B)
+#define assign_trace(A, B) @[@]
#endif
static void eq_define(pointer @!p, quarterword @!t, halfword @!e)
@@ -6814,7 +6834,7 @@ case endv: print("end of alignment template");@+break;
case spacer: chr_cmd("blank space ")@;@+break;
case letter: chr_cmd("the letter ")@;@+break;
case other_char: chr_cmd("the character ")@;@+break;
-@t\4@>@<Cases of |print_cmd_chr| for symbolic printing of primitives@>@/
+@/@t\4@>@<Cases of |print_cmd_chr| for symbolic printing of primitives@>@;
default:print("[unknown command code!]");
}
}
@@ -7552,7 +7572,7 @@ actions.
in_open=0;open_parens=0;max_buf_stack=0;
grp_stack[0]=0;if_stack[0]=null;
param_ptr=0;max_param_stack=0;
-first=buf_size;@/do@+{buffer[first]=0;decr(first);}@+ while (!(first==0));
+first=buf_size;do {buffer[first]=0;decr(first);} while (!(first==0));
scanner_status=normal;warning_index=null;first=1;
state=new_line;start=1;index=0;line=0;name=0;
force_eof=false;
@@ -7922,8 +7942,8 @@ the buffer left two or three places.
}
@ @<Scan ahead in the buffer...@>=
-{@+@/do@+{cur_chr=buffer[k];cat=cat_code(cur_chr);incr(k);
-}@+ while (!((cat!=letter)||(k > limit)));
+{@+do {cur_chr=buffer[k];cat=cat_code(cur_chr);incr(k);
+} while (!((cat!=letter)||(k > limit)));
@<If an expanded...@>;
if (cat!=letter) decr(k);
/*now |k| points to first nonletter*/
@@ -8168,7 +8188,7 @@ case top_bot_mark: @<Insert the \(a)appropriate mark text into the scanner@>@;@+
case expand_after: switch (cur_chr) {
case 0: @<Expand the token after the next token@>@;@+break;
case 1: @<Negate a boolean conditional and |goto reswitch|@>@;@+break;
-@/@<Cases for |expandafter|@>@/
+@/@t\4@>@<Cases for |expandafter|@>@;
} @+break; /*there are no other cases*/
case no_expand: @<Suppress expansion of the next token@>@;@+break;
case cs_name: @<Manufacture a control sequence name@>@;@+break;
@@ -8232,9 +8252,9 @@ the variables |p| and |q| are reserved for token-list building.
@ @<Manufacture a control...@>=
{@+r=get_avail();p=r; /*head of the list of characters*/
incr(incsname_state);
-@/do@+{get_x_token();
+do {get_x_token();
if (cur_cs==0) store_new_token(cur_tok);
-}@+ while (!(cur_cs!=0));
+} while (!(cur_cs!=0));
if (cur_cmd!=end_cs_name) @<Complain about missing \.{\\endcsname}@>;
decr(incsname_state);
@<Look up the characters of list |r| in the hash table, and set |cur_cs|@>;
@@ -8292,15 +8312,15 @@ primitive("endinput", input, 1);@/
@!@:end\_input\_}{\.{\\endinput} primitive@>
@ @<Cases of |print_cmd_chr|...@>=
-case input: if (chr_code==0) print_esc("input")
- @/@<Cases of |input| for |print_cmd_chr|@>;@/
+case input: if (chr_code==0) print_esc("input");
+ else @<Cases of |input| for |print_cmd_chr|@>@;
else print_esc("endinput");@+break;
@ @<Initiate or terminate input...@>=
-if (cur_chr==1) force_eof=true
-@/@<Cases for |input|@>;@/
+if (cur_chr==1) force_eof=true;
+else @<Cases for |input|@>@;
else if (name_in_progress) insert_relax();
-else start_input()
+else start_input();
@ Sometimes the expansion looks too far ahead, so we want to insert
a harmless \.{\\relax} into the user's input.
@@ -8510,7 +8530,7 @@ a string that will delimit the next parameter.
{@+scanner_status=matching;unbalance=0;
long_state=eq_type(cur_cs);
if (long_state >= outer_call) long_state=long_state-2;
-@/do@+{link(temp_head)=null;
+do {link(temp_head)=null;
if ((info(r) > match_token+255)||(info(r) < match_token)) s=null;
else{@+match_chr=info(r)-match_token;s=link(r);r=s;
p=temp_head;m=0;
@@ -8518,7 +8538,7 @@ else{@+match_chr=info(r)-match_token;s=link(r);r=s;
@<Scan a parameter until its delimiter string has been found; or, if |s=null|,
simply scan the delimiter string@>;@/
/*now |info(r)| is a token whose command code is either |match| or |end_match|*/
-}@+ while (!(info(r)==end_match_token));
+} while (!(info(r)==end_match_token));
}
@ If |info(r)| is a |match| or |end_match| command, it cannot be equal to
@@ -8618,7 +8638,7 @@ the rules.
if (s!=r)
if (s==null) @<Report an improper use of the macro and abort@>@;
else{@+t=s;
- @/do@+{store_new_token(info(t));incr(m);u=link(t);v=s;
+ do {store_new_token(info(t));incr(m);u=link(t);v=s;
loop@+{@+if (u==r)
if (cur_tok!=info(v)) goto done;
else{@+r=link(v);goto resume;
@@ -8627,7 +8647,7 @@ if (s!=r)
u=link(u);v=link(v);
}
done: t=link(t);
- }@+ while (!(t==r));
+ } while (!(t==r));
r=s; /*at this point, no tokens are recently matched*/
}
@@ -8719,8 +8739,7 @@ if (cur_cmd!=left_brace)
}
@ @<Get the next non-blank non-relax non-call token@>=
-@/do@+{get_x_token();
-}@+ while (!((cur_cmd!=spacer)&&(cur_cmd!=relax)))
+do get_x_token(); while (!((cur_cmd!=spacer)&&(cur_cmd!=relax)))
@ The |scan_optional_equals| routine looks for an optional `\.=' sign preceded
by optional spaces; `\.{\\relax}' is not ignored here.
@@ -8731,8 +8750,7 @@ if (cur_tok!=other_token+'=') back_input();
}
@ @<Get the next non-blank non-call token@>=
-@/do@+{get_x_token();
-}@+ while (!(cur_cmd!=spacer))
+do get_x_token(); while (!(cur_cmd!=spacer))
@ In case you are getting bored, here is a slightly less trivial routine:
Given a string of lowercase letters, like `\.{pt}' or `\.{plus}' or
@@ -8791,9 +8809,9 @@ have to declare |scan_int| as a |forward| procedure. A few other
procedures are also declared at this point.
@p static void scan_int(void); /*scans an integer value*/
-@t\4\4@>@<Declare procedures that scan restricted classes of integers@>@;
-@t\4\4@>@<Declare \eTeX\ procedures for scanning@>@;
-@t\4\4@>@<Declare procedures that scan font-related stuff@>@;
+@#@<Declare procedures that scan restricted classes of integers@>@;
+@<Declare \eTeX\ procedures for scanning@>@;
+@<Declare procedures that scan font-related stuff@>@;
@ \TeX\ doesn't know exactly what to expect when |scan_something_internal|
begins. For example, an integer or dimension or glue value could occur
@@ -8991,9 +9009,9 @@ primitive("badness", last_item, badness_code);
@ @<Cases of |print_cmd_chr|...@>=
case set_aux: if (chr_code==vmode) print_esc("prevdepth");
@+else print_esc("spacefactor");@+break;
-case set_page_int: if (chr_code==0) print_esc("deadcycles")
-@/@<Cases of |set_page_int| for |print_cmd_chr|@>;@/
-@+else print_esc("insertpenalties");@+break;
+case set_page_int: if (chr_code==0) print_esc("deadcycles");
+else @<Cases of |set_page_int| for |print_cmd_chr|@>@;
+else print_esc("insertpenalties");@+break;
case set_box_dimen: if (chr_code==width_offset) print_esc("wd");
else if (chr_code==height_offset) print_esc("ht");
else print_esc("dp");@+break;
@@ -9002,7 +9020,7 @@ case last_item: switch (chr_code) {
case dimen_val: print_esc("lastkern");@+break;
case glue_val: print_esc("lastskip");@+break;
case input_line_no_code: print_esc("inputlineno");@+break;
- @/@<Cases of |last_item| for |print_cmd_chr|@>@/
+ @/@t\4@>@<Cases of |last_item| for |print_cmd_chr|@>@;
default:print_esc("badness");
} @+break;
@@ -9024,8 +9042,8 @@ else if (m==vmode)
else scanned_result(space_factor, int_val)
@ @<Fetch the |dead_cycles| or the |insert_penalties|@>=
-{@+if (m==0) cur_val=dead_cycles
-@/@<Cases for `Fetch the |dead_cycles| or the |insert_penalties|'@>;@/
+{@+if (m==0) cur_val=dead_cycles;
+else @<Cases for `Fetch the |dead_cycles| or the |insert_penalties|'@>@;
else cur_val=insert_penalties;
cur_val_level=int_val;
}
@@ -9076,14 +9094,14 @@ else if (m >= input_line_no_code)
if (m >= eTeX_glue) @<Process an expression and |return|@>@;
else if (m >= eTeX_dim)
{@+switch (m) {
- @/@<Cases for fetching a dimension value@>@/
+ @/@t\4@>@<Cases for fetching a dimension value@>@;
} /*there are no other cases*/
cur_val_level=dimen_val;
}
else{@+switch (m) {
case input_line_no_code: cur_val=line;@+break;
case badness_code: cur_val=last_badness;@+break;
- @/@<Cases for fetching an integer value@>@/
+ @/@t\4@>@<Cases for fetching an integer value@>@;
} /*there are no other cases*/
cur_val_level=int_val;
}
@@ -9308,11 +9326,11 @@ if (negative) negate(cur_val);
@ @<Get the next non-blank non-sign token...@>=
negative=false;
-@/do@+{@<Get the next non-blank non-call token@>;
+do {@<Get the next non-blank non-call token@>;
if (cur_tok==other_token+'-')
{@+negative=!negative;cur_tok=other_token+'+';
}
-}@+ while (!(cur_tok!=other_token+'+'))
+} while (!(cur_tok!=other_token+'+'));
@ A space is ignored after an alphabetic character constant, so that
such constants behave like numeric ones.
@@ -9433,7 +9451,7 @@ int @!f; /*numerator of a fraction whose denominator is $2^{16}$*/
f=0;arith_error=false;cur_order=normal;negative=false;
cur_hfactor=cur_vfactor=0;
if (!shortcut)
- {@+@<Get the next non-blank non-sign...@>;
+ {@+@<Get the next non-blank non-sign...@>@;
if ((cur_cmd >= min_internal)&&(cur_cmd <= max_internal))
@<Fetch an internal dimension and |goto attach_sign|, or fetch an internal
integer@>@;
@@ -9672,7 +9690,7 @@ most of the work has already been done.
bool negative; /*should the answer be negated?*/
pointer @!q; /*new glue specification*/
bool @!mu; /*does |level==mu_val|?*/
-mu=(level==mu_val);@<Get the next non-blank non-sign...@>;
+mu=(level==mu_val);@<Get the next non-blank non-sign...@>@;
if ((cur_cmd >= min_internal)&&(cur_cmd <= max_internal))
{@+scan_something_internal(level, negative);
if (cur_val_level >= glue_val)
@@ -9852,7 +9870,7 @@ case convert: switch (chr_code) {
case font_name_code: print_esc("fontname");@+break;
case job_name_code: print_esc("jobname");@+break;
case eTeX_revision_code: print_esc("eTeXrevision");@+break;
- @/@<Cases of |convert| for |print_cmd_chr|@>@/
+ @/@t\4@>@<Cases of |convert| for |print_cmd_chr|@>@;
} @+break;
@ The procedure |conv_toks| uses |str_toks| to insert the token list
@@ -9883,7 +9901,7 @@ case string_code: case meaning_code: {@+save_scanner_status=scanner_status;
case font_name_code: scan_font_ident();@+break;
case job_name_code: if (job_name==0) open_log_file();@+break;
case eTeX_revision_code: do_nothing;@+break;
-@/@<Cases of `Scan the argument for command |c|'@>@/
+@/@t\4@>@<Cases of `Scan the argument for command |c|'@>@;
} /*there are no other cases*/
@ @<Print the result of command |c|@>=
@@ -9901,7 +9919,7 @@ case font_name_code: {@+printn(font_name[cur_val]);
} @+break;
case eTeX_revision_code: print(eTeX_revision);@+break;
case job_name_code: printn(job_name);@+break;
-@/@<Cases of `Print the result of command |c|'@>@/
+@/@t\4@>@<Cases of `Print the result of command |c|'@>@;
} /*there are no other cases*/
@ Now we can't postpone the difficulties any longer; we must bravely tackle
@@ -10077,13 +10095,13 @@ p=def_ref; /*the reference count*/
store_new_token(end_match_token);
if ((n < 0)||(n > 15)) m=16;@+else m=n;
s=align_state;align_state=1000000; /*disable tab marks, etc.*/
-@/do@+{@<Input and store tokens from the next line of the file@>;
-}@+ while (!(align_state==1000000));
+do @<Input and store tokens from the next line of the file@>@;
+while (!(align_state==1000000));
cur_val=def_ref;scanner_status=normal;align_state=s;
}
@ @<Input and store tokens from the next line of the file@>=
-begin_file_reading();name=m+1;
+{begin_file_reading();name=m+1;
if (read_open[m]==closed) @<Input for \.{\\read} from the terminal@>;
else if (read_open[m]==just_open) @<Input the first line of |read_file[m]|@>@;
else@<Input the next line of |read_file[m]|@>;
@@ -10096,12 +10114,12 @@ loop@+{@+get_token();
if (cur_tok==0) goto done;
/*|cur_cmd==cur_chr==0| will occur at the end of the line*/
if (align_state < 1000000) /*unmatched `\.\}' aborts the line*/
- {@+@/do@+{get_token();}@+ while (!(cur_tok==0));
+ {@+do get_token(); while (!(cur_tok==0));
align_state=1000000;goto done;
}
store_new_token(cur_tok);
}
-done: end_file_reading()
+done: end_file_reading();}
@ Here we input on-line into the |buffer| array, prompting the user explicitly
if |n >= 0|. The value of |n| is set negative so that additional prompts
@@ -10219,7 +10237,7 @@ switch (chr_code%unless_code) {
case if_true_code: print_esc("iftrue");@+break;
case if_false_code: print_esc("iffalse");@+break;
case if_case_code: print_esc("ifcase");@+break;
- @/@<Cases of |if_test| for |print_cmd_chr|@>@/
+ @/@t\4@>@<Cases of |if_test| for |print_cmd_chr|@>@;
default:print_esc("if");
}
} @+break;
@@ -10400,7 +10418,7 @@ case if_eof_code: {@+scan_four_bit_int();b=(read_open[cur_val]==closed);
} @+break;
case if_true_code: b=true;@+break;
case if_false_code: b=false;@+break;
-@/@<Cases for |conditional|@>@/
+@/@t\4@>@<Cases for |conditional|@>@;
case if_case_code: @<Select the appropriate case and |return| or |goto common_ending|@>;
} /*there are no other cases*/
@@ -11530,8 +11548,8 @@ that do not do local optimization.
@ Font parameters are referred to as |slant(f)|, |space(f)|, etc.
-@d param_end(A) param_base[A]].sc
-@d param(A) font_info[A+param_end
+@d param_end(A) @[param_base[A]].sc@]
+@d param(A) @[font_info[A+param_end@]
@d slant param(slant_code) /*slant to the right, per unit distance upward*/
@d space param(space_code) /*normal space between words*/
@d space_stretch param(space_stretch_code) /*stretch between words*/
@@ -11935,11 +11953,11 @@ if (cur_val==fmem_ptr)
}
@ @<Increase the number of parameters...@>=
-{@+@/do@+{if (fmem_ptr==font_mem_size)
+{@+do {if (fmem_ptr==font_mem_size)
overflow("font memory", font_mem_size);
@:TeX capacity exceeded font memory}{\quad font memory@>
font_info[fmem_ptr].sc=0;incr(fmem_ptr);incr(font_params[f]);
-}@+ while (!(n==font_params[f]));
+} while (!(n==font_params[f]));
cur_val=fmem_ptr-1; /*this equals |param_base[f]+font_params[f]|*/
}
@@ -12983,7 +13001,7 @@ entering a new level of recursion. In effect, the values of |save_h| and
|save_v| on \TeX's run-time stack correspond to the values of |h| and |v|
that a \.{DVI}-reading program will push onto its coordinate stack.
-@p @t\4@>@<Declare procedures needed in |hlist_out|, |vlist_out|@>@t@>@/
+@p @<Declare procedures needed in |hlist_out|, |vlist_out|@>@t@>@;
static void hlist_out(void) /*output an |hlist_node| box*/
{@+
scaled base_line; /*the baseline coordinate for this box*/
@@ -13025,13 +13043,13 @@ reaching a non-|char_node|. The program uses the fact that |set_char_0==0|.
@<Output node |p| for |hlist_out|...@>=
reswitch: if (is_char_node(p))
{@+synch_h;synch_v;
- @/do@+{f=font(p);c=character(p);
+ do {f=font(p);c=character(p);
if (f!=dvi_f) @<Change font |dvi_f| to |f|@>;
if (c >= qi(128)) dvi_out(set1);
dvi_out(qo(c));@/
cur_h=cur_h+char_width(f, char_info(f, c));
p=link(p);
- }@+ while (!(!is_char_node(p)));
+ } while (!(!is_char_node(p)));
dvi_h=cur_h;
}
else@<Output the non-|char_node| |p| for |hlist_out| and move to the next
@@ -13336,7 +13354,7 @@ ready for the |ship_out| routine that gets them started in the first place.
@p static void ship_out(pointer @!p) /*output the box |p|*/
{@+
execute_output(p);
-flush_node_list(p);
+@<Flush the box from memory...@>@;
}
@ @<Flush the box from memory, showing statistics if requested@>=
@@ -13902,21 +13920,20 @@ if (last_badness > vbadness)
@ When a box is being appended to the current vertical list, the
baselineskip calculation is handled by the |append_to_vlist| routine.
-@p static void append_to_vlist(pointer @!b)@t\2\2@>@/
-{ bool height_known;@t\1@>@/
+@p static void append_to_vlist(pointer @!b)
+{ @+bool height_known;
height_known=(type(b)==hlist_node || type(b)==vlist_node ||@|
(type(b)==whatsit_node && subtype(b)==hset_node));@/
if (prev_depth > ignore_depth && height_known)@/
- {@+scaled d;@t\1@> /*deficiency of space between baselines*/
+ {@+scaled d; /*deficiency of space between baselines*/
pointer @!p; /*a new glue node*/
- {@+d=width(baseline_skip)-prev_depth-height(b);
+ d=width(baseline_skip)-prev_depth-height(b);
if (d < line_skip_limit) p=new_param_glue(line_skip_code);
else{@+p=new_skip_param(baseline_skip_code);
width(temp_ptr)=d; /*|temp_ptr==glue_ptr(p)|*/
}
link(tail)=p;tail=p;
- }@+
-} @+ else @+if (prev_depth<=unknown_depth || prev_depth>ignore_depth )@t\2@>@/
+} @+ else @+if (prev_depth<=unknown_depth || prev_depth>ignore_depth ) @/
{@+pointer p;
p=new_baseline_node(baseline_skip, line_skip, line_skip_limit);
link(tail)= p;tail= p;
@@ -14558,12 +14575,12 @@ be probed in increasing order of height.
@<Look at the variants of |(z,x)|; set |f| and |c|...@>=
if ((z!=0)||(x!=min_quarterword))
{@+z=z+s+16;
- @/do@+{z=z-16;g=fam_fnt(z);
+ do {z=z-16;g=fam_fnt(z);
if (g!=null_font)
@<Look at the list of characters starting with |x| in font |g|; set |f|
and |c| whenever a better character is found; |goto found| as soon as a large
enough variant is encountered@>;
- }@+ while (!(z < 16));
+ } while (!(z < 16));
}
@ @<Look at the list of characters starting with |x|...@>=
@@ -14953,7 +14970,7 @@ case rel_noad: case close_noad: case punct_noad:
@<Convert \(a)a final |bin_noad| to an |ord_noad|@>;
if (type(q)==right_noad) goto done_with_noad;
} @+break;
-@t\4@>@<Cases for noads that can follow a |bin_noad|@>@;
+@/@t\4@>@<Cases for noads that can follow a |bin_noad|@>@;
@t\4@>@<Cases for nodes that can appear in an mlist, after which we |goto
done_with_node|@>@;
default:confusion("mlist1");
@@ -15714,8 +15731,7 @@ is not a penalty node or a |rel_noad| or absent entirely.
@<Append any |new_hlist| entries for |q|, and any appropriate penalties@>=
if (new_hlist(q)!=null)
{@+link(p)=new_hlist(q);
- @/do@+{p=link(p);
- }@+ while (!(link(p)==null));
+ do p=link(p); while (!(link(p)==null));
}
if (penalties) if (link(q)!=null) if (pen < inf_penalty)
{@+r_type=type(link(q));
@@ -15940,7 +15956,7 @@ good start. This mostly involves scanning the preamble and putting its
information into the preamble list.
@^preamble@>
-@p @t\4@>@<Declare the procedure called |get_preamble_token|@>@t@>@/
+@p @<Declare the procedure called |get_preamble_token|@>@;
static void align_peek(void);@/
static void normal_paragraph(void);@/
static void init_align(void)
@@ -16128,8 +16144,7 @@ started, or finishes off the alignment.
static void align_peek(void)
{@+
restart: align_state=1000000;
-@/do@+{get_x_or_protected();
-}@+ while (!(cur_cmd!=spacer));
+do get_x_or_protected(); while (!(cur_cmd!=spacer));
if (cur_cmd==no_align)
{@+scan_left_brace();new_save_level(no_align_group);
if (mode==-vmode) normal_paragraph();
@@ -16148,7 +16163,7 @@ from internal vertical mode to restricted horizontal mode or vice versa.
The |space_factor| and |prev_depth| are not used on this semantic level,
but we clear them to zero just to be tidy.
-@p @t\4@>@<Declare the procedure called |init_span|@>@t@>@/
+@p @<Declare the procedure called |init_span|@>@;
static void init_row(void)
{@+push_nest();mode=(-hmode-vmode)-mode;
if (mode==-hmode) space_factor=0;@+else prev_depth=0;
@@ -16241,8 +16256,7 @@ if (extra_info(cur_align)!=span_code)
init_span(p);
}
align_state=1000000;
-@/do@+{get_x_or_protected();
-}@+ while (!(cur_cmd!=spacer));
+do get_x_or_protected(); while (!(cur_cmd!=spacer));
cur_align=p;
init_col();return false;
}
@@ -16336,8 +16350,8 @@ link(end_span)=max_quarterword+1;info(end_span)=null;
@ @<Update width entry for spanned columns@>=
{@+q=cur_span;
-@/do@+{incr(n);q=link(link(q));
-}@+ while (!(q==cur_align));
+do {incr(n);q=link(link(q));
+} while (!(q==cur_align));
if (n > max_quarterword) confusion("256 spans"); /*this can happen, but won't*/
@^system dependencies@>
@:this can't happen 256 spans}{\quad 256 spans@>
@@ -16394,21 +16408,9 @@ unsave(); /*that |align_group| was for the whole alignment*/
if (nest[nest_ptr-1].mode_field==mmode) o=display_indent;
else o=0;
@<Go through the preamble list, determining the column widths and changing
-the alignrecords to dummy unset boxes@>;
+the alignrecords to dummy unset boxes@>@;
if (x)
-{ @<Handle an alignment that depends on |hsize| or |vsize|@>@;
- pop_alignment();
-}
-else
-{ @<Package the preamble list, to determine the actual tabskip glue amounts,
- and let |p| point to this prototype box@>;
- @<Set the glue in all the unset boxes of the current list@>;
- flush_node_list(p);pop_alignment();
-}
-@<Insert the \(c)current list into its environment@>;
-} @/
-@t\4@>@<Declare the procedure called |align_peek|@>@;
-@ @<Handle an alignment that depends on |hsize| or |vsize|@>=
+{ /*Handle an alignment that depends on |hsize| or |vsize|*/
pointer r=get_node(align_node_size);
save_ptr=save_ptr-2;pack_begin_line=-mode_line;
@@ -16420,6 +16422,17 @@ else
align_v(r)= (mode!=-vmode);
link(head)=r; tail=r;
pack_begin_line=0;
+ pop_alignment();
+}
+else
+{ @<Package the preamble list, to determine the actual tabskip glue amounts,
+ and let |p| point to this prototype box@>;
+ @<Set the glue in all the unset boxes of the current list@>;
+ flush_node_list(p);pop_alignment();
+}
+@<Insert the \(c)current list into its environment@>;
+} @/
+@t\4@>@<Declare the procedure called |align_peek|@>@;
@ It's time now to dismantle the preamble list and to compute the column
widths. Let $w_{ij}$ be the maximum of the natural widths of all entries
@@ -16446,7 +16459,7 @@ value is changed to zero and so is the next tabskip.
@<Go through the preamble list,...@>=
q=link(preamble);
-@/do@+{flush_list(u_part(q));flush_list(v_part(q));
+do {flush_list(u_part(q));flush_list(v_part(q));
p=link(link(q));
if (width(q)==null_flag)
@<Nullify |width(q)| and the tabskip glue following this column@>;
@@ -16460,7 +16473,7 @@ glue_stretch(q)=0;glue_shrink(q)=0;
if (width(q)>max_dimen) x=true;
#endif
q=p;
-}@+ while (!(q==null))
+} while (!(q==null));
@ @<Nullify |width(q)| and the tabskip glue following this column@>=
{@+width(q)=0;r=link(q);s=glue_ptr(r);
@@ -16472,7 +16485,7 @@ if (s!=zero_glue)
@ Merging of two span-node lists is a typical exercise in the manipulation of
linearly linked data structures. The essential invariant in the following
-|@/do@+{| loop is that we want to dispense with node |r|, in |q|'s list,
+|do {| loop is that we want to dispense with node |r|, in |q|'s list,
and |u| is its successor; all nodes of |p|'s list up to and including |s|
have been processed, and the successor of |s| matches |r| or precedes |r|
or follows |r|, according as |link(r)==n| or |link(r) > n| or |link(r) < n|.
@@ -16480,7 +16493,7 @@ or follows |r|, according as |link(r)==n| or |link(r) > n| or |link(r) < n|.
@<Merge the widths...@>=
{@+t=width(q)+width(glue_ptr(link(q)));
r=info(q);s=end_span;info(s)=p;n=min_quarterword+1;
-@/do@+{width(r)=width(r)-t;u=info(r);
+do {width(r)=width(r)-t;u=info(r);
while (link(r) > n)
{@+s=info(s);n=link(info(s))+1;
}
@@ -16491,7 +16504,7 @@ else{@+if (width(r) > width(info(s))) width(info(s))=width(r);
free_node(r, span_node_size);
}
r=u;
-}@+ while (!(r==end_span));
+} while (!(r==end_span));
}
@ Now the preamble list has been converted to a list of alternating unset
@@ -16508,12 +16521,12 @@ if (mode==-vmode)
p=hpack(preamble, saved(1), saved_hfactor(1), saved_vfactor(1), saved(0));overfull_rule=rule_save;
}
else{@+q=link(preamble);
- @/do@+{height(q)=width(q);width(q)=0;q=link(link(q));
- }@+ while (!(q==null));
+ do {height(q)=width(q);width(q)=0;q=link(link(q));
+ } while (!(q==null));
p=vpack(preamble, saved(1), saved_hfactor(1), saved_vfactor(1), saved(0));
q=link(preamble);
- @/do@+{width(q)=height(q);height(q)=0;q=link(link(q));
- }@+ while (!(q==null));
+ do {width(q)=height(q);height(q)=0;q=link(link(q));
+ } while (!(q==null));
}
pack_begin_line=0
@@ -16551,9 +16564,9 @@ else{@+type(q)=vlist_node;height(q)=height(p);
glue_order(q)=glue_order(p);glue_sign(q)=glue_sign(p);
glue_set(q)=glue_set(p);shift_amount(q)=o;
r=link(list_ptr(q));s=link(list_ptr(p));
-@/do@+{@<Set the glue in node |r| and change it from an unset node@>;
+do {@<Set the glue in node |r| and change it from an unset node@>;
r=link(link(r));s=link(link(s));
-}@+ while (!(r==null));
+} while (!(r==null));
}
@ A box made from spanned columns will be followed by tabskip glue nodes and
@@ -16885,7 +16898,7 @@ k=1 to 6 do cur_active_width[k]=cur_active_width[k]+mem[q+k].sc|};$$ and we
want to do this without the overhead of |for| loops. The |do_all_six|
macro makes such six-tuples convenient.
-@d do_all_six(A) A(1);A(2);A(3);A(4);A(5);A(6)
+@d do_all_six(A) A(1);A(2);A(3);A(4);A(5);A(6)@;
@<Glob...@>=
static scaled @!active_width0[6], *const @!active_width = @!active_width0-1;
@@ -17043,7 +17056,7 @@ loop@+{@+resume: r=link(prev_r);
@<If node |r| is of type |delta_node|, update |cur_active_width|, set |prev_r|
and |prev_prev_r|, then |goto resume|@>;
@<If a line number class has ended, create new active nodes for the best
-feasible breaks in that class; then |return| if |r=last_active|, otherwise
+feasible breaks in that class; then |return| if |r==last_active|, otherwise
compute the new |line_width|@>;
@<Consider the demerits for a line from |r| to |cur_p|; deactivate node
|r| if it should no longer be active; then |goto resume| if a line from
@@ -17796,10 +17809,10 @@ character node.
@<Advance \(c)|cur_p| to the node following the present string...@>=
{@+prev_p=cur_p;
-@/do@+{f=font(cur_p);
+do {f=font(cur_p);
act_width=act_width+char_width(f, char_info(f, character(cur_p)));
cur_p=link(cur_p);
-}@+ while (!(!is_char_node(cur_p)));
+} while (!(!is_char_node(cur_p)));
}
@ When node |cur_p| is a glue node, we look at |prev_p| to see whether or not
@@ -17824,9 +17837,9 @@ only character nodes, kern nodes, box nodes, rule nodes, and ligature nodes.
@<Try to break after a discretionary fragment...@>=
{@+s=pre_break(cur_p);disc_width=0;
if (s==null) try_break(ex_hyphen_penalty, hyphenated);
-else{@+@/do@+{@<Add the width of node |s| to |disc_width|@>;
+else{@+do {@<Add the width of node |s| to |disc_width|@>;
s=link(s);
- }@+ while (!(s==null));
+ } while (!(s==null));
act_width=act_width+disc_width;
try_break(hyphen_penalty, hyphenated);
act_width=act_width-disc_width;
@@ -17904,11 +17917,11 @@ if (link(active)!=last_active)
@ @<Find an active node...@>=
r=link(active);fewest_demerits=awful_bad;
-@/do@+{if (type(r)!=delta_node) if (total_demerits(r) < fewest_demerits)
+do {if (type(r)!=delta_node) if (total_demerits(r) < fewest_demerits)
{@+fewest_demerits=total_demerits(r);best_bet=r;
}
r=link(r);
-}@+ while (!(r==last_active));
+} while (!(r==last_active));
best_line=line_number(best_bet)
@ The adjustment for a desired looseness is a slightly more complicated
@@ -17918,7 +17931,7 @@ looseness calculation, independently of the other segments.
@<Find the best active node...@>=
{@+r=link(active);actual_looseness=0;
-@/do@+{if (type(r)!=delta_node)
+do {if (type(r)!=delta_node)
{@+line_diff=line_number(r)-best_line;
if (((line_diff < actual_looseness)&&(looseness <= line_diff))||@|
((line_diff > actual_looseness)&&(looseness >= line_diff)))
@@ -17931,7 +17944,7 @@ looseness calculation, independently of the other segments.
}
}
r=link(r);
-}@+ while (!(r==last_active));
+} while (!(r==last_active));
best_line=line_number(best_bet);
}
@@ -17966,14 +17979,14 @@ quarterword @!t; /*used for replacement counts in discretionary nodes*/
int @!pen; /*use when calculating penalties between lines*/
halfword @!cur_line; /*the current line number being justified*/
@<Reverse the links of the relevant passive nodes, setting |cur_p| to the
-first breakpoint@>;
+first breakpoint@>@;
cur_line=prev_graf+1;
-@/do@+{@<Justify the line ending at breakpoint |cur_p|, and append it to the
+do {@<Justify the line ending at breakpoint |cur_p|, and append it to the
current vertical list, together with associated penalties and other insertions@>;
incr(cur_line);cur_p=next_break(cur_p);
if (cur_p!=null) if (!post_disc_break)
@<Prune unwanted nodes at the beginning of the next line@>;
-}@+ while (!(cur_p==null));
+} while (!(cur_p==null));
if ((cur_line!=best_line)||(link(temp_head)!=null))
confusion("line breaking");
@:this can't happen line breaking}{\quad line breaking@>
@@ -17988,8 +18001,8 @@ Node |r| is the passive node being moved from stack to stack.
@<Reverse the links of the relevant passive nodes...@>=
q=break_node(best_bet);cur_p=null;
-@/do@+{r=q;q=prev_break(q);next_break(r)=cur_p;cur_p=r;
-}@+ while (!(q==null))
+do {r=q;q=prev_break(q);next_break(r)=cur_p;cur_p=r;
+} while (!(q==null));
@ Glue and penalty and kern and math nodes are deleted at the beginning of
a line, except in the anomalous case that the node to be deleted is actually
@@ -18242,8 +18255,8 @@ int @!c; /*character being considered for hyphenation*/
second pass, and |cur_p| points to a glue node.
@p
-static void hyphenate_word(void)@t\2\2@>@/
-{ pointer @!q, @!s, @!prev_s;@t\1@> /*miscellaneous nodes of temporary interest*/
+static void hyphenate_word(void)
+{ @+pointer @!q, @!s, @!prev_s; /*miscellaneous nodes of temporary interest*/
small_number @!j; /*an index into |hc| or |hu|*/
uint8_t @!c; /*character being considered for hyphenation*/
@@ -18677,7 +18690,7 @@ pointer @!hyf_node; /*the hyphen, if it exists*/
@ When the following code is performed, |hyf[0]| and |hyf[hn]| will be zero.
@<Reconstitute nodes for the hyphenated word...@>=
-@/do@+{l=j;j=reconstitute(j, hn, bchar, qi(hyf_char))+1;
+do {l=j;j=reconstitute(j, hn, bchar, qi(hyf_char))+1;
if (hyphen_passed==0)
{@+link(s)=link(hold_head);
while (link(s) > null) s=link(s);
@@ -18687,8 +18700,8 @@ if (hyphen_passed==0)
}
if (hyphen_passed > 0)
@<Create and append a discretionary node as an alternative to the unhyphenated
-word, and continue to develop both branches until they become equivalent@>;
-}@+ while (!(j > hn));
+word, and continue to develop both branches until they become equivalent@>@;
+} while (!(j > hn));
link(s)=q
@ In this repeat loop we will insert another discretionary if |hyf[j-1]| is
@@ -18702,7 +18715,7 @@ point. (Consider the word `difficult', where the letter `c' is in position |j|.)
}
@<Create and append a discretionary node as an alternative...@>=
-@/do@+{r=get_node(small_node_size);
+do {r=get_node(small_node_size);
link(r)=link(hold_head);type(r)=disc_node;
major_tail=r;r_count=0;
while (link(major_tail) > null) advance_major_tail;
@@ -18713,7 +18726,7 @@ list and to |major_tail| until synchronization has been achieved@>;
@<Move pointer |s| to the end of the current list, and set |replace_count(r)|
appropriately@>;
hyphen_passed=j-1;link(hold_head)=null;
-}@+ while (!(!odd(hyf[j-1])))
+} while (!(!odd(hyf[j-1])));
@ The new hyphen might combine with the previous character via ligature
or kern. At this point we have |l-1 <= i < j| and |i < hn|.
@@ -18745,7 +18758,7 @@ if (bchar_label[hf]!=non_address) /*put left boundary at beginning of new line*
{@+decr(l);c=hu[l];c_loc=l;hu[l]=256;
}
while (l < j)
- {@+@/do@+{l=reconstitute(l, hn, bchar, non_char)+1;
+ {@+do {l=reconstitute(l, hn, bchar, non_char)+1;
if (c_loc > 0)
{@+hu[c_loc]=c;c_loc=0;
}
@@ -18755,7 +18768,7 @@ while (l < j)
minor_tail=link(hold_head);
while (link(minor_tail) > null) minor_tail=link(minor_tail);
}
- }@+ while (!(l >= j));
+ } while (!(l >= j));
while (l > j)
@<Append characters of |hu[j..]| to |major_tail|, advancing~|j|@>;
}
@@ -18873,10 +18886,10 @@ for (j=0; j<=r_hyf-1; j++) hyf[hn-j]=0
@ @<Store \(m)maximum values in the |hyf| table@>=
{@+v=trie_op(z);
-@/do@+{v=v+op_start[cur_lang];i=l-hyf_distance[v];
+do {v=v+op_start[cur_lang];i=l-hyf_distance[v];
if (hyf_num[v] > hyf[i]) hyf[i]=hyf_num[v];
v=hyf_next[v];
-}@+ while (!(v==min_quarterword));
+} while (!(v==min_quarterword));
}
@ The exception table that is built by \TeX's \.{\\hyphenation} primitive is
@@ -18941,10 +18954,10 @@ k=hyph_word[h];if (k==0) goto not_found;
if (length(k) < hn) goto not_found;
if (length(k)==hn)
{@+j=1;u=str_start[k];
- @/do@+{if (so(str_pool[u]) < hc[j]) goto not_found;
+ do {if (so(str_pool[u]) < hc[j]) goto not_found;
if (so(str_pool[u]) > hc[j]) goto done;
incr(j);incr(u);
- }@+ while (!(j > hn));
+ } while (!(j > hn));
@<Insert hyphens as specified in |hyph_list[h]|@>;
decr(hn);goto found;
}
@@ -19070,10 +19083,10 @@ k=hyph_word[h];
if (length(k) < length(s)) goto found;
if (length(k) > length(s)) goto not_found;
u=str_start[k];v=str_start[s];
-@/do@+{if (str_pool[u] < str_pool[v]) goto found;
+do {if (str_pool[u] < str_pool[v]) goto found;
if (str_pool[u] > str_pool[v]) goto not_found;
incr(u);incr(v);
-}@+ while (!(u==str_start[k+1]));
+} while (!(u==str_start[k+1]));
found: q=hyph_list[h];hyph_list[h]=p;p=q;@/
t=hyph_word[h];hyph_word[h]=s;s=t;
not_found:
@@ -19361,7 +19374,7 @@ loop@+{@+h=z-c;@/
otherwise |goto not_found|@>;
not_found: z=trie_link(z); /*move to the next hole*/
}
-found: @<Pack the family into |trie| relative to |h|@>;
+found: @<Pack the family into |trie| relative to |h|@>@;
}
@ By making sure that |trie_max| is at least |h+256|, we can be sure that
@@ -19372,9 +19385,9 @@ never be occupied in |trie|, and we will have |trie_max >= trie_link(z)|.
if (trie_max < h+256)
{@+if (trie_size <= h+256) overflow("pattern memory", trie_size);
@:TeX capacity exceeded pattern memory}{\quad pattern memory@>
- @/do@+{incr(trie_max);trie_taken[trie_max]=false;
+ do {incr(trie_max);trie_taken[trie_max]=false;
trie_link(trie_max)=trie_max+1;trie_back(trie_max)=trie_max-1;
- }@+ while (!(trie_max==h+256));
+ } while (!(trie_max==h+256));
}
@ @<If all characters of the family fit relative to |h|...@>=
@@ -19387,15 +19400,15 @@ goto found
@ @<Pack the family into |trie| relative to |h|@>=
trie_taken[h]=true;trie_ref[p]=h;q=p;
-@/do@+{z=h+so(trie_c[q]);l=trie_back(z);r=trie_link(z);
+do {z=h+so(trie_c[q]);l=trie_back(z);r=trie_link(z);
trie_back(r)=l;trie_link(l)=r;trie_link(z)=0;
if (l < 256)
{@+if (z < 256) ll=z;@+else ll=256;
- @/do@+{trie_min[l]=r;incr(l);
- }@+ while (!(l==ll));
+ do {trie_min[l]=r;incr(l);
+ } while (!(l==ll));
}
q=trie_r[q];
-}@+ while (!(q==0))
+} while (!(q==0));
@ To pack the entire linked trie, we use the following recursive procedure.
@^recursion@>
@@ -19403,12 +19416,12 @@ q=trie_r[q];
@<Declare procedures for preprocessing hyph...@>=
static void trie_pack(trie_pointer @!p) /*pack subtries of a family*/
{@+trie_pointer q; /*a local variable that need not be saved on recursive calls*/
-@/do@+{q=trie_l[p];
+do {q=trie_l[p];
if ((q > 0)&&(trie_ref[q]==0))
{@+first_fit(q);trie_pack(q);
}
p=trie_r[p];
-}@+ while (!(p==0));
+} while (!(p==0));
}
@ When the whole trie has been allocated into the sequential table, we
@@ -19426,8 +19439,8 @@ if (trie_max==0) /*no patterns were given*/
else{@+if (hyph_root > 0) trie_fix(hyph_root);
if (trie_root > 0) trie_fix(trie_root); /*this fixes the non-holes in |trie|*/
r=0; /*now we will zero out all the holes*/
- @/do@+{s=trie_link(r);trie[r]=h;r=s;
- }@+ while (!(r > trie_max));
+ do {s=trie_link(r);trie[r]=h;r=s;
+ } while (!(r > trie_max));
}
trie_char(0)=qi('?'); /*make |trie_char(c)!=c| for all |c|*/
@@ -19443,11 +19456,11 @@ static void trie_fix(trie_pointer @!p) /*moves |p| and its siblings into |trie|*
ASCII_code @!c; /*another one that need not be saved*/
trie_pointer @!z; /*|trie| reference; this local variable must be saved*/
z=trie_ref[p];
-@/do@+{q=trie_l[p];c=so(trie_c[p]);
+do {q=trie_l[p];c=so(trie_c[p]);
trie_link(z+c)=trie_ref[q];trie_char(z+c)=qi(c);trie_op(z+c)=trie_o[p];
if (q > 0) trie_fix(q);
p=trie_r[p];
-}@+ while (!(p==0));
+} while (!(p==0));
}
@ Now let's go back to the easier problem, of building the linked
@@ -20046,9 +20059,9 @@ if (page_head!=page_tail)
print_scaled(t);
if (type(r)==split_up)
{@+q=page_head;t=0;
- @/do@+{q=link(q);
+ do {q=link(q);
if ((type(q)==ins_node)&&(subtype(q)==subtype(r))) incr(t);
- }@+ while (!(q==broken_ins(r)));
+ } while (!(q==broken_ins(r)));
print(", #");print_int(t);print(" might split");
}
r=link(r);
@@ -20708,8 +20721,7 @@ pop_nest();build_page();
@.Unbalanced output routine@>
help2("Your sneaky output routine has problematic {'s and/or }'s.",@/
"I can't handle that very well; good luck.");error();
-@/do@+{get_token();
-}@+ while (!(loc==null));
+do get_token(); while (!(loc==null));
} /*loops forever if reading from a file, since |null==min_halfword <= 0|*/
@ @<Ensure that box 255 is empty after output@>=
@@ -21106,7 +21118,7 @@ if ((space_factor >= 2000)&&(xspace_skip!=zero_glue))
else{@+if (space_skip!=zero_glue) main_p=space_skip;
else@<Find the glue specification...@>;
main_p=new_spec(main_p);
- @<Modify the glue specification in |main_p| according to the space factor@>;
+ @<Modify the glue specification in |main_p| according to the space factor@>@;
q=new_glue(main_p);glue_ref_count(main_p)=null;
}
link(tail)=q;tail=q;
@@ -21115,7 +21127,7 @@ link(tail)=q;tail=q;
@ @<Modify the glue specification in |main_p| according to the space factor@>=
if (space_factor >= 2000) width(main_p)=width(main_p)+extra_space(cur_font);
stretch(main_p)=xn_over_d(stretch(main_p), space_factor, 1000);
-shrink(main_p)=xn_over_d(shrink(main_p), 1000, space_factor)
+shrink(main_p)=xn_over_d(shrink(main_p), 1000, space_factor);
@ Whew---that covers the main loop. We can now proceed at a leisurely
pace through the other combinations of possibilities.
@@ -21130,7 +21142,7 @@ any_mode(ignore_spaces): {@+@<Get the next non-blank non-call...@>;
goto reswitch;
}
case vmode+stop: if (its_all_over()) return;@+break; /*this is the only way out*/
-@t\4@>@<Forbidden cases detected in |main_control|@>@+@, any_mode(mac_param):
+@<Forbidden cases detected in |main_control|@>@+@, any_mode(mac_param):
report_illegal_case();@+break;
@<Math-only cases in non-math modes, or vice versa@>: insert_dollar_sign();@+break;
@t\4@>@<Cases of |main_control| that build boxes and lists@>@;
@@ -21679,7 +21691,7 @@ current vertical list.
}
else{@+cur_val=box_context-global_box_flag;a=4;
}
-if (cur_val < 256) define(box_base+cur_val, box_ref, cur_box);
+if (cur_val < 256) @[g_define(box_base+cur_val, box_ref, cur_box)@];
else sa_def_box;
}
@@ -21747,13 +21759,13 @@ else{@+if (!is_char_node(tail))
@ @<Remove the last box...@>=
{@+q=head;
-@/do@+{p=q;
+do {p=q;
if (!is_char_node(q)) if (type(q)==disc_node)
{@+for (m=1; m<=replace_count(q); m++) p=link(p);
if (p==tail) goto done;
}
q=link(p);
-}@+ while (!(q==tail));
+} while (!(q==tail));
cur_box=tail;shift_amount(cur_box)=0;
tail=p;link(p)=null;
done: ;}
@@ -22064,13 +22076,13 @@ if ((mode==vmode)&&(tail==head))
non-glue@>@;
else{@+if (!is_char_node(tail)) if (type(tail)==cur_chr)
{@+q=head;
- @/do@+{p=q;
+ do {p=q;
if (!is_char_node(q)) if (type(q)==disc_node)
{@+for (m=1; m<=replace_count(q); m++) p=link(p);
if (p==tail) return;
}
q=link(p);
- }@+ while (!(q==tail));
+ } while (!(q==tail));
link(p)=null;flush_node_list(tail);tail=p;
}
}
@@ -22111,8 +22123,8 @@ case remove_item: if (chr_code==glue_node) print_esc("unskip");
else print_esc("unpenalty");@+break;
case un_hbox: if (chr_code==copy_code) print_esc("unhcopy");
else print_esc("unhbox");@+break;
-case un_vbox: if (chr_code==copy_code) print_esc("unvcopy")
- @<Cases of |un_vbox| for |print_cmd_chr|@>;@/
+case un_vbox: if (chr_code==copy_code) print_esc("unvcopy");
+ else @<Cases of |un_vbox| for |print_cmd_chr|@>@;
else print_esc("unvbox");@+break;
@ The |un_hbox| and |un_vbox| commands unwrap one of the 256 current boxes.
@@ -23153,8 +23165,8 @@ primitive("right", left_right, right_noad);
text(frozen_right)=text(cur_val);eqtb[frozen_right]=eqtb[cur_val];
@ @<Cases of |print_cmd_chr|...@>=
-case left_right: if (chr_code==left_noad) print_esc("left")
-@/@<Cases of |left_right| for |print_cmd_chr|@>;@/
+case left_right: if (chr_code==left_noad) print_esc("left");
+else @<Cases of |left_right| for |print_cmd_chr|@>@;
else print_esc("right");@+break;
@ @<Cases of |main_control| that build...@>=
@@ -23491,8 +23503,8 @@ primitive("xdef", def, 3);
@ @<Cases of |print_cmd_chr|...@>=
case prefix: if (chr_code==1) print_esc("long");
- else if (chr_code==2) print_esc("outer")
- @/@<Cases of |prefix| for |print_cmd_chr|@>;@/
+ else if (chr_code==2) print_esc("outer");
+ else @<Cases of |prefix| for |print_cmd_chr|@>@;
else print_esc("global");@+break;
case def: if (chr_code==0) print_esc("def");
else if (chr_code==1) print_esc("gdef");
@@ -23602,7 +23614,7 @@ if ((cur_cmd!=def)&&((a%4!=0)||(j!=0)))
since the following routines test for the \.{\\global} prefix as follows.
@d global (a >= 4)
-@d define(A, B, C) if (global) geq_define(A, B, C);@+else eq_define(A, B, C)
+@d g_define(A, B, C) if (global) geq_define(A, B, C);@+else eq_define(A, B, C)
@d word_define(A, B) if (global) geq_word_define(A, B);@+else eq_word_define(A, B)
@<Adjust \(f)for the setting of \.{\\globaldefs}@>=
@@ -23620,8 +23632,7 @@ control sequence for a token that is not redefinable.
@<Declare subprocedures for |prefixed_command|@>=
static void get_r_token(void)
{@+
-restart: @/do@+{get_token();
-}@+ while (!(cur_tok!=space_token));
+restart: do get_token(); while (!(cur_tok!=space_token));
if ((cur_cs==0)||(cur_cs > frozen_control_sequence))
{@+print_err("Missing control sequence inserted");
@.Missing control...@>
@@ -23644,7 +23655,7 @@ text(frozen_protection)=s_no("inaccessible");
(Unfortunately, they aren't all as simple as this.)
@<Assignments@>=
-case set_font: define(cur_font_loc, data, cur_chr);@+break;
+case set_font: g_define(cur_font_loc, data, cur_chr);@+break;
@ When a |def| command has been scanned,
|cur_chr| is odd if the definition is supposed to be global, and
@@ -23658,7 +23669,7 @@ case def: {@+if (odd(cur_chr)&&!global&&(global_defs >= 0)) a=a+4;
{@+q=get_avail();info(q)=j;link(q)=link(def_ref);
link(def_ref)=q;
}
- define(p, call+(a%4), def_ref);
+ g_define(p, call+(a%4), def_ref);
} @+break;
@ Both \.{\\let} and \.{\\futurelet} share the command code |let|.
@@ -23676,8 +23687,7 @@ case let: if (chr_code!=normal) print_esc("futurelet");@+else print_esc("let");@
case let: {@+n=cur_chr;
get_r_token();p=cur_cs;
if (n==normal)
- {@+@/do@+{get_token();
- }@+ while (!(cur_cmd!=spacer));
+ {@+do get_token(); while (!(cur_cmd!=spacer));
if (cur_tok==other_token+'=')
{@+get_token();
if (cur_cmd==spacer) get_token();
@@ -23690,7 +23700,7 @@ case let: {@+n=cur_chr;
else if ((cur_cmd==internal_register)||(cur_cmd==toks_register))
if ((cur_chr < mem_bot)||(cur_chr > lo_mem_stat_max))
add_sa_ref(cur_chr);
- define(p, cur_cmd, cur_chr);
+ g_define(p, cur_cmd, cur_chr);
} @+break;
@ A \.{\\chardef} creates a control sequence whose |cmd| is |char_given|;
@@ -23745,12 +23755,12 @@ producing an ``undefined control sequence'' error or expanding the
previous meaning. This allows, for instance, `\.{\\chardef\\foo=123\\foo}'.
@<Assignments@>=
-case shorthand_def: {@+n=cur_chr;get_r_token();p=cur_cs;define(p, relax, 256);
+case shorthand_def: {@+n=cur_chr;get_r_token();p=cur_cs;g_define(p, relax, 256);
scan_optional_equals();
switch (n) {
- case char_def_code: {@+scan_char_num();define(p, char_given, cur_val);
+ case char_def_code: {@+scan_char_num();g_define(p, char_given, cur_val);
} @+break;
- case math_char_def_code: {@+scan_fifteen_bit_int();define(p, math_given, cur_val);
+ case math_char_def_code: {@+scan_fifteen_bit_int();g_define(p, math_given, cur_val);
} @+break;
default:{@+scan_register_num();
if (cur_val > 255)
@@ -23758,15 +23768,15 @@ case shorthand_def: {@+n=cur_chr;get_r_token();p=cur_cs;define(p, relax, 256);
if (j > mu_val) j=tok_val; /*|int_val dotdot mu_val| or |tok_val|*/
find_sa_element(j, cur_val, true);add_sa_ref(cur_ptr);
if (j==tok_val) j=toks_register;@+else j=internal_register;
- define(p, j, cur_ptr);
+ g_define(p, j, cur_ptr);
}
else
switch (n) {
- case count_def_code: define(p, assign_int, count_base+cur_val);@+break;
- case dimen_def_code: define(p, assign_dimen, scaled_base+cur_val);@+break;
- case skip_def_code: define(p, assign_glue, skip_base+cur_val);@+break;
- case mu_skip_def_code: define(p, assign_mu_glue, mu_skip_base+cur_val);@+break;
- case toks_def_code: define(p, assign_toks, toks_base+cur_val);
+ case count_def_code: g_define(p, assign_int, count_base+cur_val);@+break;
+ case dimen_def_code: g_define(p, assign_dimen, scaled_base+cur_val);@+break;
+ case skip_def_code: g_define(p, assign_glue, skip_base+cur_val);@+break;
+ case mu_skip_def_code: g_define(p, assign_mu_glue, mu_skip_base+cur_val);@+break;
+ case toks_def_code: g_define(p, assign_toks, toks_base+cur_val);
} /*there are no other cases*/
}
}
@@ -23782,7 +23792,7 @@ case read_to_cs: {@+j=cur_chr;scan_int();n=cur_val;
"I'm going to look for the \\cs now.");error();
}
get_r_token();
- p=cur_cs;read_toks(n, p, j);define(p, call, cur_val);
+ p=cur_cs;read_toks(n, p, j);g_define(p, call, cur_val);
} @+break;
@ The token-list parameters, \.{\\output} and \.{\\everypar}, etc., receive
@@ -23852,7 +23862,7 @@ case assign_dimen: {@+p=cur_chr;scan_optional_equals();
case assign_glue: case assign_mu_glue: {@+p=cur_chr;n=cur_cmd;scan_optional_equals();
if (n==assign_mu_glue) scan_glue(mu_val);@+else scan_glue(glue_val);
trap_zero_glue();
- define(p, glue_ref, cur_val);
+ g_define(p, glue_ref, cur_val);
} @+break;
@ When a glue register or parameter becomes zero, it will always point to
@@ -23915,8 +23925,8 @@ case def_code: {@+@<Let |n| be the largest legal code value, based on |cur_chr|@
help1("I'm going to use 0 instead of that illegal code value.");@/
error();cur_val=0;
}
- if (p < math_code_base) define(p, data, cur_val);
- else if (p < del_code_base) define(p, data, hi(cur_val));
+ if (p < math_code_base) g_define(p, data, cur_val);
+ else if (p < del_code_base) g_define(p, data, hi(cur_val));
else word_define(p, cur_val);
} @+break;
@@ -23929,7 +23939,7 @@ else n=255
@ @<Assignments@>=
case def_family: {@+p=cur_chr;scan_four_bit_int();p=p+cur_val;
- scan_optional_equals();scan_font_ident();define(p, data, cur_val);
+ scan_optional_equals();scan_font_ident();g_define(p, data, cur_val);
} @+break;
@ Next we consider changes to \TeX's numeric registers.
@@ -24137,8 +24147,8 @@ static void alter_integer(void)
{@+small_number c;
/*0 for \.{\\deadcycles}, 1 for \.{\\insertpenalties}, etc.*/
c=cur_chr;scan_optional_equals();scan_int();
-if (c==0) dead_cycles=cur_val
-@/@<Cases for |alter_integer|@>@;@/
+if (c==0) dead_cycles=cur_val;
+else @<Cases for |alter_integer|@>@;
else insert_penalties=cur_val;
}
@@ -24176,7 +24186,7 @@ case set_shape: {@+q=cur_chr;scan_optional_equals();scan_int();n=cur_val;
}
cur_hfactor=fh; cur_vfactor=fv;
}
- define(q, shape_ref, p);
+ g_define(q, shape_ref, p);
} @+break;
@ Here's something that isn't quite so obvious. It guarantees that
@@ -24207,7 +24217,7 @@ new_patterns();goto done;@;
print_err("Patterns can be loaded only by INITEX");
@.Patterns can be...@>
help0;error();
- @/do@+{get_token();}@+ while (!(cur_cmd==right_brace)); /*flush the patterns*/
+ do get_token(); while (!(cur_cmd==right_brace)); /*flush the patterns*/
return;
}
else{@+new_hyph_exceptions();goto done;
@@ -24261,12 +24271,12 @@ else{@+old_setting=selector;selector=new_string;
@.FONTx@>
str_room(1);t=make_string();
}
-define(u, set_font, null_font);scan_optional_equals();scan_file_name();
+g_define(u, set_font, null_font);scan_optional_equals();scan_file_name();
@<Scan the font size specification@>;
@<If this font has already been loaded, set |f| to the internal font number
and |goto common_ending|@>;
f=read_font_info(u, cur_name, cur_area, s);
-common_ending: define(u, set_font, f);eqtb[font_id_base+f]=eqtb[u];font_id_text(f)=t;
+common_ending: g_define(u, set_font, f);eqtb[font_id_base+f]=eqtb[u];font_id_text(f)=t;
}
@ @<Scan the font size specification@>=
@@ -24651,7 +24661,7 @@ so that the inverse relation between them is clear.
The global variable |format_ident| is a string that is printed right
after the |banner| line when \TeX\ is ready to start. For \.{INITEX} this
string says simply `\.{ (INITEX)}'; for other versions of \TeX\ it says,
-for example, `\.{ (preloaded format=plain 1982.11.19)}', showing the year,
+for example, `\.{(preloaded format=plain 1982.11.19)}', showing the year,
month, and day that the format file was created. We have |format_ident==0|
before \TeX's tables are loaded.
@@ -24841,10 +24851,10 @@ sort_avail();var_used=0;
dump_int(lo_mem_max);dump_int(rover);
if (eTeX_ex) for (k=int_val; k<=tok_val; k++) dump_int(sa_root[k]);
p=mem_bot;q=rover;x=0;
-@/do@+{for (k=p; k<=q+1; k++) dump_wd(mem[k]);
+do {for (k=p; k<=q+1; k++) dump_wd(mem[k]);
x=x+q+2-p;var_used=var_used+q-p;
p=q+node_size(q);q=rlink(q);
-}@+ while (!(q==rover));
+} while (!(q==rover));
var_used=var_used+lo_mem_max-p;dyn_used=mem_end+1-hi_mem_min;@/
for (k=p; k<=lo_mem_max; k++) dump_wd(mem[k]);
x=x+lo_mem_max+1-p;
@@ -24866,11 +24876,11 @@ undump(lo_mem_stat_max+1, lo_mem_max, rover);
if (eTeX_ex) for (k=int_val; k<=tok_val; k++)
undump(null, lo_mem_max, sa_root[k]);
p=mem_bot;q=rover;
-@/do@+{for (k=p; k<=q+1; k++) undump_wd(mem[k]);
+do {for (k=p; k<=q+1; k++) undump_wd(mem[k]);
p=q+node_size(q);
if ((p > lo_mem_max)||((q >= rlink(q))&&(rlink(q)!=rover))) goto bad_fmt;
q=rlink(q);
-}@+ while (!(q==rover));
+} while (!(q==rover));
for (k=p; k<=lo_mem_max; k++) undump_wd(mem[k]);
if (mem_min < mem_bot-2) /*make more low memory available*/
{@+p=llink(rover);q=mem_min+1;
@@ -24885,14 +24895,14 @@ for (k=hi_mem_min; k<=mem_end; k++) undump_wd(mem[k]);
undump_int(var_used);undump_int(dyn_used)
@ @<Dump the table of equivalents@>=
-@<Dump regions 1 to 4 of |eqtb|@>;
-@<Dump regions 5 and 6 of |eqtb|@>;
+@<Dump regions 1 to 4 of |eqtb|@>@;
+@<Dump regions 5 and 6 of |eqtb|@>@;
dump_int(par_loc);dump_int(write_loc);@/
dump_int(input_loc);@/
@<Dump the hash table@>@;
@ @<Undump the table of equivalents@>=
-@<Undump regions 1 to 6 of |eqtb|@>;
+@<Undump regions 1 to 6 of |eqtb|@>@;
undump(hash_base, frozen_control_sequence, par_loc);
par_token=cs_token_flag+par_loc;@/
undump(hash_base, frozen_control_sequence, write_loc);@/
@@ -24907,7 +24917,7 @@ copies of $x_n$, namely $(x_1,\ldots,x_n,x_n,\ldots,x_n)$.
@<Dump regions 1 to 4 of |eqtb|@>=
k=active_base;
-@/do@+{j=k;
+do {j=k;
while (j < int_base-1)
{@+if ((equiv(j)==equiv(j+1))&&(eq_type(j)==eq_type(j+1))&&@|
(eq_level(j)==eq_level(j+1))) goto found1;
@@ -24925,10 +24935,10 @@ while (k < l)
{@+dump_wd(eqtb[k]);incr(k);
}
k=j+1;dump_int(k-l);
-}@+ while (!(k==int_base))
+} while (!(k==int_base));
@ @<Dump regions 5 and 6 of |eqtb|@>=
-@/do@+{j=k;
+do {j=k;
while (j < eqtb_size)
{@+if (eqtb[j].i==eqtb[j+1].i) goto found2;
incr(j);
@@ -24944,11 +24954,11 @@ while (k < l)
{@+dump_wd(eqtb[k]);incr(k);
}
k=j+1;dump_int(k-l);
-}@+ while (!(k > eqtb_size))
+} while (!(k > eqtb_size));
@ @<Undump regions 1 to 6 of |eqtb|@>=
k=active_base;
-@/do@+{undump_int(x);
+do {undump_int(x);
if ((x < 1)||(k+x > eqtb_size+1)) goto bad_fmt;
for (j=k; j<=k+x-1; j++) undump_wd(eqtb[j]);
k=k+x;
@@ -24956,7 +24966,7 @@ undump_int(x);
if ((x < 0)||(k+x > eqtb_size+1)) goto bad_fmt;
for (j=k; j<=k+x-1; j++) eqtb[j]=eqtb[k-1];
k=k+x;
-}@+ while (!(k > eqtb_size))
+} while (!(k > eqtb_size));
@ A different scheme is used to compress the hash table, since its lower
region is usually sparse. When |text(p)!=0| for |p <= hash_used|, we output
@@ -24974,8 +24984,8 @@ print_ln();print_int(cs_count);print(" multiletter control sequences")
@ @<Undump the hash table@>=
undump(hash_base, frozen_control_sequence, hash_used);p=hash_base-1;
-@/do@+{undump(p+1, hash_used, p);undump_hh(hash[p]);
-}@+ while (!(p==hash_used));
+do {undump(p+1, hash_used, p);undump_hh(hash[p]);
+} while (!(p==hash_used));
for (p=hash_used+1; p<=undefined_control_sequence-1; p++) undump_hh(hash[p]);
undump_int(cs_count)
@@ -25788,7 +25798,7 @@ case extension: switch (chr_code) {
case ignore_node: print("[HINT internal: ignore]");@+break;
case immediate_code: print_esc("immediate");@+break;
case set_language_code: print_esc("setlanguage");@+break;
- @/@<Cases of |extension| for |print_cmd_chr|@>@/
+ @/@t\4@>@<Cases of |extension| for |print_cmd_chr|@>@;
default:print("[unknown extension!]");
} @+break;
@@ -25979,7 +25989,7 @@ case xdimen_node:
case ignore_node: @+break;
case immediate_code: @<Implement \.{\\immediate}@>@;@+break;
case set_language_code: @<Implement \.{\\setlanguage}@>@;@+break;
-@/@<Cases for |do_extension|@>@/
+@/@t\4@>@<Cases for |do_extension|@>@;
default:confusion("ext1");
@:this can't happen ext1}{\quad ext1@>
}
@@ -26110,7 +26120,7 @@ case language_node: {@+print_esc("setlanguage");
print_int(what_lhm(p));print_char(',');
print_int(what_rhm(p));print_char(')');
} @+break;
-@/@<Cases for displaying the |whatsit| node@>@/
+@/@t\4@>@<Cases for displaying the |whatsit| node@>@;
case param_node: print_esc("parameter ");
print_int(param_type(p));print_char(',');print_int(param_no(p));
print_char(':');print_int(param_value(p).i);
@@ -26251,7 +26261,7 @@ case write_node: case special_node: case latespecial_node: {@+r=get_node(write_n
case close_node: case language_node: {@+r=get_node(small_node_size);
words=small_node_size;
} @+break;
-@/@<Cases for making a partial copy of the whatsit node@>@/
+@/@t\4@>@<Cases for making a partial copy of the whatsit node@>@;
case param_node:
{@+r=get_node(param_node_size);
if (param_type(p)==glue_type) add_glue_ref(param_value(p).i);
@@ -26434,7 +26444,7 @@ case stream_node:
free_node(p,stream_node_size); @+break;
case xdimen_node:
free_node(p,xdimen_node_size);
-@/@<Cases for wiping out the whatsit node@>@/
+@/@t\4@>@<Cases for wiping out the whatsit node@>@;
default:confusion("ext3");
@:this can't happen ext3}{\quad ext3@>
} @/
@@ -26447,7 +26457,7 @@ goto done;
@ @<Let |d| be the width of the whatsit |p|@>=d=0
-@ @d adv_past(A) @+if (subtype(A)==language_node)
+@ @d adv_past(A) if (subtype(A)==language_node)
{@+cur_lang=what_lang(A);l_hyf=what_lhm(A);r_hyf=what_rhm(A);
set_hyph_index;
}
@@ -26546,8 +26556,7 @@ end_token_list() /*conserve stack space*/
@.Unbalanced write...@>
help2("On this page there's a \\write with fewer real {'s than }'s.",@/
"I can't handle that very well; good luck.");error();
-@/do@+{get_token();
-}@+ while (!(cur_tok==end_write_token));
+do get_token(); while (!(cur_tok==end_write_token));
}
@ The |out_what| procedure takes care of outputting whatsit nodes for
@@ -27018,9 +27027,9 @@ a=1;
print_nl("");print_ln();
loop@+{@+print_nl("### ");print_group(true);
if (cur_group==bottom_level) goto done;
- @/do@+{m=nest[p].mode_field;
+ do {m=nest[p].mode_field;
if (p > 0) decr(p);else m=vmode;
- }@+ while (!(m!=hmode));
+ } while (!(m!=hmode));
print(" (");
switch (cur_group) {
case simple_group: {@+incr(p);goto found2;
@@ -27145,7 +27154,7 @@ scanner_status=s;warning_index=w;def_ref=d;
@ The \.{\\showtokens} command displays a token list.
-@d show_tokens 5 /* \.{\\showtokens} , must be odd! */
+@d show_tokens 5 /* \.{\\showtokens}, must be odd! */
@<Generate all \eTeX...@>=
primitive("showtokens", xray, show_tokens);
@@ -27168,9 +27177,9 @@ primitive("unexpanded", the, 1);@/
primitive("detokenize", the, show_tokens);@/
@!@:detokenize\_}{\.{\\detokenize} primitive@>
-@ @<Cases of |the| for |print_cmd_chr|@>=;
-else if (chr_code==1) print_esc("unexpanded");
-else print_esc("detokenize")
+@ @<Cases of |the| for |print_cmd_chr|@>=
+if (chr_code==1) print_esc("unexpanded");
+else print_esc("detokenize");
@ @<Handle \.{\\unexpanded} or \.{\\detokenize} and |return|@>=
if (odd(cur_chr))
@@ -27205,14 +27214,14 @@ case show_ifs: {@+begin_diagnostic();print_nl("");print_ln();
{@+print_nl("### ");print("no active conditionals");
}
else{@+p=cond_ptr;n=0;
- @/do@+{incr(n);p=link(p);@+}@+ while (!(p==null));
+ do {incr(n);p=link(p);@+} while (!(p==null));
p=cond_ptr;t=cur_if;l=if_line;m=if_limit;
- @/do@+{print_nl("### level ");print_int(n);print(": ");
+ do {print_nl("### level ");print_int(n);print(": ");
print_cmd_chr(if_test, t);
if (m==fi_code) print_esc("else");
print_if_line(l);
decr(n);t=subtype(p);l=if_line_field(p);m=type(p);p=link(p);
- }@+ while (!(p==null));
+ } while (!(p==null));
}
} @+break;
@@ -27223,17 +27232,17 @@ interaction mode.
primitive("interactionmode", set_page_int, 2);
@!@:interaction\_mode\_}{\.{\\interactionmode} primitive@>
-@ @<Cases of |set_page_int| for |print_cmd_chr|@>=;
-else if (chr_code==2) print_esc("interactionmode")
+@ @<Cases of |set_page_int| for |print_cmd_chr|@>=
+if (chr_code==2) print_esc("interactionmode");
-@ @<Cases for `Fetch the |dead_cycles| or the |insert_penalties|'@>=;
-else if (m==2) cur_val=interaction
+@ @<Cases for `Fetch the |dead_cycles| or the |insert_penalties|'@>=
+if (m==2) cur_val=interaction;
@ @<Declare \eTeX\ procedures for use...@>=
static void new_interaction(void);
-@ @<Cases for |alter_integer|@>=;
-else if (c==2)
+@ @<Cases for |alter_integer|@>=
+if (c==2)
{@+if ((cur_val < batch_mode)||(cur_val > error_stop_mode))
{@+print_err("Bad interaction mode");
@.Bad interaction mode@>
@@ -27252,8 +27261,8 @@ delimiters to appear between \.{\\left} and \.{\\right}.
primitive("middle", left_right, middle_noad);
@!@:middle\_}{\.{\\middle} primitive@>
-@ @<Cases of |left_right| for |print_cmd_chr|@>=;
-else if (chr_code==middle_noad) print_esc("middle")
+@ @<Cases of |left_right| for |print_cmd_chr|@>=
+if (chr_code==middle_noad) print_esc("middle");
@ The |scan_tokens| feature of \eTeX\ defines the \.{\\scantokens}
primitive.
@@ -27262,11 +27271,11 @@ primitive.
primitive("scantokens", input, 2);
@!@:scan\_tokens\_}{\.{\\scantokens} primitive@>
-@ @<Cases of |input| for |print_cmd_chr|@>=;
-else if (chr_code==2) print_esc("scantokens")
+@ @<Cases of |input| for |print_cmd_chr|@>=
+if (chr_code==2) print_esc("scantokens");
-@ @<Cases for |input|@>=;
-else if (cur_chr==2) pseudo_start()
+@ @<Cases for |input|@>=
+if (cur_chr==2) pseudo_start();
@ The global variable |pseudo_files| is used to maintain a stack of
pseudo files. The |info| field of each pseudo file points to a linked
@@ -27392,8 +27401,8 @@ while (pseudo_files!=null) pseudo_close(); /*flush pseudo files*/
primitive("readline", read_to_cs, 1);@/
@!@:read\_line\_}{\.{\\readline} primitive@>
-@ @<Cases of |read| for |print_cmd_chr|@>=;
-else print_esc("readline")
+@ @<Cases of |read| for |print_cmd_chr|@>=
+print_esc("readline");
@ @<Handle \.{\\readline} and |goto done|@>=
if (j==1)
@@ -27468,9 +27477,9 @@ preceding the mandatory \.{\\endcsname} have been expanded).
@<Cases for |conditional|@>=
case if_cs_code: {@+n=get_avail();p=n; /*head of the list of characters*/
- @/do@+{get_x_token();
+ do {get_x_token();
if (cur_cs==0) store_new_token(cur_tok);
- }@+ while (!(cur_cs!=0));
+ } while (!(cur_cs!=0));
if (cur_cmd!=end_cs_name) @<Complain about missing \.{\\endcsname}@>;
@<Look up the characters of list |n| in the hash table, and set |cur_cs|@>;
flush_list(n);
@@ -27512,8 +27521,8 @@ or during \.{\\write}.
primitive("protected", prefix, 8);
@!@:protected\_}{\.{\\protected} primitive@>
-@ @<Cases of |prefix| for |print_cmd_chr|@>=;
-else if (chr_code==8) print_esc("protected")
+@ @<Cases of |prefix| for |print_cmd_chr|@>=
+if (chr_code==8) print_esc("protected");
@ The |get_x_or_protected| procedure is like |get_x_token| except that
protected macros are not expanded.
@@ -27751,7 +27760,7 @@ resume: if (s==expr_none) o=l;@+else o=int_val;
found: @<Scan the next operator and set |o|@>;
arith_error=b;
@<Make sure that |f| is in the proper range@>;
-switch (s) {@<Cases for evaluation of the current term@>@;
+switch (s) {@t\4@>@<Cases for evaluation of the current term@>@;
} /*there are no other cases*/
if (o > expr_sub) s=o;@+else@<Evaluate the current expression@>;
b=arith_error;
@@ -28412,12 +28421,12 @@ else{@+if (sa_index(q) < mu_val_limit)
else if (sa_ptr(q)!=null) return;
s=pointer_node_size;
}
-@/do@+{i=hex_dig4(sa_index(q));p=q;q=link(p);free_node(p, s);
+do {i=hex_dig4(sa_index(q));p=q;q=link(p);free_node(p, s);
if (q==null) /*the whole tree has been freed*/
{@+sa_root[i]=null;return;
}
delete_sa_ptr;s=index_node_size; /*node |q| is an index node*/
-}@+ while (!(sa_used(q) > 0));
+} while (!(sa_used(q) > 0));
}
@ The |print_sa_num| procedure prints the register number corresponding
@@ -28520,7 +28529,7 @@ if (l < 4) /*|q| is an index node*/
}
else /*|q| is the node for a mark class*/
{@+switch (a) {
- @<Cases for |do_marks|@>@;
+ @t\4@>@<Cases for |do_marks|@>@;
} /*there are no other cases*/
if (sa_bot_mark(q)==null) if (sa_split_bot_mark(q)==null)
{@+free_node(q, mark_class_node_size);q=null;
@@ -28797,7 +28806,7 @@ at by |sa_chain|
@<Declare \eTeX\ procedures for tr...@>=
static void sa_restore(void)
{@+pointer p; /*sparse array element*/
-@/do@+{p=sa_loc(sa_chain);
+do {p=sa_loc(sa_chain);
if (sa_lev(p)==level_one)
{@+if (sa_index(p) >= dimen_val_limit) sa_destroy(sa_chain);
#ifdef @!STAT
@@ -28820,7 +28829,7 @@ delete_sa_ref(p);
p=sa_chain;sa_chain=link(p);
if (sa_index(p) < dimen_val_limit) free_node(p, word_node_size);
else free_node(p, pointer_node_size);
-}@+ while (!(sa_chain==null));
+} while (!(sa_chain==null));
}
@ When reading \.{\\patterns} while \.{\\savinghyphcodes} is positive
@@ -28841,8 +28850,8 @@ hyph_root=0;hyph_start=0;
@ @<Store hyphenation codes for current language@>=
{@+c=cur_lang;first_child=false;p=0;
-@/do@+{q=p;p=trie_r[q];
-}@+ while (!((p==0)||(c <= so(trie_c[p]))));
+do {q=p;p=trie_r[q];
+} while (!((p==0)||(c <= so(trie_c[p]))));
if ((p==0)||(c < so(trie_c[p])))
@<Insert a new trie node between |q| and |p|, and make |p| point to it@>;
q=p; /*now node |q| represents |cur_lang|*/
@@ -28920,9 +28929,9 @@ primitive("pagediscards", un_vbox, last_box_code);@/
primitive("splitdiscards", un_vbox, vsplit_code);@/
@!@:split\_discards\_}{\.{\\splitdiscards} primitive@>
-@ @<Cases of |un_vbox| for |print_cmd_chr|@>=;
-else if (chr_code==last_box_code) print_esc("pagediscards");
-else if (chr_code==vsplit_code) print_esc("splitdiscards")
+@ @<Cases of |un_vbox| for |print_cmd_chr|@>=
+if (chr_code==last_box_code) print_esc("pagediscards");
+else if (chr_code==vsplit_code) print_esc("splitdiscards");
@ @<Handle saved items and |goto done|@>=
{@+link(tail)=disc_ptr[cur_chr];disc_ptr[cur_chr]=null;
@@ -28982,7 +28991,7 @@ expand_depth_count=0;
@* The extended features of \Prote.
\Prote\ extends furthermore \eTeX\ i.e. \eTeX\ is thus required
before adding \Prote\ own extensions. But if \eTeX\ mode has not
-be enabled, the engine is still compatible with \TeX with no added
+be enabled, the engine is still compatible with \TeX\ with no added
primitive commands and with a modification of code---from
\eTeX\ exclusively for now---that is sufficiently minor so that
the engine still deserves the name \TeX.
@@ -29277,7 +29286,7 @@ hash since |no_new_control_sequence| is |true|), but since it has the
for a control sequence entered but never defined.
@ @<Cases for |conditional|@>=
-case if_primitive_code: {@+@/do@+{get_token();}@+ while (!(cur_tok!=space_token));
+case if_primitive_code: {@+do get_token(); while (!(cur_tok!=space_token));
if ((cur_cs!=0)&&(cur_cmd!=undefined_cs)&&(cur_cmd < call)) b=true;else b=false;
} @+break;
@@ -29639,7 +29648,7 @@ dependent. The information shall be set in |xchg_buffer|.
@^system dependencies@>
In this basic implementation, we set the string to the empty one by
-simply setting |xchg_buffer_length| to $0$.
+simply setting |xchg_buffer_length| to~$0$.
@d get_file_mtime xchg_buffer_length=0
@@ -29716,10 +29725,10 @@ case file_dump_code:
{ FILE *f=fopen((char*)name_of_file0,"rb");
if (f!=NULL) {@+
fseek(f,k,SEEK_SET);
- do@+{i=fgetc(f); if (i==EOF) break;
+ do {i=fgetc(f); if (i==EOF) break;
dig[0]=i%16;dig[1]=i/16;
print_the_digs(2);decr(l);
- }@+ while (!(feof(f)||(l==0)));
+ } while (!(feof(f)||(l==0)));
fclose(f);
}
} @+break;
@@ -29819,7 +29828,7 @@ communicate with the routines.
@ To obtain the MD5 hash signature of a file will need an external
implementation, since the algorithm requires bitwise operation that
-standard \PASCAL does not provide. So we do not bother to try. The
+standard \PASCAL\ does not provide. So we do not bother to try. The
present implementation returns nothing.
@^system dependencies@>
@@ -30004,7 +30013,7 @@ else{@+n=(n-1)*mpfract_one;
}
}
-@ The |@/do@+{| loop here preserves the following invariant relations
+@ The |do {| loop here preserves the following invariant relations
between |f|, |p|, and~|q|:
(i)~|0 <= p < q|; (ii)~$fq+p=2^k(q+p_0)$, where $k$ is an integer and
$p_0$ is the original value of~$p$.
@@ -30019,11 +30028,11 @@ in a register, not store it in memory.
@<Compute $f=\lfloor 2^{28}(1+p/q)+{1\over2}\rfloor$@>=
f=1;
-@/do@+{be_careful=p-q;p=be_careful+p;
+do {be_careful=p-q;p=be_careful+p;
if (p >= 0) f=f+f+1;
else{@+double(f);p=p+q;
}
-}@+ while (!(f >= mpfract_one));
+} while (!(f >= mpfract_one));
be_careful=p-q;
if (be_careful+p >= 0) incr(f)
@@ -30046,7 +30055,7 @@ else{@+n=f/mpfract_one;f=f%mpfract_one;
}
}
f=f+mpfract_one;
-@<Compute $p=\lfloor qf/2^{28}+{1\over2}\rfloor-q$@>;
+@<Compute $p=\lfloor qf/2^{28}+{1\over2}\rfloor-q$@>@;
be_careful=n-el_gordo;
if (be_careful+p > 0)
{@+arith_error=true;n=el_gordo-p;
@@ -30071,12 +30080,12 @@ $f_0$ is the original value of~$f$; (ii)~$2^k\L f<2^{k+1}$.
@<Compute $p=\lfloor qf/2^{28}+{1\over2}\rfloor-q$@>=
p=mpfract_half; /*that's $2^{27}$; the invariants hold now with $k=28$*/
if (q < mpfract_four)
- @/do@+{if (odd(f)) p=halfp(p+q);@+else p=halfp(p);
+ do {if (odd(f)) p=halfp(p+q);@+else p=halfp(p);
f=halfp(f);
- }@+ while (!(f==1));
-else@/do@+{if (odd(f)) p=p+halfp(q-p);@+else p=halfp(p);
+ } while (!(f==1));
+else do {if (odd(f)) p=p+halfp(q-p);@+else p=halfp(p);
f=halfp(f);
- }@+ while (!(f==1))
+ } while (!(f==1));
@ There's an auxiliary array |randoms| that contains 55 pseudo-random
fractions. Using the recurrence $x_n=(x_{n-55}-x_{n-31})\bmod 2^{28}$,
@@ -30264,15 +30273,15 @@ can readily be obtained with the ratio method (Algorithm 3.4.1R in
static scaled norm_rand(void)
{@+int @!x, @!u, @!l; /*what the book would call $2^{16}X$, $2^{28}U$,
and $-2^{24}\ln U$*/
-@/do@+{
- @/do@+{next_random;
+do {
+ do {next_random;
x=take_mpfract(112429, randoms[j_random]-mpfract_half);
/*$2^{16}\sqrt{8/e}\approx 112428.82793$*/
next_random;u=randoms[j_random];
- }@+ while (!(abs(x) < u));
+ } while (!(abs(x) < u));
x=make_mpfract(x, u);
l=139548960-m_log(u); /*$2^{24}\cdot12\ln2\approx139548959.6165$*/
-}@+ while (!(ab_vs_cd(1024, l, x, x) >= 0));
+} while (!(ab_vs_cd(1024, l, x, x) >= 0));
return x;
}
@@ -31160,8 +31169,8 @@ if (option_no_empty_page &&
((eject && penalty(p)>2*(eject_penalty)) ||
(page_contents==empty && !is_visible(p))))
{ pointer r, prev_r = p;
- while (true)
- { r =link(prev_r);
+ loop@+{
+ r =link(prev_r);
if (r==null) return;
else if (is_visible(r)) break;
else if (type(r)==penalty_node && penalty(r)<=eject_penalty)
@@ -32006,15 +32015,14 @@ static pointer new_setpage_node(uint8_t i, str_number n)
for (p=link(prev_p); p!=null; prev_p=p,p=link(p))
if (setpage_id(p)==i) break;
if (p==null)
- @<allocate a new |setpage_node| |p|@>@;
+ @<Allocate a new |setpage_node| |p|@>@;
else
link(prev_p)=link(p);
link(p)=link(setpage_head);
link(setpage_head)=p;
return p;
}
-@
-@<allocate a new |setpage_node| |p|@>=
+@ @<Allocate a new |setpage_node| |p|@>=
{ p=get_node(setpage_node_size);type(p)=whatsit_node;subtype(p)=setpage_node;
setpage_number(p)=max_ref[page_kind]=++max_page;
setpage_id(p)=i;
@@ -32316,7 +32324,7 @@ but we will need it repeatedly in the function |hdef_param_node| and the overhea
not warrant having the mapping in both directions.
@<Hi\TeX\ variables@>=
-static const int hmap_int[] ={@/
+static const int hmap_int[] ={@t\1\1@>@/
pretolerance_no, /* |pretolerance_code| 0 */
tolerance_no, /* |tolerance_code| 1 */
line_penalty_no, /* |line_penalty_code| 2 */
@@ -32359,7 +32367,7 @@ year_no, /* |year_code| 23 */
-1, /* |output_penalty_code| 39 */
-1, /* |max_dead_cycles_code| 40 */
hang_after_no, /* |hang_after_code| 41*/
-floating_penalty_no /* |floating_penalty_code| 42*/
+@t\2\2@> floating_penalty_no /* |floating_penalty_code| 42*/
};
@@ -32371,7 +32379,7 @@ floating_penalty_no /* |floating_penalty_code| 42*/
if ( hmap_int[i]>=0) int_defined[hmap_int[i]]=int_par(i);
max_ref[int_kind]=MAX_INT_DEFAULT;
@ The function |hget_int_no| tries to allocate a predefined integer number;
-if not successful, it returns $-1$.
+if not successful, it returns~$-1$.
@<Hi\TeX\ auxiliary routines@>=
static int hget_int_no(int32_t n)
@@ -32414,7 +32422,7 @@ We proceed as we did for integers, starting with the array that holds the define
@<Hi\TeX\ variables@>=
static scaled dimen_defined[0x100]={0};
@ @<Hi\TeX\ variables@>=
-static const int hmap_dimen[] ={@/
+static const int hmap_dimen[] ={@t\1\1@>@/
-1, /* |par_indent_code| 0 */
-1, /* |math_surround_code| 1 */
line_skip_limit_no, /* |line_skip_limit_code| 2 */
@@ -32435,7 +32443,7 @@ static const int hmap_dimen[] ={@/
hang_indent_no, /* |hang_indent_code| 17 */
-1, /* |h_offset_code| 18 */
-1, /* |v_offset_code| 19 */
- emergency_stretch_no /* |emergency_stretch_code| 20 */
+ @t\2\2@> emergency_stretch_no /* |emergency_stretch_code| 20 */
};
@ @<Fix definitions for dimension parameters@>=
dimen_defined[zero_dimen_no]=0;
@@ -32541,8 +32549,7 @@ glue specifications and often a simple comparison of pointers might suffice.
@<Hi\TeX\ variables@>=
static pointer glue_defined[0x100];
@ @<Hi\TeX\ variables@>=
-static int hmap_glue[] ={
-
+static int hmap_glue[] ={@t\1\1@>@/
line_skip_no, /* |line_skip_code| 0 */
baseline_skip_no, /* |baseline_skip_code| 1 */
-1, /* |par_skip_code| 2 */
@@ -32557,7 +32564,7 @@ split_top_skip_no, /* |split_top_skip_code| 10 */
tab_skip_no, /* |tab_skip_code| 11 */
-1, /* |space_skip_code| 12 */
-1, /* |xspace_skip_code| 13 */
-par_fill_skip_no /* |par_fill_skip_code| 14 */
+@t\2\2@> par_fill_skip_no /* |par_fill_skip_code| 14 */
};
@ @<Fix definitions for glue parameters@>=
glue_defined[zero_skip_no]=zero_glue; incr(glue_ref_count(zero_glue));
@@ -32809,8 +32816,8 @@ static bool node_equal(pointer p, pointer q)
}
static bool list_equal(pointer p, pointer q)
-{@+while (true)
- { if (p==q) return true;
+{@+loop@+{
+ if (p==q) return true;
if (p==null || q==null) return false;
if (!node_equal(p,q)) return false;
p=link(p);q=link(q);
@@ -34388,7 +34395,7 @@ static const char *option_mfmode="ljfour", *option_dpi_str="600";
extern int option_compress;
extern unsigned int debugflags;
-static struct option long_options[] = {@/
+static struct option long_options[] = {@t\1\1@>@/
{ "help", 0, 0, 0 },@/
{ "version", 0, 0, 0 },@/
{ "interaction", 1, 0, 0 },@/
@@ -34419,8 +34426,8 @@ static struct option long_options[] = {@/
{ "hint-debug", 1, 0, 0 },@/
{ "hint-debug-help", 0, 0, 0 },@/
#endif
- { 0, 0, 0, 0 }@+}@+;
-
+@t\2\2@> { 0, 0, 0, 0 } @/
+};
@ Parsing the command line options is accomplished with the
|parse_options| function which in turn uses the |getopt_long_only|
@@ -34429,7 +34436,7 @@ function from the \CEE/ library. This function returns 0 and sets the
the end of all options is reached.
@<\TeX\ Live functions@>=
static void parse_options (int argc, char *argv[])
-{@+ while (true) {
+{@+ loop @+ {
int option_index;
int g = getopt_long_only (argc, argv, "+", long_options, &option_index);
if (g==0)
@@ -34479,7 +34486,7 @@ the option structure.
#include <kpathsea/kpathsea.h>
static int argument_is(struct option *opt, char * s)
{@+ return STREQ(opt->name, s); @+}
-#define ARGUMENT_IS(S) argument_is(long_options+option_index,S)
+#define ARGUMENT_IS(S) @[argument_is(long_options+option_index,S)@]
@ Now we can handle the first two options:
@@ -35102,7 +35109,7 @@ last=first;
while (optind < argc) input_add_str(argv[optind++]);
loc=first;
return (loc < last);
-@+ }
+}
@ @<Forward declarations@>=
static int input_command_line(void);
@@ -35349,6 +35356,8 @@ static int get_md5_sum(int s, int file);
@ The code that follows was taken from the \.{texmfmp.c} file of
the \TeX\ Live distribution and slightly modified.
+@s md5_byte_t int
+@s md5_state_t int
@<\TeX\ Live auxiliary functions@>=
@@ -35407,17 +35416,17 @@ make_time_str(time_t t, bool utc)
static void get_creation_date(void)
{ make_time_str(start_time,source_date_epoch!=NULL);
}
-
-/* static structure for file status set by |find_input_file| */
+@#
#ifdef WIN32
+/* static structure for file status set by |find_input_file| */
+@+@t}\6{@>
static struct _stat file_stat;
-#define GET_FILE_STAT _stat(fname,&file_stat)
+#define GET_FILE_STAT @[_stat(fname,&file_stat)@]
#else
static struct stat file_stat;
-#define GET_FILE_STAT stat(fname,&file_stat)
+#define GET_FILE_STAT @[stat(fname,&file_stat)@]
#endif
-
static char* find_input_file(void)
{ char *fname;
int r;
diff --git a/Build/source/texk/web2c/luatexdir/ChangeLog b/Build/source/texk/web2c/luatexdir/ChangeLog
index b64e20f8e9c..282484e2f84 100644
--- a/Build/source/texk/web2c/luatexdir/ChangeLog
+++ b/Build/source/texk/web2c/luatexdir/ChangeLog
@@ -1,8 +1,17 @@
-2024-04-28 Luigi Scarso <luigi.scarso@gmail.com>
-
- * am/luaharfbuzz.am (libluajitharfbuzz_a_CPPFLAGS),
- * am/luamisc.am (libluajitmisc_a_CPPFLAGS):
- * am/luasocket.am (libluajitsocket_a_CPPFLAGS): add $(LUAJIT_DEFINES).
+2024-05-11 Luigi Scarso <luigi.scarso@gmail.com>
+ * allow interactive deletion of \outer token, see https://tug.org/texmfbug/newbug.html#B142outer
+
+
+2024-05-13 Luigi Scarso <luigi.scarso@gmail.com>
+ * Omitprocset and ptexprefix (force _ instead of . as separator) (H.Hagen)
+ * Bump to version 1.18.2
+
+2024-03-25 Luigi Scarso <luigi.scarso@gmail.com>
+ * Fixed synctex message on a math node with no zero glue
+
+2024-03-20 Luigi Scarso <luigi.scarso@gmail.com>
+ * Fixed wrong initialization of startup_filename (thanks to Wang Weixuan).
+
2024-03-10 Karl Berry <karl@tug.org>
diff --git a/Build/source/texk/web2c/luatexdir/image/epdf.h b/Build/source/texk/web2c/luatexdir/image/epdf.h
index 737682d791a..5e280a4ceec 100644
--- a/Build/source/texk/web2c/luatexdir/image/epdf.h
+++ b/Build/source/texk/web2c/luatexdir/image/epdf.h
@@ -101,6 +101,8 @@ extern void pdf_dict_add_ref(PDF, const char *key, int num);
extern void pdf_dict_add_name(PDF, const char *key, const char *val);
extern void pdf_dict_add_streaminfo(PDF);
+extern const char *pdf_pdf_prefix_str(const char *a, const char *b);
+
/* Conflict with pdfgen.h */
/*# define pdf_out(pdf, A) do { pdf_room(pdf, 1); *(pdf->buf->p++) = A; } while (0)*/
/*# define pdf_quick_out(pdf,A) *(pdf->buf->p++)=(unsigned char)(A) */
diff --git a/Build/source/texk/web2c/luatexdir/image/pdftoepdf.c b/Build/source/texk/web2c/luatexdir/image/pdftoepdf.c
index ca68ba8dcdb..315d6bdacc7 100644
--- a/Build/source/texk/web2c/luatexdir/image/pdftoepdf.c
+++ b/Build/source/texk/web2c/luatexdir/image/pdftoepdf.c
@@ -822,15 +822,12 @@ void write_epdf(PDF pdf, image_dict * idict, int suppress_optional_info)
*/
pdf_dict_add_img_filename(pdf, idict);
if ((suppress_optional_info & 4) == 0) {
- pdf_dict_add_int(pdf, "PTEX.PageNumber", (int) img_pagenum(idict));
+ pdf_dict_add_int(pdf, pdf_pdf_prefix_str("PTEX_PageNumber", "PTEX.PageNumber"), (int) img_pagenum(idict));
}
if ((suppress_optional_info & 8) == 0) {
infoDict = ppdoc_info(pdfe);
if (infoDict != NULL) {
- /* todo : check this
- pdf_dict_add_ref(pdf, "PTEX.InfoDict", addInObj(pdf, pdf_doc, infoDict));
- */
- pdf_add_name(pdf, "PTEX.InfoDict");
+ pdf_add_name(pdf,pdf_pdf_prefix_str("PTEX_InfoDict", "PTEX.InfoDict"));
copyDict(pdf, pdf_doc, infoDict);
}
}
diff --git a/Build/source/texk/web2c/luatexdir/image/writeimg.c b/Build/source/texk/web2c/luatexdir/image/writeimg.c
index f544e6b6814..d5988b0adf4 100644
--- a/Build/source/texk/web2c/luatexdir/image/writeimg.c
+++ b/Build/source/texk/web2c/luatexdir/image/writeimg.c
@@ -735,7 +735,7 @@ void pdf_dict_add_img_filename(PDF pdf, image_dict * idict)
p = img_filepath(idict);
}
/*tex write additional information */
- pdf_add_name(pdf, "PTEX.FileName");
+ pdf_add_name(pdf, pdf_pdf_prefix_str("PTEX_FileName", "PTEX.InfoDict"));
pdf_printf(pdf, " (%s)", convertStringToPDFString(p, strlen(p)));
}
}
diff --git a/Build/source/texk/web2c/luatexdir/image/writeimg.h b/Build/source/texk/web2c/luatexdir/image/writeimg.h
index 96771decd35..2458b1768bb 100644
--- a/Build/source/texk/web2c/luatexdir/image/writeimg.h
+++ b/Build/source/texk/web2c/luatexdir/image/writeimg.h
@@ -28,6 +28,8 @@
typedef image_dict *idict_entry;
extern idict_entry *idict_array;
+extern const char *pdf_pdf_prefix_str(const char *a, const char *b);
+
void new_img_pdfstream_struct(image_dict *);
image *new_image(void);
image_dict *new_image_dict(void);
diff --git a/Build/source/texk/web2c/luatexdir/lua/lpdflib.c b/Build/source/texk/web2c/luatexdir/lua/lpdflib.c
index 7cd4b8d4943..4dd9247796c 100644
--- a/Build/source/texk/web2c/luatexdir/lua/lpdflib.c
+++ b/Build/source/texk/web2c/luatexdir/lua/lpdflib.c
@@ -17,7 +17,6 @@
You should have received a copy of the GNU General Public License along
with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
-
#include "ptexlib.h"
#include "lua/luatex-api.h"
#include "pdf/pdftables.h"
@@ -826,6 +825,18 @@ static int getpdfomitmediabox(lua_State * L)
return 1 ;
}
+static int getpdfomitprocset(lua_State * L)
+{
+ lua_pushinteger(L, (pdf_omit_procset));
+ return 1 ;
+}
+
+static int getpdfptexprefix(lua_State * L)
+{
+ lua_pushinteger(L, (pdf_ptex_prefix));
+ return 1 ;
+}
+
static int setpdfgentounicode(lua_State * L)
{
/* ensures that glyph_unicode_tree is not null */
@@ -868,6 +879,22 @@ static int setpdfomitmediabox(lua_State * L)
return 0 ;
}
+static int setpdfomitprocset(lua_State * L)
+{
+ if (lua_type(L, 1) == LUA_TNUMBER) {
+ set_pdf_omit_procset(lua_tointeger(L, 1));
+ }
+ return 0 ;
+}
+
+static int setpdfptexprefix(lua_State * L)
+{
+ if (lua_type(L, 1) == LUA_TNUMBER) {
+ set_pdf_ptex_prefix(lua_tointeger(L, 1));
+ }
+ return 0 ;
+}
+
/* for tracing purposes when no pages are flushed */
static int setforcefile(lua_State * L)
@@ -1382,6 +1409,8 @@ static const struct luaL_Reg pdflib[] = {
{ "getomitcharset", getpdfomitcharset },
{ "getomitinfo", getpdfomitinfodict },
{ "getomitmediabox", getpdfomitmediabox },
+ { "getomitprocset", getpdfomitprocset },
+ { "getptexprefix", getpdfptexprefix },
{ "setinclusionerrorlevel", setpdfinclusionerrorlevel },
{ "setignoreunknownimages", setpdfignoreunknownimages },
{ "setgentounicode", setpdfgentounicode },
@@ -1389,6 +1418,8 @@ static const struct luaL_Reg pdflib[] = {
{ "setomitcharset", setpdfomitcharset },
{ "setomitinfo", setpdfomitinfodict },
{ "setomitmediabox", setpdfomitmediabox },
+ { "setomitprocset", setpdfomitprocset },
+ { "setptexprefix", setpdfptexprefix },
{ "setforcefile", setforcefile },
{ "mapfile", l_mapfile },
{ "mapline", l_mapline },
diff --git a/Build/source/texk/web2c/luatexdir/luatex.c b/Build/source/texk/web2c/luatexdir/luatex.c
index 0b4158518fa..9ad8c1bf45f 100644
--- a/Build/source/texk/web2c/luatexdir/luatex.c
+++ b/Build/source/texk/web2c/luatexdir/luatex.c
@@ -33,8 +33,8 @@
*/
int luatex_version = 118;
-int luatex_revision = '1';
-const char *luatex_version_string = "1.18.1";
+int luatex_revision = '2';
+const char *luatex_version_string = "1.18.2";
const char *engine_name = my_name;
#include <kpathsea/c-ctype.h>
diff --git a/Build/source/texk/web2c/luatexdir/luatex_svnversion.h b/Build/source/texk/web2c/luatexdir/luatex_svnversion.h
index 29fa2dfb368..5422bb4ad06 100644
--- a/Build/source/texk/web2c/luatexdir/luatex_svnversion.h
+++ b/Build/source/texk/web2c/luatexdir/luatex_svnversion.h
@@ -1,4 +1,4 @@
#ifndef luatex_svn_revision_h
#define luatex_svn_revision_h
-#define luatex_svn_revision 7616
+#define luatex_svn_revision 7621
#endif
diff --git a/Build/source/texk/web2c/luatexdir/pdf/pdfgen.c b/Build/source/texk/web2c/luatexdir/pdf/pdfgen.c
index 076b324e334..61dfbec1540 100644
--- a/Build/source/texk/web2c/luatexdir/pdf/pdfgen.c
+++ b/Build/source/texk/web2c/luatexdir/pdf/pdfgen.c
@@ -2020,7 +2020,7 @@ void pdf_end_page(PDF pdf)
pdf_end_dict(pdf);
}
/*tex Generate |ProcSet| in version 1.*/
- if (pdf->major_version == 1) {
+ if (pdf->major_version == 1 && ! pdf_omit_procset) {
pdf_add_name(pdf, "ProcSet");
pdf_begin_array(pdf);
if ((procset & PROCSET_PDF) != 0)
@@ -2130,6 +2130,11 @@ static boolean substr_of_str(const char *s, const char *t)
return true;
}
+const char* pdf_pdf_prefix_str(const char *a, const char *b)
+{
+ return (pdf_ptex_prefix ? a : b);
+}
+
static int pdf_print_info(PDF pdf, int luatexversion, str_number luatexrevision)
{
boolean creator_given = false;
@@ -2195,7 +2200,7 @@ static int pdf_print_info(PDF pdf, int luatexversion, str_number luatexrevision)
pdf_dict_add_name(pdf, "Trapped", "False");
}
if ((pdf_suppress_optional_info & 1) == 0) {
- pdf_dict_add_string(pdf, "PTEX.FullBanner", luatex_banner);
+ pdf_dict_add_string(pdf, pdf_pdf_prefix_str("PTEX_FullBanner", "PTEX.FullBanner"), luatex_banner);
}
pdf_end_dict(pdf);
pdf_end_obj(pdf);
diff --git a/Build/source/texk/web2c/luatexdir/pdf/pdfgen.h b/Build/source/texk/web2c/luatexdir/pdf/pdfgen.h
index 00df7f36ed3..42c9361d179 100644
--- a/Build/source/texk/web2c/luatexdir/pdf/pdfgen.h
+++ b/Build/source/texk/web2c/luatexdir/pdf/pdfgen.h
@@ -251,5 +251,8 @@ extern void pdf_set_reference_point(PDF pdf, posstructure *refpoint);
extern void check_o_mode(PDF pdf, const char *s, int o_mode, boolean errorflag);
extern void ensure_output_file_open(PDF pdf, const char *ext);
+/* PTEX prefix */
+extern const char *pdf_pdf_prefix_str(const char *a, const char *b);
+
#endif
diff --git a/Build/source/texk/web2c/luatexdir/pdf/pdflink.c b/Build/source/texk/web2c/luatexdir/pdf/pdflink.c
index ed908e6456c..db154ce9483 100644
--- a/Build/source/texk/web2c/luatexdir/pdf/pdflink.c
+++ b/Build/source/texk/web2c/luatexdir/pdf/pdflink.c
@@ -122,7 +122,7 @@ void end_link(PDF pdf, halfword p)
pdf_ann_left(q) = pos.h;
if (pdf_ann_left(q) > pdf_ann_right(q)) {
halfword r = pdf_ann_right(q);
- halfword l = pdf_ann_left(q);
+ /* halfword l = pdf_ann_left(q); */
pdf_ann_right(q) = pos.h - r;
pdf_ann_left(q) = pos.h;
}
diff --git a/Build/source/texk/web2c/luatexdir/pdf/pdflistout.c b/Build/source/texk/web2c/luatexdir/pdf/pdflistout.c
index 29eb883323c..f18ee034244 100644
--- a/Build/source/texk/web2c/luatexdir/pdf/pdflistout.c
+++ b/Build/source/texk/web2c/luatexdir/pdf/pdflistout.c
@@ -498,6 +498,7 @@ void hlist_out(PDF pdf, halfword this_box, int rule_callback_id)
break;
} else {
/*tex Fall through |mathskip|. */
+ /* No break; we have to go on to glue_node case.*/
}
/*tex End |mathskip| code. */
case glue_node:
@@ -812,8 +813,12 @@ void hlist_out(PDF pdf, halfword this_box, int rule_callback_id)
MOVE_PAST:
cur.h += rule.wd;
if (synctex) {
- synch_pos_with_cur(pdf->posstruct, refpos, cur);
+ synch_pos_with_cur(pdf->posstruct, refpos, cur);
+ if( type(p) == math_node && !glue_is_zero(p) ) {
+ normal_warning("listout","synctex doesn't support math node with not zero glue");
+ } else {
synctexhorizontalruleorglue(p, this_box);
+ }
}
NEXTP:
p = vlink(p);
diff --git a/Build/source/texk/web2c/luatexdir/pdf/pdftables.h b/Build/source/texk/web2c/luatexdir/pdf/pdftables.h
index 578b44aa778..e3878aea102 100644
--- a/Build/source/texk/web2c/luatexdir/pdf/pdftables.h
+++ b/Build/source/texk/web2c/luatexdir/pdf/pdftables.h
@@ -144,6 +144,8 @@ typedef enum {
c_pdf_omit_infodict,
c_pdf_omit_mediabox,
c_pdf_linking,
+ c_pdf_omit_procset,
+ c_pdf_ptex_prefix,
} pdf_backend_counters ;
typedef enum {
@@ -197,6 +199,8 @@ extern int pdf_cur_form;
# define pdf_omit_mediabox get_tex_extension_count_register(c_pdf_omit_mediabox)
# define pdf_recompress get_tex_extension_count_register(c_pdf_recompress)
# define pdf_linking get_tex_extension_count_register(c_pdf_linking)
+# define pdf_omit_procset get_tex_extension_count_register(c_pdf_omit_procset)
+# define pdf_ptex_prefix get_tex_extension_count_register(c_pdf_ptex_prefix)
# define pdf_h_origin get_tex_extension_dimen_register(d_pdf_h_origin)
# define pdf_v_origin get_tex_extension_dimen_register(d_pdf_v_origin)
@@ -224,6 +228,8 @@ extern int pdf_cur_form;
# define set_pdf_gen_tounicode(i) set_tex_extension_count_register(c_pdf_gen_tounicode,i)
# define set_pdf_recompress(i) set_tex_extension_count_register(c_pdf_recompress,i)
# define set_pdf_linking(i) set_tex_extension_count_register(c_pdf_linking,i)
+# define set_pdf_omit_procset(i) set_tex_extension_count_register(c_pdf_omit_procset,i)
+# define set_pdf_ptex_prefix(i) set_tex_extension_count_register(c_pdf_ptex_prefix,i)
# define set_pdf_decimal_digits(i) set_tex_extension_count_register(c_pdf_decimal_digits,i)
# define set_pdf_pk_resolution(i) set_tex_extension_count_register(c_pdf_pk_resolution,i)
diff --git a/Build/source/texk/web2c/luatexdir/tex/textoken.c b/Build/source/texk/web2c/luatexdir/tex/textoken.c
index 4abe6377b55..8fef4f5916e 100644
--- a/Build/source/texk/web2c/luatexdir/tex/textoken.c
+++ b/Build/source/texk/web2c/luatexdir/tex/textoken.c
@@ -882,7 +882,7 @@ void check_outer_validity(void)
halfword q;
if (suppress_outer_error_par)
return;
- if (scanner_status != normal) {
+ if ( OK_to_interrupt && (scanner_status != normal)) {
deletions_allowed = false;
/*tex
@@ -2624,6 +2624,8 @@ static int do_variable_pdf(halfword c)
else if (scan_keyword("omitinfodict")) { do_variable_backend_int(c_pdf_omit_infodict); }
else if (scan_keyword("omitmediabox")) { do_variable_backend_int(c_pdf_omit_mediabox); }
else if (scan_keyword("linking")) { do_variable_backend_int(c_pdf_linking); }
+ else if (scan_keyword("omitprocset")) { do_variable_backend_int(c_pdf_omit_procset); }
+ else if (scan_keyword("ptexprefix")) { do_variable_backend_int(c_pdf_ptex_prefix); }
else if (scan_keyword("horigin")) { do_variable_backend_dimen(d_pdf_h_origin); }
else if (scan_keyword("vorigin")) { do_variable_backend_dimen(d_pdf_v_origin); }
diff --git a/Build/source/texk/web2c/mf.ch b/Build/source/texk/web2c/mf.ch
index af7a1ca1e9f..f293a65b0ae 100644
--- a/Build/source/texk/web2c/mf.ch
+++ b/Build/source/texk/web2c/mf.ch
@@ -21,7 +21,7 @@
% Incorporates: New binary I/O library, separate optimized
% arithmetic for takefraction/makefraction, new graphics interface.
-@x [0] WEAVE: print changes only.
+@x [0.0] l.75 - WEAVE: print changes only.
\def\botofcontents{\vskip 0pt plus 1fil minus 1.5in}
@y
\def\botofcontents{\vskip 0pt plus 1fil minus 1.5in}
@@ -30,17 +30,17 @@
\def\glob{13}\def\gglob{20, 25} % these are defined in module 1
@z
-@x [1.6] Purge non-local 'goto' label.
+@x [1.6] l.246 - Purge non-local 'goto' label.
@d end_of_MF=9998 {go here to close files and terminate gracefully}
@y
@z
-@x
+@x [1.6] l.250
start_of_MF@t\hskip-2pt@>, end_of_MF@t\hskip-2pt@>,@,final_end;
@y
start_of_MF@t\hskip-2pt@>,@,final_end;
@z
-@x [1.7] Convert `debug..gubed' and `stat..tats' into #ifdefs.
+@x [1.7] l.267 - Convert `debug..gubed' and `stat..tats' into #ifdefs.
@d debug==@{ {change this to `$\\{debug}\equiv\null$' when debugging}
@d gubed==@t@>@} {change this to `$\\{gubed}\equiv\null$' when debugging}
@y
@@ -48,7 +48,7 @@ start_of_MF@t\hskip-2pt@>,@,final_end;
@d gubed==endif('TEXMF_DEBUG')
@z
-@x [1.7]
+@x [1.7] l.272
@d stat==@{ {change this to `$\\{stat}\equiv\null$' when gathering
usage statistics}
@d tats==@t@>@} {change this to `$\\{tats}\equiv\null$' when gathering
@@ -58,7 +58,7 @@ start_of_MF@t\hskip-2pt@>,@,final_end;
@d tats==endif('STAT')
@z
-@x [1.8] Same, for `init..tini'.
+@x [1.8] l.287 - Same, for `init..tini'.
@d init== {change this to `$\\{init}\equiv\.{@@\{}$' in the production version}
@d tini== {change this to `$\\{tini}\equiv\.{@@\}}$' in the production version}
@y
@@ -69,7 +69,7 @@ start_of_MF@t\hskip-2pt@>,@,final_end;
% [1.11] Compile-time constants. Although we only change a few of
% these, listing them all makes the patch file for a big Metafont simpler.
% 16K for BSD I/O; file_name_size is set from the system constant.
-@x
+@x [1.11] l.348
@<Constants...@>=
@!mem_max=30000; {greatest index in \MF's internal |mem| array;
must be strictly less than |max_halfword|;
@@ -145,7 +145,7 @@ start_of_MF@t\hskip-2pt@>,@,final_end;
@!sup_buf_size = 30000000;
@z
-@x [1.12] Constants defined as WEB macros.
+@x [1.12] l.397 - Constants defined as WEB macros.
@d mem_min=0 {smallest index in the |mem| array, must not be less
than |min_halfword|}
@d mem_top==30000 {largest index in the |mem| array dumped by \.{INIMF};
@@ -168,7 +168,7 @@ start_of_MF@t\hskip-2pt@>,@,final_end;
@d param_size=150 {maximum number of simultaneous macro parameters}
@z
-@x [1.13] Global parameters that can be changed in texmf.cnf.
+@x [1.13] l.416 - Global parameters that can be changed in texmf.cnf.
@<Glob...@>=
@!bad:integer; {is some ``constant'' wrong?}
@y
@@ -211,7 +211,7 @@ tini@/
@!quoted_filename:boolean; {current filename is quoted}
@z
-@x [1.16] Use C macros for `incr' and `decr'.
+@x [1.16] l.468 - Use C macros for `incr' and `decr'.
@d incr(#) == #:=#+1 {increase a variable by unity}
@d decr(#) == #:=#-1 {decrease a variable by unity}
@y
@@ -220,13 +220,13 @@ tini@/
% [2.19] The text_char type is used as an array index into xord. The
% default type `char' produces signed integers, which are bad array
% indices in C.
-@x
+@x [2.19] l.524
@d text_char == char {the data type of characters in text files}
@y
@d text_char == ASCII_code {the data type of characters in text files}
@z
-@x [2.22] Allow any character as input.
+@x [2.22] l.665 - Allow any character as input.
@^character set dependencies@>
@^system dependencies@>
@@ -246,7 +246,7 @@ for i:=0 to @'37 do xchr[i]:=i;
for i:=@'177 to @'377 do xchr[i]:=i;
@z
-@x [2.23]
+@x [2.23] l.681
for i:=0 to @'176 do xord[xchr[i]]:=i;
@y
for i:=0 to @'176 do xord[xchr[i]]:=i;
@@ -266,14 +266,14 @@ if translate_filename then read_tcx_file;
% [3.25] Declare name_of_file as a C string. See comments in tex.ch for
% why we change the element type to text_char.
-@x
+@x [3.25] l.737
@!name_of_file:packed array[1..file_name_size] of char;@;@/
{on some systems this may be a \&{record} variable}
@y
@!name_of_file:^text_char;
@z
-@x [3.26] Do file opening in C.
+@x [3.26] l.742 - Do file opening in C.
@ The \ph\ compiler with which the present version of \MF\ was prepared has
extended the rules of \PASCAL\ in a very convenient way. To open file~|f|,
we can write
@@ -328,7 +328,7 @@ end;
@ All of the file opening functions are defined in C.
@z
-@x [3.27] Do file closing in C.
+@x [3.27] l.793 - Do file closing in C.
@ Files can be closed with the \ph\ routine `|close(f)|', which
@:PASCAL H}{\ph@>
@^system dependencies@>
@@ -352,13 +352,13 @@ end;
@ And all the file closing routines as well.
@z
-@x [3.29] Array size of input buffer is determined at runtime.
+@x [3.29] l.829 - Array size of input buffer is determined at runtime.
@!buffer:array[0..buf_size] of ASCII_code; {lines of characters being read}
@y
@!buffer:^ASCII_code; {lines of characters being read}
@z
-@x [3.30] Do `input_ln' in C.
+@x [3.30] l.862 - Do `input_ln' in C.
Standard \PASCAL\ says that a file should have |eoln| immediately
before |eof|, but \MF\ needs only a weaker restriction: If |eof|
occurs in the middle of a line, the system function |eoln| should return
@@ -392,7 +392,7 @@ We define |input_ln| in C, for efficiency. Nevertheless we quote the module
@p @{ @<Report overflow of the input buffer, and abort@> @}
@z
-@x [3.31] `term_in' and `term_out' are standard input and output.
+@x [3.31] l.894 - `term_in' and `term_out' are standard input and output.
@<Glob...@>=
@!term_in:alpha_file; {the terminal as an input file}
@!term_out:alpha_file; {the terminal as an output file}
@@ -401,7 +401,7 @@ We define |input_ln| in C, for efficiency. Nevertheless we quote the module
@d term_out==stdout {the terminal as an output file}
@z
-@x [3.32] We don't need to open the terminal files.
+@x [3.32] l.898 - We don't need to open the terminal files.
@ Here is how to open the terminal files
in \ph. The `\.{/I}' switch suppresses the first |get|.
@:PASCAL H}{\ph@>
@@ -418,7 +418,7 @@ any command line arguments the user has provided. It's defined in C.
@d t_open_out == {output already open for text output}
@z
-@x [3.33] Flushing output.
+@x [3.33] l.918 - Flushing output.
these operations can be specified in \ph:
@:PASCAL H}{\ph@>
@^system dependencies@>
@@ -435,7 +435,7 @@ to do nothing, since the user should control the terminal.
@d clear_terminal == do_nothing
@z
-@x [3.36] Reading the command line.
+@x [3.36] l.991 - Reading the command line.
@ The following program does the required initialization
without retrieving a possible command line.
It should be clear how to modify this routine to deal with command lines,
@@ -507,7 +507,7 @@ exit:
end;
@z
-@x [4.49] l.1239 -- change documentation (probably needed in more places)
+@x [4.49] l.1253 - change documentation (probably needed in more places)
would like string @'32 to be the single character @'32 instead of the
@y
would like string @'32 to be printed as the single character @'32 instead
@@ -518,7 +518,7 @@ of the
% assignments directly. (`strcpy' and `strlen' work here because
% `pool_name' is a constant string, and thus ends in a null and doesn't
% start with a space.)
-@x
+@x [4.51] l.1292
name_of_file:=pool_name; {we needn't set |name_length|}
if a_open_in(pool_file) then
@y
@@ -528,12 +528,12 @@ strcpy (stringcast(name_of_file+1), pool_name); {copy the string}
if a_open_in (pool_file, kpse_mfpool_format) then
@z
-@x [4.51,52,53] Make `MF.POOL' lowercase, and change how it's read.
+@x [4.51] l.1300 - Make `MF.POOL' lowercase, and change how it's read.
else bad_pool('! I can''t read MF.POOL.')
@y
else bad_pool('! I can''t read ', pool_name, '; bad path?')
@z
-@x
+@x [4.52] l.1304
begin if eof(pool_file) then bad_pool('! MF.POOL has no check sum.');
@.MF.POOL has no check sum@>
read(pool_file,m,n); {read two digits of string length}
@@ -542,42 +542,42 @@ begin if eof(pool_file) then bad_pool('! ', pool_name, ' has no check sum.');
@.MF.POOL has no check sum@>
read(pool_file,m); read(pool_file,n); {read two digits of string length}
@z
-@x
+@x [4.52] l.1310
bad_pool('! MF.POOL line doesn''t begin with two digits.');
@y
bad_pool('! ', pool_name, ' line doesn''t begin with two digits.');
@z
-@x
+@x [4.53] l.1332
bad_pool('! MF.POOL check sum doesn''t have nine digits.');
@y
bad_pool('! ', pool_name, ' check sum doesn''t have nine digits.');
@z
-@x
+@x [4.53] l.1338
done: if a<>@$ then bad_pool('! MF.POOL doesn''t match; TANGLE me again.');
@y
done: if a<>@$ then
bad_pool('! ', pool_name, ' doesn''t match; tangle me again (or fix the path).');
@z
-@x [5.54] error_line is a variable, so can't be a subrange array bound
+@x [5.54] l.1398 - error_line is a variable, so can't be a subrange array bound
@!trick_buf:array[0..error_line] of ASCII_code; {circular buffer for
@y
@!trick_buf:array[0..ssup_error_line] of ASCII_code; {circular buffer for
@z
-@x [5.58] Do not expand printable characters.
+@x [5.59] l.1478 - Do not expand printable characters.
if (s<256)and(selector>pseudo) then print_char(s)
@y
if (s<256)and((selector>pseudo)or xprn[s]) then print_char(s)
@z
-@x [5.59] Do not expand printable characters.
+@x [5.60] l.1494 - Do not expand printable characters.
if (s<256)and(selector>pseudo) then print_char(s)
@y
if (s<256)and((selector>pseudo) or xprn[s])then print_char(s)
@z
-@x [5.61] Print rest of banner.
+@x [5.61] l.1509 - Print rest of banner.
wterm(banner);
if base_ident=0 then wterm_ln(' (no base preloaded)')
else begin slow_print(base_ident); print_ln;
@@ -595,14 +595,14 @@ if translate_filename then begin
end;
@z
-@x [6.68] l.1603 - Add unspecified_mode.
+@x [6.68] l.1618 - Add unspecified_mode.
@d error_stop_mode=3 {stops at every opportunity to interact}
@y
@d error_stop_mode=3 {stops at every opportunity to interact}
@d unspecified_mode=4 {extra value for command-line switch}
@z
-@x [6.68] l.1605 - file:line:error style messages.
+@x [6.68] l.1620 - file:line:error style messages.
print_nl("! "); print(#);
@y
if (file_line_error_style_p and not terminal_input) then
@@ -615,14 +615,14 @@ end;
else begin print_nl("! "); print(#) end;
@z
-@x [6.68] l.1610 - Add interaction_option.
+@x [6.68] l.1625 - Add interaction_option.
@!interaction:batch_mode..error_stop_mode; {current level of interaction}
@y
@!interaction:batch_mode..error_stop_mode; {current level of interaction}
@!interaction_option:batch_mode..unspecified_mode; {set from command line}
@z
-@x [6.69] l.1612 - Allow override by command line switch.
+@x [6.69] l.1627 - Allow override by command line switch.
@ @<Set init...@>=interaction:=error_stop_mode;
@y
@ @<Set init...@>=if interaction_option=unspecified_mode then
@@ -631,7 +631,7 @@ else
interaction:=interaction_option;
@z
-@x [6.76] Eliminate non-local goto.
+@x [6.76] l.1727 - Eliminate non-local goto.
@ The |jump_out| procedure just cuts across all active procedure levels and
goes to |end_of_MF|. This is the only nontrivial |@!goto| statement in the
whole program. It is used when there is no recovery from a particular error.
@@ -671,7 +671,7 @@ do_final_end;
end;
@z
-@x [6.77] l.1736 -- halt on error?
+@x [6.77] l.1751 - halt on error?
print_char("."); show_context;
@y
print_char("."); show_context;
@@ -685,7 +685,7 @@ if (halt_on_error_p) then begin
end;
@z
-@x [6.79] Handle the switch-to-editor option.
+@x [6.79] l.1774 - Handle the switch-to-editor option.
line ready to be edited. But such an extension requires some system
wizardry, so the present implementation simply types out the name of the
file that should be
@@ -709,7 +709,7 @@ not been commented out.
@^debugging@>
@d edit_file==input_stack[file_ptr]
@z
-@x
+@x [6.79] l.1789
"E": if file_ptr>0 then if input_stack[file_ptr].name_field>=256 then
begin print_nl("You want to edit file ");
@.You want to edit file x@>
@@ -726,36 +726,36 @@ not been commented out.
jump_out;
@z
-@x [6.88] Declare fatal_error as noreturn.
+@x [6.88] l.1931 - Declare fatal_error as noreturn.
procedure fatal_error(@!s:str_number); {prints |s|, and that's it}
@y
noreturn procedure fatal_error(@!s:str_number); {prints |s|, and that's it}
@z
-@x [6.89] Declare overflow as noreturn.
+@x [6.89] l.1940 - Declare overflow as noreturn.
procedure overflow(@!s:str_number;@!n:integer); {stop due to finiteness}
@y
noreturn procedure overflow(@!s:str_number;@!n:integer); {stop due to finiteness}
@z
-@x [6.90] Declare confusion as noreturn.
+@x [6.90] l.1959 - Declare confusion as noreturn.
procedure confusion(@!s:str_number);
@y
noreturn procedure confusion(@!s:str_number);
@z
-@x [7.96] Do half in cpascal.h. And add halfp as in MetaPost for speed.
+@x [7.96] l.2054 - Do half in cpascal.h. And add halfp as in MetaPost for speed.
@d half(#)==(#) div 2
@y
@z
-@x [7.102] Use halfp.
+@x [7.102] l.2123 - Use halfp.
round_decimals:=half(a+1);
@y
round_decimals:=halfp(a+1);
@z
-@x [7.107-7.114] Optionally replace make_fraction etc. with external routines
+@x [7.107] l.2231 - Optionally replace make_fraction etc. with external routines
@p function make_fraction(@!p,@!q:integer):fraction;
@y
In the C version, there are external routines that use double precision
@@ -770,7 +770,7 @@ don't expect anyone will actually notice.)
@p ifdef('FIXPT')@/
function make_fraction(@!p,@!q:integer):fraction;
@z
-@x [7.107]
+@x [7.107] l.2251
if negative then make_fraction:=-(f+n)@+else make_fraction:=f+n;
end;
end;
@@ -780,13 +780,13 @@ end;
end;@/
endif('FIXPT')
@z
-@x [7.109]
+@x [7.109] l.2289
@p function take_fraction(@!q:integer;@!f:fraction):integer;
@y
@p ifdef('FIXPT')@/
function take_fraction(@!q:integer;@!f:fraction):integer;
@z
-@x [7.109]
+@x [7.109] l.2308
else take_fraction:=n+p;
end;
@y
@@ -795,7 +795,7 @@ end;@/
endif('FIXPT')
@z
-@x [7.111] Use halfp.
+@x [7.111] l.2327 - Use halfp.
repeat if odd(f) then p:=half(p+q)@+else p:=half(p);
f:=half(f);
until f=1
@@ -809,13 +809,13 @@ else repeat if odd(f) then p:=p+halfp(q-p)@+else p:=halfp(p);
f:=halfp(f);
@z
-@x [7.112]
+@x [7.112] l.2345
@p function take_scaled(@!q:integer;@!f:scaled):integer;
@y
@p ifdef('FIXPT')@/
function take_scaled(@!q:integer;@!f:scaled):integer;
@z
-@x [7.112]
+@x [7.112] l.2364
else take_scaled:=n+p;
end;
@y
@@ -824,7 +824,7 @@ end;@/
endif('FIXPT')
@z
-@x [7.113] Use halfp.
+@x [7.113] l.2371 - Use halfp.
repeat if odd(f) then p:=half(p+q)@+else p:=half(p);
f:=half(f);
until f=1
@@ -838,7 +838,7 @@ else repeat if odd(f) then p:=p+halfp(q-p)@+else p:=halfp(p);
f:=halfp(f);
@z
-@x [7.114]
+@x [7.114] l.2381
operands are positive. \ (This procedure is not used especially often,
so it is not part of \MF's inner loop.)
@@ -851,7 +851,7 @@ an external C routine.)
@p ifdef('FIXPT')@/
function make_scaled(@!p,@!q:integer):scaled;
@z
-@x [7.114]
+@x [7.114] l.2404
if negative then make_scaled:=-(f+n)@+else make_scaled:=f+n;
end;
end;
@@ -862,7 +862,7 @@ end;@/
endif('FIXPT')
@z
-@x [7.119] Do floor_scaled, floor_unscaled, round_unscaled, round_fraction in C.
+@x [7.119] l.2504 - Do floor_scaled, floor_unscaled, round_unscaled, round_fraction in C.
@p function floor_scaled(@!x:scaled):scaled;
{$2^{16}\lfloor x/2^{16}\rfloor$}
var @!be_careful:integer; {temporary register}
@@ -902,37 +902,37 @@ end;
@y
@z
-@x [8.121] Use halfp.
+@x [8.121] l.2567 - Use halfp.
square_rt:=half(q);
@y
square_rt:=halfp(q);
@z
-@x [8.126] Use halfp.
+@x [8.126] l.2651 - Use halfp.
else begin a:=half(a); b:=half(b); big:=true;
@y
else begin a:=halfp(a); b:=halfp(b); big:=true;
@z
-@x [8.133] Use halfp.
+@x [8.133] l.2748 - Use halfp.
begin z:=half(z+1); k:=k+1;
@y
begin z:=halfp(z+1); k:=k+1;
@z
-@x [8.142] Use halfp.
+@x [8.142] l.2910 - Use halfp.
begin x:=half(x); y:=half(y);
@y
begin x:=halfp(x); y:=halfp(y);
@z
-@x [8.150] Use halfp.
+@x [8.150] l.3059 - Use halfp.
while j>=fraction_one do j:=half(j);
@y
while j>=fraction_one do j:=halfp(j);
@z
-@x [9.153] Increase memory size.
+@x [9.153] l.3148 - Increase memory size.
@d min_quarterword=0 {smallest allowable value in a |quarterword|}
@d max_quarterword=255 {largest allowable value in a |quarterword|}
@d min_halfword==0 {smallest allowable value in a |halfword|}
@@ -944,7 +944,7 @@ while j>=fraction_one do j:=halfp(j);
@d max_halfword==@"FFFFFFF {largest allowable value in a |halfword|}
@z
-@x [9.155] Don't bother to subtract zero.
+@x [9.155] l.3177 - Don't bother to subtract zero.
@d ho(#)==#-min_halfword
{to take a sixteen-bit item from a halfword}
@d qo(#)==#-min_quarterword {to read eight bits from a quarterword}
@@ -955,7 +955,7 @@ while j>=fraction_one do j:=halfp(j);
@d qi(#)==#
@z
-@x [9.156] memory_word is defined externally.
+@x [9.156] l.3192 - memory_word is defined externally.
@!two_halves = packed record@;@/
@!rh:halfword;
case two_choices of
@@ -978,7 +978,7 @@ while j>=fraction_one do j:=halfp(j);
@=#include "texmfmem.h";@>
@z
-@x [10.159] mem is dynamically allocated.
+@x [10.159] l.3267 - mem is dynamically allocated.
@!mem : array[mem_min..mem_max] of memory_word; {the big dynamic storage area}
@y
@!mem : ^memory_word; {the big dynamic storage area}
@@ -987,7 +987,7 @@ while j>=fraction_one do j:=halfp(j);
% [11.178] Change the word `free' so that it doesn't conflict with the
% standard C library routine of the same name. Also change arrays that
% use mem_max, since that's a variable now, effectively disabling the feature.
-@x
+@x [11.178] l.3582
are debugging.)
@<Glob...@>=
@@ -1002,7 +1002,7 @@ are debugging.)
@t\hskip1em@>@!was_free: packed array [0..1] of boolean; {this loses too}
@z
-@x [11.182] Eliminate unsigned comparisons to zero.
+@x [11.182] l.3638 - Eliminate unsigned comparisons to zero.
repeat if (p>=lo_mem_max)or(p<mem_min) then clobbered:=true
else if (rlink(p)>=lo_mem_max)or(rlink(p)<mem_min) then clobbered:=true
@y
@@ -1010,7 +1010,7 @@ repeat if (p>=lo_mem_max) then clobbered:=true
else if (rlink(p)>=lo_mem_max) then clobbered:=true
@z
-@x [12.194] Do `fix_date_and_time' in C.
+@x [12.194] l.4268 - Do `fix_date_and_time' in C.
@ The following procedure, which is called just before \MF\ initializes its
input and output, establishes the initial values of the date and time.
@^system dependencies@>
@@ -1040,14 +1040,14 @@ be used after the year 32767.
begin date_and_time(sys_time,sys_day,sys_month,sys_year);
@z
-@x [12.198] Change class to c_class to avoid C++ keyword.
+@x [12.198] l.4347 - Change class to c_class to avoid C++ keyword.
@d max_class=20 {the largest class number}
@y
@d max_class=20 {the largest class number}
@d class==c_class
@z
-@x [12.199] Allow tab and form feed as input.
+@x [12.199] l.4395 - Allow tab and form feed as input.
for k:=127 to 255 do char_class[k]:=invalid_class;
@y
for k:=127 to 255 do char_class[k]:=invalid_class;
@@ -1055,7 +1055,7 @@ char_class[tab]:=space_class;
char_class[form_feed]:=space_class;
@z
-@x [15.232] Use halfp.
+@x [15.232] l.5187 - Use halfp.
name_type(q+s):=half(s)+x_part_sector; link(q+s):=null;
@y
name_type(q+s):=halfp(s)+x_part_sector; link(q+s):=null;
@@ -1064,7 +1064,7 @@ name_type(q+s):=halfp(s)+x_part_sector; link(q+s):=null;
[20.329] |valid_range| uses |abs|, which we have defined as a C
% macro. Some C preprocessors cannot expand the giant argument here.
% So we add a temporary.
-@x
+@x [20.329] l.7270
@p procedure edge_prep(@!ml,@!mr,@!nl,@!nr:integer);
var @!delta:halfword; {amount of change}
@y
@@ -1072,7 +1072,7 @@ var @!delta:halfword; {amount of change}
var @!delta:halfword; {amount of change}
temp:integer;
@z
-@x
+@x [20.329] l.7277
if not valid_range(m_min(cur_edges)+m_offset(cur_edges)-zero_field) or@|
not valid_range(m_max(cur_edges)+m_offset(cur_edges)-zero_field) then
@y
@@ -1082,7 +1082,7 @@ if not valid_range (m_min (cur_edges) + temp)
then
@z
-@x [21.442] Use halfp.
+@x [21.442] l.9489 - Use halfp.
if odd(right_type(q)) then a:=good_val(b,pen_edge+half(cur_gran))
else a:=good_val(b-1,pen_edge+half(cur_gran));
@y
@@ -1090,7 +1090,7 @@ if odd(right_type(q)) then a:=good_val(b,pen_edge+halfp(cur_gran))
else a:=good_val(b-1,pen_edge+halfp(cur_gran));
@z
-@x [24.509] i18n fix
+@x [24.509] l.10808 - i18n fix
print(" ("); print_int(info(h)); print(" offset");
if info(h)<>1 then print_char("s");
@y
@@ -1102,7 +1102,7 @@ else print(" offset");
% [25.530] |make_fraction| and |take_fraction| arguments are too long for
% some preprocessors, when they were defined as macros, just as in the
% previous change.
-@x
+@x [25.530] l.11334
alpha:=take_fraction(take_fraction(major_axis,
make_fraction(gamma,beta)),n_cos)@|
-take_fraction(take_fraction(minor_axis,
@@ -1119,19 +1119,19 @@ else print(" offset");
gamma := pyth_add (take_fraction (major_axis, n_cos), gamma);
@z
-@x [26.556] Use halfp.
+@x [26.556] l.11902 - Use halfp.
begin cur_t:=half(cur_t+1); cur_tt:=half(cur_tt+1); return;
@y
begin cur_t:=halfp(cur_t+1); cur_tt:=halfp(cur_tt+1); return;
@z
-@x [26.561] Use halfp.
+@x [26.561] l.11999 - Use halfp.
begin cur_t:=half(cur_t); cur_tt:=half(cur_tt);
@y
begin cur_t:=halfp(cur_t); cur_tt:=halfp(cur_tt);
@z
-@x [27.564] The window functions are defined externally, in C.
+@x [27.564] l.12089 - The window functions are defined externally, in C.
@p function init_screen:boolean;
begin init_screen:=false;
end;
@@ -1143,7 +1143,7 @@ end;
{These functions/procedures are defined externally in C.}
@z
-@x [27.565] screen_row, screen_col are variables, so can't be subrange array bounds.
+@x [27.565] l.12114 - screen_row, screen_col are variables, so can't be subrange array bounds.
@!screen_row=0..screen_depth; {a row number on the screen}
@!screen_col=0..screen_width; {a column number on the screen}
@!trans_spec=array[screen_col] of screen_col; {a transition spec, see below}
@@ -1153,7 +1153,7 @@ end;
@!trans_spec=^screen_col; {a transition spec, see below}
@z
-@x [27.567]
+@x [27.567] l.12138
@p procedure blank_rectangle(@!left_col,@!right_col:screen_col;
@!top_row,@!bot_row:screen_row);
var @!r:screen_row;
@@ -1169,7 +1169,7 @@ end;
{Same thing.}
@z
-@x [27.568]
+@x [27.568] l.12165
@p procedure paint_row(@!r:screen_row;@!b:pixel_color;var @!a:trans_spec;
@!n:screen_col);
var @!k:screen_col; {an index into |a|}
@@ -1191,13 +1191,13 @@ end;
{Same thing}
@z
-@x [28.596] Use halfp.
+@x [28.596] l.12687 - Use halfp.
if abs(v)>half(threshold) then
@y
if abs(v)>halfp(threshold) then
@z
-@x [31.631] l.13346 - Add datastructures for file:line:error.
+@x [31.631] l.13377 - Add datastructures for file:line:error.
@!line_stack : array[1..max_in_open] of integer;
@y
@!line_stack : array[1..max_in_open] of integer;
@@ -1205,7 +1205,7 @@ if abs(v)>halfp(threshold) then
@!full_source_filename_stack : ^str_number;
@z
-@x [38.768] Area and extension rules.
+@x [38.768] l.15564 - Area and extension rules.
@ The file names we shall deal with for illustrative purposes have the
following structure: If the name contains `\.>' or `\.:', the file area
consists of all characters up to and including the final such character;
@@ -1237,20 +1237,20 @@ track of the occurrences of area and extension delimiters:
@!ext_delimiter:pool_pointer; {the most recent `\..', if any}
@z
-@x [38.769] MF area directories.
+@x [38.769] l.15584 - MF area directories.
@d MF_area=="MFinputs:"
@.MFinputs@>
@y
In C, the default paths are specified separately.
@z
-@x [38.770] filenames: quoted
+@x [38.770] l.15591 - filenames: quoted
begin area_delimiter:=0; ext_delimiter:=0;
@y
begin area_delimiter:=0; ext_delimiter:=0; quoted_filename:=false;
@z
-@x [38.771] more_name
+@x [38.771] l.15598 - more_name
begin if c=" " then more_name:=false
else begin if (c=">")or(c=":") then
@y
@@ -1265,13 +1265,13 @@ else begin
if IS_DIR_SEP (c) then
@z
-@x [38.771] more_name
+@x [38.771] l.15602 - more_name
else if (c=".")and(ext_delimiter=0) then ext_delimiter:=pool_ptr;
@y
else if c="." then ext_delimiter:=pool_ptr;
@z
-@x [38.772] end_name: quote if spaces in names.
+@x [38.772] l.15611 - end_name: quote if spaces in names.
@p procedure end_name;
@y
@d pool_seq_check(#) == {set |s:=str_start[str_ptr]| and |t:=#|,
@@ -1298,7 +1298,7 @@ var must_quote:boolean; {whether we need to quote a string}
@!j,@!s,@!t: pool_pointer; {running indices}
@z
-@x [38.772] end_name: quote if spaces in names.
+@x [38.772] l.15618 - end_name: quote if spaces in names.
if area_delimiter=0 then cur_area:=""
else begin cur_area:=str_ptr; incr(str_ptr);
str_start[str_ptr]:=area_delimiter+1;
@@ -1341,7 +1341,7 @@ if ext_delimiter=0 then cur_name:=make_string
else cur_ext:=make_string;
@z
-@x [38.773] print_file_name: quote if spaces in names.
+@x [38.773] l.15635 - print_file_name: quote if spaces in names.
@<Basic printing...@>=
procedure print_file_name(@!n,@!a,@!e:integer);
begin slow_print(a); slow_print(n); slow_print(e);
@@ -1371,7 +1371,7 @@ print_quoted(a); print_quoted(n); print_quoted(e);
if must_quote then slow_print("""");
@z
-@x [38.774] have append_to_name skip quotes.
+@x [38.774] l.15646 - have append_to_name skip quotes.
@d append_to_name(#)==begin c:=#; incr(k);
if k<=file_name_size then name_of_file[k]:=xchr[c];
end
@@ -1381,27 +1381,27 @@ if must_quote then slow_print("""");
end end
@z
-@x [38.774] (pack_file_name) malloc and null terminate name_of_file.
+@x [38.774] l.15655 - (pack_file_name) malloc and null terminate name_of_file.
for j:=str_start[a] to str_start[a+1]-1 do append_to_name(so(str_pool[j]));
@y
if name_of_file then libc_free (name_of_file);
name_of_file := xmalloc_array (ASCII_code, length(a)+length(n)+length(e)+1);
for j:=str_start[a] to str_start[a+1]-1 do append_to_name(so(str_pool[j]));
@z
-@x
+@x [38.774] l.15659
for k:=name_length+1 to file_name_size do name_of_file[k]:=' ';
@y
name_of_file[name_length + 1] := 0;
@z
-@x [38.775] The default base.
+@x [38.775] l.15668 - The default base.
@d base_default_length=18 {length of the |MF_base_default| string}
@d base_area_length=8 {length of its area part}
@y
@d base_area_length=0 {no fixed area in C}
@z
-@x [38.776] Where `plain.base' is.
+@x [38.775] l.15674 - Where `plain.base' is.
@!MF_base_default:packed array[1..base_default_length] of char;
@ @<Set init...@>=
@@ -1415,7 +1415,7 @@ in \.{texmfmp.c}, since we want them to depend on the name of the
program.
@z
-@x [38.778] Change to pack_buffered_name as with pack_file_name.
+@x [38.778] l.15703 - Change to pack_buffered_name as with pack_file_name.
for j:=1 to n do append_to_name(xord[MF_base_default[j]]);
for j:=a to b do append_to_name(buffer[j]);
for j:=base_default_length-base_ext_length+1 to base_default_length do
@@ -1433,7 +1433,7 @@ if k<=file_name_size then name_length:=k@+else name_length:=file_name_size;
name_of_file[name_length + 1] := 0;
@z
-@x [38.779] Base file opening: do path searching for the default, not plain.
+@x [38.779] l.15726 - Base file opening: do path searching for the default, not plain.
pack_buffered_name(0,loc,j-1); {try first without the system file area}
if w_open_in(base_file) then goto found;
pack_buffered_name(base_area_length,loc,j-1);
@@ -1443,7 +1443,7 @@ name_of_file[name_length + 1] := 0;
pack_buffered_name(0,loc,j-1);
if w_open_in(base_file) then goto found;
@z
-@x
+@x [38.779] l.15732
wterm_ln('Sorry, I can''t find that base;',' will try PLAIN.');
@y
wterm ('Sorry, I can''t find the base `');
@@ -1452,7 +1452,7 @@ name_of_file[name_length + 1] := 0;
fputs (MF_base_default + 1, stdout);
wterm_ln ('''.');
@z
-@x
+@x [38.779] l.15740
wterm_ln('I can''t find the PLAIN base file!');
@.I can't find PLAIN...@>
@y
@@ -1462,7 +1462,7 @@ name_of_file[name_length + 1] := 0;
@.I can't find the base...@>
@z
-@x [38.780] make_name_string
+@x [38.780] l.15763 - make_name_string
make_name_string:=make_string;
end;
@y
@@ -1479,27 +1479,27 @@ name_of_file[name_length + 1] := 0;
end_name;
@z
-@x [38.781] Make scan_file_name ignore leading tabs as well as spaces.
+@x [38.781] l.15795 - Make scan_file_name ignore leading tabs as well as spaces.
while buffer[loc]=" " do incr(loc);
@y
while (buffer[loc]=" ")or(buffer[loc]=tab) do incr(loc);
@z
-@x [38.782] `logname' is declared in <unistd.h> on some systems.
+@x [38.782] l.15805 - `logname' is declared in <unistd.h> on some systems.
`\.{.base}' and `\.{.tfm}' in the names of \MF's output files.
@y
`\.{.base}' and `\.{.tfm}' in the names of \MF's output files.
@d log_name == texmf_log_name
@z
-@x [38.786] prompt_file_name: avoid empty filenames.
+@x [38.786] l.15847 - prompt_file_name: avoid empty filenames.
var @!k:0..buf_size; {index into |buffer|}
@y
var @!k:0..buf_size; {index into |buffer|}
@!saved_cur_name:str_number; {to catch empty terminal input}
@z
-@x [38.786] prompt_file_name: avoid empty filenames.
+@x [38.786] l.15860 - prompt_file_name: avoid empty filenames.
clear_terminal; prompt_input(": "); @<Scan file name in the buffer@>;
if cur_ext="" then cur_ext:=e;
@y
@@ -1509,19 +1509,19 @@ if cur_ext="" then cur_ext:=e;
if length(cur_name)=0 then cur_name:=saved_cur_name;
@z
-@x [38.787] <Scan file name...> needs similar leading tab treatment.
+@x [38.787] l.15867 - <Scan file name...> needs similar leading tab treatment.
while (buffer[k]=" ")and(k<last) do incr(k);
@y
while ((buffer[k]=" ")or(buffer[k]=tab))and(k<last) do incr(k);
@z
-@x [38.788] Adjust for C string conventions.
+@x [38.788] l.15883 - Adjust for C string conventions.
@!months:packed array [1..36] of char; {abbreviations of month names}
@y
@!months:const_cstring;
@z
-@x [38.788] Set correct filename for recorder.
+@x [38.788] l.15885 - Set correct filename for recorder.
if job_name=0 then job_name:="mfput";
@.mfput@>
pack_job_name(".log");
@@ -1533,13 +1533,13 @@ recorder_change_filename(stringcast(name_of_file+1));
pack_job_name(".log");
@z
-@x [38.790] leading character for C string
+@x [38.790] l.15924 - leading character for C string
months:='JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC';
@y
months := ' JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC';
@z
-@x [38.790] l.15898 - Print TCX name, if given.
+@x [38.790] l.15928 - Print TCX name, if given.
end
@y
if translate_filename then begin
@@ -1551,7 +1551,7 @@ end;
end
@z
-@x [38.793] (start_input) a_open_in of input file needs path specifier.
+@x [38.793] l.15956 - (start_input) a_open_in of input file needs path specifier.
begin @<Put the desired file name in |(cur_name,cur_ext,cur_area)|@>;
if cur_ext="" then cur_ext:=".mf";
pack_cur_name;
@@ -1576,20 +1576,20 @@ loop@+begin
goto done;
@z
-@x [38.793] l.15938 - The job name may have been given on the command line.
+@x [38.793] l.15970 - The job name may have been given on the command line.
begin job_name:=cur_name; open_log_file;
@y
begin job_name:=get_job_name(cur_name); open_log_file;
@z
-@x [38.793] Can't return name to string pool because of editor option?
+@x [38.793] l.15976 - Can't return name to string pool because of editor option?
if name=str_ptr-1 then {conserve string pool space (but see note above)}
begin flush_string(name); name:=cur_name;
end;
@y
@z
-@x [41.866] Use halfp.
+@x [41.866] l.17320 - Use halfp.
major_axis:=half(a_minus_b+a_plus_b); minor_axis:=half(abs(a_plus_b-a_minus_b));
if major_axis=minor_axis then theta:=0 {circle}
else theta:=half(n_arg(txx-tyy,tyx+txy)+n_arg(txx+tyy,tyx-txy));
@@ -1599,7 +1599,7 @@ if major_axis=minor_axis then theta:=0 {circle}
else theta:=half(n_arg(txx-tyy,tyx+txy)+n_arg(txx+tyy,tyx-txy));
@z
-@x [44.1023] if batchmode, MakeTeX... scripts should be silent.
+@x [44.1023] l.19871 - if batchmode, MakeTeX... scripts should be silent.
mode_command: begin print_ln; interaction:=cur_mod;
@y
mode_command: begin print_ln; interaction:=cur_mod;
@@ -1610,7 +1610,7 @@ else kpse_make_tex_discard_errors := 0;
% [45.1120] `threshold' is both a function and a variable. Since the
% function is used much less often than the variable, we'll change that
-@x
+@x [45.1120] l.21405
@p function threshold(@!m:integer):scaled;
var @!d:scaled; {lower bound on the smallest interval size}
begin excess:=min_cover(0)-m;
@@ -1630,19 +1630,19 @@ else begin repeat d:=perturbation;
threshold_fn:=d;
@z
-@x [45.1121] Change the call to the threshold function.
+@x [45.1121] l.21428 - Change the call to the threshold function.
begin d:=threshold(m); perturbation:=0;
@y
begin d:=threshold_fn(m); perturbation:=0;
@z
-@x [45.1122] Use halfp.
+@x [45.1122] l.21443 - Use halfp.
v:=l+half(value(p)-l);
@y
v:=l+halfp(value(p)-l);
@z
-@x [45.1133] Use C macros to do the TFM writing, to avoid casting(?) problems.
+@x [45.1133] l.21592 - Use C macros to do the TFM writing, to avoid casting(?) problems.
@d tfm_out(#)==write(tfm_file,#) {output one byte to |tfm_file|}
@p procedure tfm_two(@!x:integer); {output two bytes to |tfm_file|}
@@ -1672,19 +1672,19 @@ I don't know why not. Some casting problem?
@p procedure tfm_qqqq(@!x:four_quarters); {output four quarterwords to |tfm_file|}
@z
-@x [45.1134] print_file_name
+@x [45.1134] l.21627 - print_file_name
print_nl("Font metrics written on "); slow_print(metric_file_name);
@y
print_nl("Font metrics written on "); print_file_name(0,metric_file_name,0);
@z
-@x [47.1152] declare gf_buf as a pointer, for dynamic allocated
+@x [47.1152] l.22122 - declare gf_buf as a pointer, for dynamic allocated
@!gf_buf:array[gf_index] of eight_bits; {buffer for \.{GF} output}
@y
@!gf_buf:^eight_bits; {dynamically-allocated buffer for \.{GF} output}
@z
-@x [47.1154] omit write_gf
+@x [47.1154] l.22143 - omit write_gf
@<Declare generic font output procedures@>=
procedure write_gf(@!a,@!b:gf_index);
var k:gf_index;
@@ -1696,7 +1696,7 @@ the bytes to be written in one shot. Much better than writing four
bytes at a time.
@z
-@x [47.1155] check gf file size
+@x [47.1155] l.22150 - check gf file size
each time, we use the macro |gf_out|.
@y
each time, we use the macro |gf_out|.
@@ -1706,7 +1706,7 @@ The length of |gf_file| should not exceed |@"7FFFFFFF|; we set
recursion.
@z
-@x [47.1155] gf_swap: check gf file size
+@x [47.1155] l.22158 - gf_swap: check gf file size
begin if gf_limit=gf_buf_size then
@y
begin if gf_ptr>(@"7FFFFFFF-gf_offset) then
@@ -1717,7 +1717,7 @@ begin if gf_ptr>(@"7FFFFFFF-gf_offset) then
if gf_limit=gf_buf_size then
@z
-@x [47.1156] empty the last bytes: check gf file size
+@x [47.1156] l.22171 - empty the last bytes: check gf file size
if gf_ptr>0 then write_gf(0,gf_ptr-1)
@y
if gf_ptr>(@"7FFFFFFF-gf_offset) then
@@ -1728,7 +1728,7 @@ if gf_ptr>(@"7FFFFFFF-gf_offset) then
if gf_ptr>0 then write_gf(0,gf_ptr-1)
@z
-@x [47.1163] C needs k to be 0..256 instead of 0..255.
+@x [47.1163] l.22263 - C needs k to be 0..256 instead of 0..255.
procedure init_gf;
var @!k:eight_bits; {runs through all possible character codes}
@y
@@ -1736,13 +1736,13 @@ procedure init_gf;
var @!k:0..256; {runs through all possible character codes}
@z
-@x [47.1182] print_file_name
+@x [47.1182] l.22501 - print_file_name
print_nl("Output written on "); slow_print(output_file_name);
@y
print_nl("Output written on "); print_file_name(0,output_file_name,0);
@z
-@x [47.1182] i18n fix
+@x [47.1182] l.22503 - i18n fix
print(" ("); print_int(total_chars); print(" character");
if total_chars<>1 then print_char("s");
@y
@@ -1751,20 +1751,20 @@ if total_chars<>1 then print(" characters")
else print(" character");
@z
-@x [48.1185] INI = VIR.
+@x [48.1185] l.22533 - INI = VIR.
base_ident:=" (INIMF)";
@y
if ini_version then base_ident:=" (INIMF)";
@z
-@x [48.1186] Add base_engine.
+@x [48.1186] l.22540 - Add base_engine.
@!w: four_quarters; {four ASCII codes}
@y
@!w: four_quarters; {four ASCII codes}
@!base_engine: ^text_char;
@z
-@x [48.1187] Add base_engine.
+@x [48.1187] l.22569 - Add base_engine.
@!w: four_quarters; {four ASCII codes}
@y
@!w: four_quarters; {four ASCII codes}
@@ -1774,7 +1774,7 @@ if ini_version then base_ident:=" (INIMF)";
@!dummy_xprn: ASCII_code;
@z
-@x [48.1188] Reading and writing of `base_file' is done in C.
+@x [48.1188] l.22585 - Reading and writing of `base_file' is done in C.
@d dump_wd(#)==begin base_file^:=#; put(base_file);@+end
@d dump_int(#)==begin base_file^.int:=#; put(base_file);@+end
@d dump_hh(#)==begin base_file^.hh:=#; put(base_file);@+end
@@ -1782,7 +1782,7 @@ if ini_version then base_ident:=" (INIMF)";
@y
@z
-@x [48.1189]
+@x [48.1189] l.22599
@d undump_wd(#)==begin get(base_file); #:=base_file^;@+end
@d undump_int(#)==begin get(base_file); #:=base_file^.int;@+end
@d undump_hh(#)==begin get(base_file); #:=base_file^.hh;@+end
@@ -1790,7 +1790,7 @@ if ini_version then base_ident:=" (INIMF)";
@y
@z
-@x [48.1190] Dump engine name.
+@x [48.1190] l.22615 - Dump engine name.
dump_int(@$);@/
@y
dump_int(@"57324D46); {Web2C \MF's magic constant: "W2MF"}
@@ -1806,7 +1806,7 @@ dump_int(@$);@/
@<Dump |xord|, |xchr|, and |xprn|@>;
@z
-@x [48.1191] Avoid Pascal file convention.
+@x [48.1191] l.22629 - Avoid Pascal file convention.
x:=base_file^.int;
if x<>@$ then goto off_base; {check that strings are the same}
undump_int(x);
@@ -1853,7 +1853,7 @@ if mem_min+1100>mem_top then goto off_base;
mem:=xmalloc_array (memory_word, mem_max - mem_min + 1);
@z
-@x [48.1195] l.22714 - Check that p did not become corrupt.
+@x [48.1195] l.22713 - Check that p did not become corrupt.
p:=q+node_size(q);
if (p>lo_mem_max)or((q>=rlink(q))and(rlink(q)<>rover)) then goto off_base;
@y
@@ -1869,20 +1869,20 @@ then goto off_base;
p:=q+node_size(q);
@z
-@x [48.1199] l.22750 - Allow command line to override dumped value.
+@x [48.1199] l.22767 - Allow command line to override dumped value.
undump(batch_mode)(error_stop_mode)(interaction);
@y
undump(batch_mode)(error_stop_mode)(interaction);
if interaction_option<>unspecified_mode then interaction:=interaction_option;
@z
-@x [48.1199] l.22755 - Test for end-of-file already done by undump.
+@x [48.1199] l.22772 - Test for end-of-file already done by undump.
undump_int(x);@+if (x<>69069)or eof(base_file) then goto off_base
@y
undump_int(x);@+if x<>69069 then goto off_base
@z
-@x [49.1204] Dynamic allocation.
+@x [49.1204] l.22858 - Dynamic allocation.
@p begin @!{|start_here|}
@y
@d const_chk(#) == begin if # < inf@&# then # := inf@&# else
@@ -1927,7 +1927,7 @@ end;
@+tini
@z
-@x [49.1204] Only do get_strings_started if ini.
+@x [49.1204] l.22870 - Only do get_strings_started if ini.
@!init if not get_strings_started then goto final_end;
init_tab; {initialize the tables}
init_prim; {call |primitive| for each primitive}
@@ -1946,7 +1946,7 @@ end;
tini@/
@z
-@x [49.1204]
+@x [49.1204] l.22885
end_of_MF: close_files_and_terminate;
final_end: ready_already:=0;
@y
@@ -1956,7 +1956,7 @@ final_end: do_final_end;
% [49.1205] close_files_and_terminate: Print new line before
% termination; switch to editor if necessary.
-@x
+@x [49.1205] l.22917
slow_print(log_name); print_char(".");
end;
end;
@@ -1969,7 +1969,7 @@ if (edit_name_start<>0) and (interaction>batch_mode) then
call_edit(str_pool,edit_name_start,edit_name_length,edit_line);
@z
-@x [49.1209] Only do dump if ini.
+@x [49.1209] l.23018 - Only do dump if ini.
begin @!init store_base_file; return;@+tini@/
@y
begin
@@ -1982,7 +1982,7 @@ if (edit_name_start<>0) and (interaction>batch_mode) then
%if (base_ident=0)or(buffer[loc]="&")or dump_line then
%@z
-@x [51.1214] Add editor-switch variable to globals.
+@x [51.1214] l.23126 - Add editor-switch variable to globals.
This section should be replaced, if necessary, by any special
modifications of the program
that are necessary to make \MF\ work at a particular installation.
diff --git a/Build/source/texk/web2c/mplibdir/ChangeLog b/Build/source/texk/web2c/mplibdir/ChangeLog
index 1bce2fdae0d..728957b23e2 100644
--- a/Build/source/texk/web2c/mplibdir/ChangeLog
+++ b/Build/source/texk/web2c/mplibdir/ChangeLog
@@ -1,3 +1,18 @@
+2024-05-19 Luigi Scarso <luigi.scarso@gmail.com>
+ * Sync with https://github.com/ascherer/mplibdir commit c21f82c1990d1cdb86f51a00b5c81d0088e12454.
+
+2024-05-18 Luigi Scarso <luigi.scarso@gmail.com>
+ * Several patches for CWEB from Andreas Scherer
+
+2024-05-01 Luigi Scarso <luigi.scarso@gmail.com>
+ * Fixed Update |arc| and |t_tot| after |do_arc_test| has just returned |t|
+ in mp_get_arc_time
+
+2024-03-18 Luigi Scarso <luigi.scarso@gmail.com>
+ * Fixed a bug in n_arg for double and binary mode,
+ where -0.0 was different form 0.0.
+ Work in progress for the interval mode.
+
2024-02-16 Luigi Scarso <luigi.scarso@gmail.com>
* Updated manual. MetaPost 2.1
diff --git a/Build/source/texk/web2c/mplibdir/mp.w b/Build/source/texk/web2c/mplibdir/mp.w
index 25e9143f287..5003eebded3 100644
--- a/Build/source/texk/web2c/mplibdir/mp.w
+++ b/Build/source/texk/web2c/mplibdir/mp.w
@@ -22,8 +22,8 @@
\def\(#1){} % this is used to make section names sort themselves better
\def\9#1{} % this is used for sort keys in the index via @@:sort key}{entry@@>
-\def\title{MetaPost}
-\pdfoutput=1
+\def\title{\MP}
+\pdfoutput=1 \sanitizecommand\MP{MetaPost}
\pageno=3
@* Introduction.
@@ -32,7 +32,7 @@ This is \MP\ by John Hobby, a graphics-language processor based on D. E. Knuth's
Much of the original Pascal version of this program was copied with
permission from MF.web Version 1.9. It interprets a language very
-similar to D.E. Knuth's METAFONT, but with changes designed to make it
+similar to D.E. Knuth's \MF, but with changes designed to make it
more suitable for PostScript output.
The main purpose of the following program is to explain the algorithms of \MP\
@@ -71,16 +71,16 @@ undergoes any modifications, so that it will be clear which version of
@^extensions to \MP@>
@^system dependencies@>
-@d default_banner "This is MetaPost, Version 2.10" /* printed when \MP\ starts */
+@d default_banner "This is MetaPost, Version 2.11" /* printed when \MP\ starts */
@d true 1
@d false 0
-@<Metapost version header@>=
-#define metapost_version "2.10"
+@<\MP\ version header@>=
+#define metapost_version "2.11"
@ The external library header for \MP\ is |mplib.h|. It contains a
few typedefs and the header defintions for the externally used
-fuctions.
+functions.
The most important of the typedefs is the definition of the structure
|MP_options|, that acts as a small, configurable front-end to the fairly
@@ -93,14 +93,14 @@ large |MP_instance| structure.
#ifndef HAVE_BOOLEAN
typedef int boolean;
#endif
-@<Metapost version header@>
+@<\MP\ version header@>@;
typedef struct MP_instance *MP;
-@<Exported types@>
+@<Exported types@>@;
typedef struct MP_options {
- @<Option variables@>
+ @<Option variables@>@;
} MP_options;
-@<Exported function headers@>
-@<MPlib header stuff@>
+@<Exported function headers@>@;
+@<MPlib header stuff@>@;
#endif
@ The internal header file is much longer: it not only lists the complete
@@ -127,8 +127,8 @@ typedef int boolean;
typedef int integer;
#define MPOST_ABS abs
#else
-/* See source/texk/web2c/w2c/config.h */
-#if INTEGER_MAX == LONG_MAX /* this should mean INTEGER_TYPE == long */
+/* See \.{source/texk/web2c/w2c/config.h} */
+#if INTEGER_MAX == LONG_MAX /* this should mean |INTEGER_TYPE == long| */
#ifdef HAVE_LABS
#define MPOST_ABS labs
#else
@@ -136,44 +136,44 @@ typedef int integer;
#endif
#else
#define MPOST_ABS abs
-#endif /* if INTEGER_TYPE == long */
-#endif /* ifndef INTEGER_TYPE */
+#endif /* |if INTEGER_TYPE == long| */
+#endif /* |ifndef INTEGER_TYPE| */
-@<Declare helpers@>;
-@<Enumeration types@>;
-@<Types in the outer block@>;
-@<Constants in the outer block@>;
+@<Declare helpers@>@;
+@<Enumeration types@>@;
+@<Types in the outer block@>@;
+@<Constants in the outer block@>@;
typedef struct MP_instance {
- @<Option variables@>
- @<Global variables@>
+ @<Option variables@>@;
+ @<Global variables@>@;
} MP_instance;
-@<Internal library declarations@>
-@<MPlib internal header stuff@>
+@<Internal library declarations@>@;
+@<MPlib internal header stuff@>@;
#endif
@ @c
/*\#define DEBUGENVELOPE */
#ifdef DEBUGENVELOPE
static int DEBUGENVELOPECOUNTER=0;
-#define dbg_str(A) printf("\n--[==[%03d DEBUGENVELOPE ]==] %s", DEBUGENVELOPECOUNTER++, #A)
-#define dbg_n(A) printf("\n--[==[%03d DEBUGENVELOPE ]==] ['%s']=%s, ", DEBUGENVELOPECOUNTER++, #A, number_tostring(A))
-#define dbg_in(A) printf("\n--[==[%03d DEBUGENVELOPE ]==] ['%s']=%d, ", DEBUGENVELOPECOUNTER++, #A, (int)(A))
-#define dbg_dn(A) printf("\n--[==[%03d DEBUGENVELOPE ]==] ['%s']=%.100f, ",DEBUGENVELOPECOUNTER++, #A, (double)(A))
-#define dbg_key(A) printf("\n--[==[%03d DEBUGENVELOPE ]==] ['%s']= ", DEBUGENVELOPECOUNTER++, #A)
-#define dbg_key_nval(K,V) printf("\n--[==[%03d DEBUGENVELOPE ]==] ['%s']=%s", DEBUGENVELOPECOUNTER++, #K,number_tostring(V))
-#define dbg_key_ival(K,V) printf("\n--[==[%03d DEBUGENVELOPE ]==] ['%s']=%d", DEBUGENVELOPECOUNTER++, #K,(int)(V))
-#define dbg_key_dval(K,V) printf("\n--[==[%03d DEBUGENVELOPE ]==] ['%s']=%.100f", DEBUGENVELOPECOUNTER++, #K,(double)(V))
-#define dbg_comment(A) printf("\n--[==[%03d DEBUGENVELOPE ]==] --[==[%s]==]", DEBUGENVELOPECOUNTER++, #A)
-#define dbg_sp printf("\n--[==[%03d DEBUGENVELOPE ]==] ", DEBUGENVELOPECOUNTER++)
-#define dbg_open_t printf("\n--[==[%03d DEBUGENVELOPE ]==] {", DEBUGENVELOPECOUNTER++)
-#define dbg_close_t printf("\n--[==[%03d DEBUGENVELOPE ]==] }", DEBUGENVELOPECOUNTER++)
-#define dbg_comma printf("\n--[==[%03d DEBUGENVELOPE ]==] ,", DEBUGENVELOPECOUNTER++)
-#define dbg_nl printf("\n--[==[%03d DEBUGENVELOPE ]==] \n", DEBUGENVELOPECOUNTER++)
+#define dbg_str(A) @[printf("\n--[==[%03d DEBUGENVELOPE ]==] %s", DEBUGENVELOPECOUNTER++, #A)@]
+#define dbg_n(A) @[printf("\n--[==[%03d DEBUGENVELOPE ]==] ['%s']=%s, ", DEBUGENVELOPECOUNTER++, #A, number_tostring(A))@]
+#define dbg_in(A) @[printf("\n--[==[%03d DEBUGENVELOPE ]==] ['%s']=%d, ", DEBUGENVELOPECOUNTER++, #A, (int)(A))@]
+#define dbg_dn(A) @[printf("\n--[==[%03d DEBUGENVELOPE ]==] ['%s']=%.100f, ",DEBUGENVELOPECOUNTER++, #A, (double)(A))@]
+#define dbg_key(A) @[printf("\n--[==[%03d DEBUGENVELOPE ]==] ['%s']= ", DEBUGENVELOPECOUNTER++, #A)@]
+#define dbg_key_nval(K,V) @[printf("\n--[==[%03d DEBUGENVELOPE ]==] ['%s']=%s", DEBUGENVELOPECOUNTER++, #K,number_tostring(V))@]
+#define dbg_key_ival(K,V) @[printf("\n--[==[%03d DEBUGENVELOPE ]==] ['%s']=%d", DEBUGENVELOPECOUNTER++, #K,(int)(V))@]
+#define dbg_key_dval(K,V) @[printf("\n--[==[%03d DEBUGENVELOPE ]==] ['%s']=%.100f", DEBUGENVELOPECOUNTER++, #K,(double)(V))@]
+#define dbg_comment(A) @[printf("\n--[==[%03d DEBUGENVELOPE ]==] --[==[%s]==]", DEBUGENVELOPECOUNTER++, #A)@]
+#define dbg_sp @[printf("\n--[==[%03d DEBUGENVELOPE ]==] ", DEBUGENVELOPECOUNTER++)@]
+#define dbg_open_t @[printf("\n--[==[%03d DEBUGENVELOPE ]==] {", DEBUGENVELOPECOUNTER++)@]
+#define dbg_close_t @[printf("\n--[==[%03d DEBUGENVELOPE ]==] }", DEBUGENVELOPECOUNTER++)@]
+#define dbg_comma @[printf("\n--[==[%03d DEBUGENVELOPE ]==] ,", DEBUGENVELOPECOUNTER++)@]
+#define dbg_nl @[printf("\n--[==[%03d DEBUGENVELOPE ]==] \n", DEBUGENVELOPECOUNTER++)@]
#define dbg_CUBIC dbg_n(p->x_coord); dbg_n(p->y_coord); \
dbg_n(p->right_x); dbg_n(p->right_y); \
dbg_n(q->left_x); dbg_n(q->left_y); \
- dbg_n(q->x_coord); dbg_n(q->y_coord)
+ dbg_n(q->x_coord); dbg_n(q->y_coord)@;
#endif
#define KPATHSEA_DEBUG_H 1
#include <w2c/config.h>
@@ -186,26 +186,36 @@ static int DEBUGENVELOPECOUNTER=0;
#ifdef HAVE_UNISTD_H
# include <unistd.h> /* for access */
#endif
-#include <time.h> /* for struct tm \& co */
-#include <zlib.h> /* for |ZLIB_VERSION|, zlibVersion() */
+#include <time.h> /* for |struct tm| $\AND$ co */
+#include <zlib.h> /* for |ZLIB_VERSION|, |zlibVersion()| */
#include <png.h> /* for |PNG_LIBPNG_VER_STRING|, |png_libpng_ver| */
-/*\#include <pixman.h>*/ /* for |PIXMAN_VERSION_STRING|, |pixman_version_string()| */
-/*\#include <cairo.h>*/ /* for |CAIRO_VERSION_STRING|, |cairo_version_string()| */
-/*\#include <gmp.h>*/ /* for |gmp_version| */
-/*\#include <mpfr.h>*/ /* for |MPFR_VERSION_STRING|, |mpfr_get_version()| */
+/*|
+#include <pixman.h>| */ /* for |PIXMAN_VERSION_STRING|, |pixman_version_string()| */
+/*|
+#include <cairo.h>| */ /* for |CAIRO_VERSION_STRING|, |cairo_version_string()| */
+/*|
+#include <gmp.h>| */ /* for |gmp_version| */
+/*|
+#include <mpfr.h>| */ /* for |MPFR_VERSION_STRING|, |mpfr_get_version()| */
#include "mplib.h"
#include "mplibps.h" /* external header */
-/*\#include "mplibsvg.h" */ /* external header */
-/*\#include "mplibpng.h" */ /* external header */
+/*|
+#include "mplibsvg.h"| */ /* external header */
+/*|
+#include "mplibpng.h"| */ /* external header */
#include "mpmp.h" /* internal header */
#include "mppsout.h" /* internal header */
-/*\#include "mpsvgout.h"*/ /* internal header */
-/*\#include "mppngout.h"*/ /* internal header */
+/*|
+#include "mpsvgout.h"| */ /* internal header */
+/*|
+#include "mppngout.h"| */ /* internal header */
#include "mpmath.h" /* internal header */
#include "mpmathdouble.h" /* internal header */
#include "mpmathdecimal.h" /* internal header */
-/*|#include "mpmathbinary.h"|*/ /* internal header */
-/*|#include "mpmathinterval.h"|*/ /* internal header */
+/*|
+#include "mpmathbinary.h"| */ /* internal header */
+/*|
+#include "mpmathinterval.h"| */ /* internal header */
#include "mpstrings.h" /* internal header */
/* BEGIN PATCH */
mp_number dx_ap; /* approximation of dx */
@@ -243,11 +253,12 @@ extern void mp_svg_backend_free (MP mp);
extern int mp_svg_ship_out (mp_edge_object *hh, int prologues);
extern int mp_svg_gr_ship_out (mp_edge_object *hh, int prologues, int standalone);
-@ @c
-extern font_number mp_read_font_info (MP mp, char *fname); /* tfmin.w */
-@h @<Declarations@>;
-@<Basic printing procedures@>;
-@<Error handling procedures@>
+@ @s font_number int @c
+extern font_number mp_read_font_info (MP mp, char *fname); /* \.{tfmin.w} */
+@h
+@<Declarations@>@;
+@<Basic printing procedures@>@;
+@<Error handling procedures@>@;
@ Some debugging support for development. The trick with the variadic macros
probably only works in gcc, as this preprocessor feature was not formalized
@@ -258,25 +269,25 @@ most compilers understand the non-debug version.
@<MPlib internal header stuff@>=
/*\#define DEBUG 2*/
#if DEBUG
-#define debug_number(A) printf("%d: %s=%.32f (%d)\n", __LINE__, #A, number_to_double(A), number_to_scaled(A))
+#define debug_number(A) @[printf("%d: %s=%.32f (%d)\n", __LINE__, #A, number_to_double(A), number_to_scaled(A))@]
#else
-#define debug_number(A)
+#define debug_number(A) @[@]
#endif
#if DEBUG>1
void do_debug_printf(MP mp, const char *prefix, const char *fmt, ...);
-# define debug_printf(a1,a2,a3) do_debug_printf(mp, "", a1,a2,a3)
-# define FUNCTION_TRACE1(a1) do_debug_printf(mp, "FTRACE: ", a1)
-# define FUNCTION_TRACE2(a1,a2) do_debug_printf(mp, "FTRACE: ", a1,a2)
-# define FUNCTION_TRACE3(a1,a2,a3) do_debug_printf(mp, "FTRACE: ", a1,a2,a3)
-# define FUNCTION_TRACE3X(a1,a2,a3) (void)mp
-# define FUNCTION_TRACE4(a1,a2,a3,a4) do_debug_printf(mp, "FTRACE: ", a1,a2,a3,a4)
+# define debug_printf(a1,a2,a3) @[do_debug_printf(mp, "", a1,a2,a3)@]
+# define FUNCTION_TRACE1(a1) do_@[debug_printf(mp, "FTRACE: ", a1)@]
+# define FUNCTION_TRACE2(a1,a2) @[do_debug_printf(mp, "FTRACE: ", a1,a2)@]
+# define FUNCTION_TRACE3(a1,a2,a3) @[do_debug_printf(mp, "FTRACE: ", a1,a2,a3)@]
+# define FUNCTION_TRACE3X(a1,a2,a3) @[(void)mp@]
+# define FUNCTION_TRACE4(a1,a2,a3,a4) @[do_debug_printf(mp, "FTRACE: ", a1,a2,a3,a4)@]
#else
-# define debug_printf(a1,a2,a3)
-# define FUNCTION_TRACE1(a1) (void)mp
-# define FUNCTION_TRACE2(a1,a2) (void)mp
-# define FUNCTION_TRACE3(a1,a2,a3) (void)mp
-# define FUNCTION_TRACE3X(a1,a2,a3) (void)mp
-# define FUNCTION_TRACE4(a1,a2,a3,a4) (void)mp
+# define debug_printf(a1,a2,a3) @[@]
+# define FUNCTION_TRACE1(a1) @[(void)mp@]
+# define FUNCTION_TRACE2(a1,a2) @[(void)mp@]
+# define FUNCTION_TRACE3(a1,a2,a3) @[(void)mp@]
+# define FUNCTION_TRACE3X(a1,a2,a3) @[(void)mp@]
+# define FUNCTION_TRACE4(a1,a2,a3,a4) @[(void)mp@]
#endif
@ This function occasionally crashes (if something is written after the
@@ -284,19 +295,16 @@ log file is already closed), but that is not so important while debugging.
@c
#if DEBUG
-void do_debug_printf(MP mp, const char *prefix, const char *fmt, ...) ;
void do_debug_printf(MP mp, const char *prefix, const char *fmt, ...) {
va_list ap;
-#if 0
va_start (ap, fmt);
+#if 0
if (mp->log_file && !ferror((FILE *)mp->log_file)) {
fputs(prefix, mp->log_file);
vfprintf(mp->log_file, fmt, ap);
}
va_end(ap);
-#endif
va_start (ap, fmt);
-#if 0
if (mp->term_out && !ferror((FILE *)mp->term_out)) {
#else
if (false) {
@@ -308,8 +316,11 @@ void do_debug_printf(MP mp, const char *prefix, const char *fmt, ...) {
vfprintf(stdout, fmt, ap);
}
va_end(ap);
-}
+#if 0
+ }
#endif
+}
+#endif /* |if DEBUG| */
@ Here are the functions that set up the \MP\ instance.
@@ -333,6 +344,8 @@ MP_options *mp_options (void) {
|left_point| and |right_point| of a number |a| simply return |a|, while
|interval_set| of the pair |(a,b)| returns the mid point.
+@s mp_number int
+
@<Declarations@>=
static void mp_stub_m_get_left_endpoint(MP mp, mp_number * r, mp_number a);
static void mp_stub_m_get_right_endpoint(MP mp, mp_number * r, mp_number a);
@@ -364,11 +377,11 @@ static void mp_stub_m_interval_set(MP mp, mp_number * r, mp_number a, mp_number
@ The whole instance structure is initialized with zeroes,
this greatly reduces the number of statements needed in
-the |Allocate or initialize variables| block.
+the |@<Allocate or ...@>| block.
@d set_callback_option(A) do { mp->A = mp_##A;
if (opt->A!=NULL) mp->A = opt->A;
-} while (0)
+} while (0)@;
@c
static MP mp_do_new (jmp_buf * buf) {
@@ -387,9 +400,8 @@ static MP mp_do_new (jmp_buf * buf) {
static void mp_free (MP mp) {
int k; /* loop variable */
@<Dealloc variables@>;
- if (mp->noninteractive) {
- @<Finish non-interactive use@>;
- }
+ if (mp->noninteractive)
+ @<Finish non-interactive use@>@;
xfree (mp->jump_buf);
@<Free table entries@>;
free_math();
@@ -431,72 +443,72 @@ typedef struct mp_number_data {
typedef struct mp_number_data mp_number;
#define is_number(A) ((A).type != mp_nan_type)
-typedef void (*convert_func) (mp_number *r);
-typedef void (*m_log_func) (MP mp, mp_number *r, mp_number a);
-typedef void (*m_exp_func) (MP mp, mp_number *r, mp_number a);
-typedef void (*m_unif_rand_func) (MP mp, mp_number *ret, mp_number x_orig);
-typedef void (*m_norm_rand_func) (MP mp, mp_number *ret);
-typedef void (*pyth_add_func) (MP mp, mp_number *r, mp_number a, mp_number b);
-typedef void (*pyth_sub_func) (MP mp, mp_number *r, mp_number a, mp_number b);
-typedef void (*n_arg_func) (MP mp, mp_number *r, mp_number a, mp_number b);
-typedef void (*velocity_func) (MP mp, mp_number *r, mp_number a, mp_number b, mp_number c, mp_number d, mp_number e);
-typedef void (*ab_vs_cd_func) (MP mp, mp_number *r, mp_number a, mp_number b, mp_number c, mp_number d);
-typedef void (*crossing_point_func) (MP mp, mp_number *r, mp_number a, mp_number b, mp_number c);
-typedef void (*number_from_int_func) (mp_number *A, int B);
-typedef void (*number_from_boolean_func) (mp_number *A, int B);
-typedef void (*number_from_scaled_func) (mp_number *A, int B);
-typedef void (*number_from_double_func) (mp_number *A, double B);
-typedef void (*number_from_addition_func) (mp_number *A, mp_number B, mp_number C);
-typedef void (*number_from_substraction_func) (mp_number *A, mp_number B, mp_number C);
-typedef void (*number_from_div_func) (mp_number *A, mp_number B, mp_number C);
-typedef void (*number_from_mul_func) (mp_number *A, mp_number B, mp_number C);
-typedef void (*number_from_int_div_func) (mp_number *A, mp_number B, int C);
-typedef void (*number_from_int_mul_func) (mp_number *A, mp_number B, int C);
-typedef void (*number_from_oftheway_func) (MP mp, mp_number *A, mp_number t, mp_number B, mp_number C);
-typedef void (*number_negate_func) (mp_number *A);
-typedef void (*number_add_func) (mp_number *A, mp_number B);
-typedef void (*number_substract_func) (mp_number *A, mp_number B);
-typedef void (*number_modulo_func) (mp_number *A, mp_number B);
-typedef void (*number_half_func) (mp_number *A);
-typedef void (*number_halfp_func) (mp_number *A);
-typedef void (*number_double_func) (mp_number *A);
-typedef void (*number_abs_func) (mp_number *A);
-typedef void (*number_clone_func) (mp_number *A, mp_number B);
-typedef void (*number_swap_func) (mp_number *A, mp_number *B);
-typedef void (*number_add_scaled_func) (mp_number *A, int b);
-typedef void (*number_multiply_int_func) (mp_number *A, int b);
-typedef void (*number_divide_int_func) (mp_number *A, int b);
-typedef int (*number_to_int_func) (mp_number A);
-typedef int (*number_to_boolean_func) (mp_number A);
-typedef int (*number_to_scaled_func) (mp_number A);
-typedef int (*number_round_func) (mp_number A);
-typedef void (*number_floor_func) (mp_number *A);
-typedef double (*number_to_double_func) (mp_number A);
-typedef int (*number_odd_func) (mp_number A);
-typedef int (*number_equal_func) (mp_number A, mp_number B);
-typedef int (*number_less_func) (mp_number A, mp_number B);
-typedef int (*number_greater_func) (mp_number A, mp_number B);
-typedef int (*number_nonequalabs_func) (mp_number A, mp_number B);
-typedef void (*make_scaled_func) (MP mp, mp_number *ret, mp_number A, mp_number B);
-typedef void (*make_fraction_func) (MP mp, mp_number *ret, mp_number A, mp_number B);
-typedef void (*take_fraction_func) (MP mp, mp_number *ret, mp_number A, mp_number B);
-typedef void (*take_scaled_func) (MP mp, mp_number *ret, mp_number A, mp_number B);
-typedef void (*sin_cos_func) (MP mp, mp_number A, mp_number *S, mp_number *C);
-typedef void (*slow_add_func) (MP mp, mp_number *A, mp_number S, mp_number C);
-typedef void (*sqrt_func) (MP mp, mp_number *ret, mp_number A);
-typedef void (*init_randoms_func) (MP mp, int seed);
-typedef void (*new_number_func) (MP mp, mp_number *A, mp_number_type t);
-typedef void (*free_number_func) (MP mp, mp_number *n);
-typedef void (*fraction_to_round_scaled_func) (mp_number *n);
-typedef void (*print_func) (MP mp, mp_number A);
+typedef void @[@] (*convert_func) (mp_number *r);
+typedef void @[@] (*m_log_func) (MP mp, mp_number *r, mp_number a);
+typedef void @[@] (*m_exp_func) (MP mp, mp_number *r, mp_number a);
+typedef void @[@] (*m_unif_rand_func) (MP mp, mp_number *ret, mp_number x_orig);
+typedef void @[@] (*m_norm_rand_func) (MP mp, mp_number *ret);
+typedef void @[@] (*pyth_add_func) (MP mp, mp_number *r, mp_number a, mp_number b);
+typedef void @[@] (*pyth_sub_func) (MP mp, mp_number *r, mp_number a, mp_number b);
+typedef void @[@] (*n_arg_func) (MP mp, mp_number *r, mp_number a, mp_number b);
+typedef void @[@] (*velocity_func) (MP mp, mp_number *r, mp_number a, mp_number b, mp_number c, mp_number d, mp_number e);
+typedef void @[@] (*ab_vs_cd_func) (MP mp, mp_number *r, mp_number a, mp_number b, mp_number c, mp_number d);
+typedef void @[@] (*crossing_point_func) (MP mp, mp_number *r, mp_number a, mp_number b, mp_number c);
+typedef void @[@] (*number_from_int_func) (mp_number *A, int B);
+typedef void @[@] (*number_from_boolean_func) (mp_number *A, int B);
+typedef void @[@] (*number_from_scaled_func) (mp_number *A, int B);
+typedef void @[@] (*number_from_double_func) (mp_number *A, double B);
+typedef void @[@] (*number_from_addition_func) (mp_number *A, mp_number B, mp_number C);
+typedef void @[@] (*number_from_substraction_func) (mp_number *A, mp_number B, mp_number C);
+typedef void @[@] (*number_from_div_func) (mp_number *A, mp_number B, mp_number C);
+typedef void @[@] (*number_from_mul_func) (mp_number *A, mp_number B, mp_number C);
+typedef void @[@] (*number_from_int_div_func) (mp_number *A, mp_number B, int C);
+typedef void @[@] (*number_from_int_mul_func) (mp_number *A, mp_number B, int C);
+typedef void @[@] (*number_from_oftheway_func) (MP mp, mp_number *A, mp_number t, mp_number B, mp_number C);
+typedef void @[@] (*number_negate_func) (mp_number *A);
+typedef void @[@] (*number_add_func) (mp_number *A, mp_number B);
+typedef void @[@] (*number_substract_func) (mp_number *A, mp_number B);
+typedef void @[@] (*number_modulo_func) (mp_number *A, mp_number B);
+typedef void @[@] (*number_half_func) (mp_number *A);
+typedef void @[@] (*number_halfp_func) (mp_number *A);
+typedef void @[@] (*number_double_func) (mp_number *A);
+typedef void @[@] (*number_abs_func) (mp_number *A);
+typedef void @[@] (*number_clone_func) (mp_number *A, mp_number B);
+typedef void @[@] (*number_swap_func) (mp_number *A, mp_number *B);
+typedef void @[@] (*number_add_scaled_func) (mp_number *A, int b);
+typedef void @[@] (*number_multiply_int_func) (mp_number *A, int b);
+typedef void @[@] (*number_divide_int_func) (mp_number *A, int b);
+typedef int @[@] (*number_to_int_func) (mp_number A);
+typedef int @[@] (*number_to_boolean_func) (mp_number A);
+typedef int @[@] (*number_to_scaled_func) (mp_number A);
+typedef int @[@] (*number_round_func) (mp_number A);
+typedef void @[@] (*number_floor_func) (mp_number *A);
+typedef double @[@] (*number_to_double_func) (mp_number A);
+typedef int @[@] (*number_odd_func) (mp_number A);
+typedef int @[@] (*number_equal_func) (mp_number A, mp_number B);
+typedef int @[@] (*number_less_func) (mp_number A, mp_number B);
+typedef int @[@] (*number_greater_func) (mp_number A, mp_number B);
+typedef int @[@] (*number_nonequalabs_func) (mp_number A, mp_number B);
+typedef void @[@] (*make_scaled_func) (MP mp, mp_number *ret, mp_number A, mp_number B);
+typedef void @[@] (*make_fraction_func) (MP mp, mp_number *ret, mp_number A, mp_number B);
+typedef void @[@] (*take_fraction_func) (MP mp, mp_number *ret, mp_number A, mp_number B);
+typedef void @[@] (*take_scaled_func) (MP mp, mp_number *ret, mp_number A, mp_number B);
+typedef void @[@] (*sin_cos_func) (MP mp, mp_number A, mp_number *S, mp_number *C);
+typedef void @[@] (*slow_add_func) (MP mp, mp_number *A, mp_number S, mp_number C);
+typedef void @[@] (*sqrt_func) (MP mp, mp_number *ret, mp_number A);
+typedef void @[@] (*init_randoms_func) (MP mp, int seed);
+typedef void @[@] (*new_number_func) (MP mp, mp_number *A, mp_number_type t);
+typedef void @[@] (*free_number_func) (MP mp, mp_number *n);
+typedef void @[@] (*fraction_to_round_scaled_func) (mp_number *n);
+typedef void @[@] (*print_func) (MP mp, mp_number A);
typedef char * (*tostring_func) (MP mp, mp_number A);
-typedef void (*scan_func) (MP mp, int A);
-typedef void (*mp_free_func) (MP mp);
-typedef void (*set_precision_func) (MP mp);
+typedef void @[@] (*scan_func) (MP mp, int A);
+typedef void @[@] (*mp_free_func) (MP mp);
+typedef void @[@] (*set_precision_func) (MP mp);
/* math interval new primitives */
-typedef void (*m_get_left_endpoint_func) (MP mp, mp_number *r, mp_number a);
-typedef void (*m_get_right_endpoint_func) (MP mp, mp_number *r, mp_number a);
-typedef void (*m_interval_set_func) (MP mp, mp_number *r, mp_number a, mp_number b);
+typedef void @[@] (*m_get_left_endpoint_func) (MP mp, mp_number *r, mp_number a);
+typedef void @[@] (*m_get_right_endpoint_func) (MP mp, mp_number *r, mp_number a);
+typedef void @[@] (*m_interval_set_func) (MP mp, mp_number *r, mp_number a, mp_number b);
typedef struct math_data {
mp_number precision_default;
@@ -642,11 +654,9 @@ MP mp_initialize (MP_options * opt) {
}
if (opt->command_line && *(opt->command_line))
mp->command_line = xstrdup (opt->command_line);
- if (mp->noninteractive) {
- @<Prepare function pointers for non-interactive use@>;
- }
- /* open the terminal for output */
- t_open_out();
+ if (mp->noninteractive)
+ @<Prepare function pointers for non-interactive use@>@;
+ t_open_out(); /* open the terminal for output */
#if DEBUG
setvbuf(stdout, (char *) NULL, _IONBF, 0);
setvbuf(mp->term_out, (char *) NULL, _IONBF, 0);
@@ -678,7 +688,7 @@ MP mp_initialize (MP_options * opt) {
mp_snprintf (ss, 256, "Ouch---my internal constants have been clobbered!\n"
"---case %i", (int) mp->bad);
mp_fputs ((char *) ss, mp->err_out);
-@.Ouch...clobbered@>;
+@.Ouch...clobbered@>
return mp;
}
mp_do_initialize (mp); /* erase preloaded mem */
@@ -764,7 +774,9 @@ approaches to the problem of understanding a somewhat complicated system.
strange behavior that sometimes occurs when \MP\ is being installed or
when system wizards are fooling around with \MP\ without quite knowing
what they are doing. Such code will not normally be compiled; it is
-delimited by the preprocessor test `|#ifdef DEBUG .. #endif|'.
+delimited by the preprocessor test|
+#ifdef DEBUG| $\ldots$|
+#endif|.
@ The following parameters can be changed at compile time to extend or
reduce \MP's capacity.
@@ -777,7 +789,7 @@ reduce \MP's capacity.
@ Like the preceding parameters, the following quantities can be changed
to extend or reduce \MP's capacity.
-@ @<Glob...@>=
+@<Glob...@>=
int pool_size; /* maximum number of characters in strings, including all
error messages and help texts, and the names of all identifiers */
int max_in_open; /* maximum number of input files and error insertions that
@@ -798,8 +810,7 @@ int utf8_mode;
@ @<Dealloc variables@>=
xfree (mp->banner);
-@
-@d set_lower_limited_value(a,b,c) do { a=c; if (b>c) a=b; } while (0)
+@ @d set_lower_limited_value(a,b,c) do { a=c; if (b>c) a=b; } while (0)@;
@<Allocate or ...@>=
mp->param_size = 4;
@@ -827,7 +838,7 @@ integer bad; /* is some ``constant'' wrong? */
@ Later on we will say `|if ( int_packets+(17+2)*int_increment>bistack_size )mp->bad=19;|',
or something similar.
-In case you are wondering about the non-consequtive values of |bad|: most
+In case you are wondering about the non-consecutive values of |bad|: most
of the things that used to be WEB constants are now runtime variables
with checking at assignment time.
@@ -877,8 +888,8 @@ the user's external character set by means of arrays |xord| and |xchr|
that are analogous to Pascal's |ord| and |chr| functions.
@<MPlib internal header stuff@>=
-#define xchr(A) mp->xchr[(A)]
-#define xord(A) mp->xord[(A)]
+#define xchr(A) @[mp->xchr[(A)]@]
+#define xord(A) @[mp->xord[(A)]@]
@ @<Glob...@>=
ASCII_code xord[256]; /* specifies conversion of input characters */
@@ -966,7 +977,7 @@ enum mp_filetype {
mp_filetype_postscript, /* the postscript output */
mp_filetype_bitmap, /* the bitmap output file */
mp_filetype_memfile, /* memory dumps, obsolete */
- mp_filetype_metrics, /* TeX font metric files */
+ mp_filetype_metrics, /* \TeX\ font metric files */
mp_filetype_fontmap, /* PostScript font mapping files */
mp_filetype_font, /* PostScript type1 font programs */
mp_filetype_encoding, /* PostScript font encoding files */
@@ -977,12 +988,12 @@ typedef char *(*mp_script_runner) (MP, const char *, size_t);
typedef char *(*mp_text_maker) (MP, const char *, size_t, int);
typedef void *(*mp_file_opener) (MP, const char *, const char *, int);
typedef char *(*mp_file_reader) (MP, void *, size_t *);
-typedef void (*mp_binfile_reader) (MP, void *, void **, size_t *);
-typedef void (*mp_file_closer) (MP, void *);
-typedef int (*mp_file_eoftest) (MP, void *);
-typedef void (*mp_file_flush) (MP, void *);
-typedef void (*mp_file_writer) (MP, void *, const char *);
-typedef void (*mp_binfile_writer) (MP, void *, void *, size_t);
+typedef void @[@] (*mp_binfile_reader) (MP, void *, void **, size_t *);
+typedef void @[@] (*mp_file_closer) (MP, void *);
+typedef int @[@] (*mp_file_eoftest) (MP, void *);
+typedef void @[@] (*mp_file_flush) (MP, void *);
+typedef void @[@] (*mp_file_writer) (MP, void *, const char *);
+typedef void @[@] (*mp_binfile_writer) (MP, void *, void *, size_t);
@ @<Option variables@>=
mp_file_finder find_file;
@@ -1137,7 +1148,7 @@ static char *mp_read_ascii_file (MP mp, void *ff, size_t * size) {
char *s = NULL;
FILE *f = (FILE *) ff;
*size = 0;
- (void) mp; /* for -Wunused */
+ (void) mp; /* for \.{-Wunused} */
if (f == NULL)
return NULL;
c = fgetc (f);
@@ -1314,7 +1325,7 @@ to the input buffer. The variable |command_line| will be filled by the
@d t_open_out() do {/* open the terminal for text output */
mp->term_out = (mp->open_file)(mp,"terminal", "w", mp_filetype_terminal);
mp->err_out = (mp->open_file)(mp,"error", "w", mp_filetype_error);
-} while (0)
+} while (0)@;
@d t_open_in() do { /* open the terminal for text input */
mp->term_in = (mp->open_file)(mp,"terminal", "r", mp_filetype_terminal);
if (mp->command_line!=NULL) {
@@ -1327,7 +1338,7 @@ to the input buffer. The variable |command_line| will be filled by the
} else {
mp->last = 0;
}
-} while (0)
+} while (0)@;
@<Option variables@>=
char *command_line;
@@ -1347,9 +1358,9 @@ these operations can be specified:
@^system dependencies@>
@<MPlib internal header stuff@>=
-#define update_terminal() (mp->flush_file)(mp,mp->term_out) /* empty the terminal output buffer */
-#define clear_terminal() /* clear the terminal input buffer */
-#define wake_up_terminal() (mp->flush_file)(mp,mp->term_out)
+#define update_terminal() @[(mp->flush_file)(mp,mp->term_out)@] /* empty the terminal output buffer */
+#define clear_terminal() @[@] /* clear the terminal input buffer */
+#define wake_up_terminal() @[(mp->flush_file)(mp,mp->term_out)@]
/* cancel the user's cancellation of output */
@ We need a special routine to read the first line of \MP\ input from
@@ -1409,12 +1420,12 @@ boolean mp_init_terminal (MP mp) { /* gets the ter
if (!mp->noninteractive) {
wake_up_terminal();
mp_fputs ("**", mp->term_out);
-@.**@>;
+@.**@>
update_terminal();
}
if (!mp_input_ln (mp, mp->term_in)) { /* this shouldn't happen */
mp_fputs ("\n! End of file on the terminal... why?", mp->term_out);
-@.End of file on the terminal@>;
+@.End of file on the terminal@>
return false;
}
loc = (halfword) mp->first;
@@ -1593,14 +1604,14 @@ by changing |wterm|, |wterm_ln|, and |wterm_cr| here.
@^system dependencies@>
@<MPlib internal header stuff@>=
-#define mp_fputs(b,f) (mp->write_ascii_file)(mp,f,b)
-#define wterm(A) mp_fputs((A), mp->term_out)
+#define mp_fputs(b,f) @[(mp->write_ascii_file)(mp,f,b)@]
+#define wterm(A) @[mp_fputs((A), mp->term_out)@]
#define wterm_chr(A) { unsigned char ss[2]; ss[0]=(A); ss[1]='\0'; wterm((char *)ss);}
-#define wterm_cr mp_fputs("\n", mp->term_out)
+#define wterm_cr @[mp_fputs("\n", mp->term_out)@]
#define wterm_ln(A) { wterm_cr; mp_fputs((A), mp->term_out); }
-#define wlog(A) mp_fputs((A), mp->log_file)
+#define wlog(A) @[mp_fputs((A), mp->log_file)@]
#define wlog_chr(A) { unsigned char ss[2]; ss[0]=(A); ss[1]='\0'; wlog((char *)ss);}
-#define wlog_cr mp_fputs("\n", mp->log_file)
+#define wlog_cr @[mp_fputs("\n", mp->log_file)@]
#define wlog_ln(A) { wlog_cr; mp_fputs((A), mp->log_file); }
@@ -1668,11 +1679,11 @@ static void mp_print_visible_char (MP mp, ASCII_code s) {
if (mp->term_offset == (unsigned) mp->max_print_line) {
wterm_cr;
mp->term_offset = 0;
- };
+ }
if (mp->file_offset == (unsigned) mp->max_print_line) {
wlog_cr;
mp->file_offset = 0;
- };
+ }
break;
case log_only:
wlog_chr (xchr (s));
@@ -1756,7 +1767,7 @@ static void mp_do_print (MP mp, const char *ss, size_t len) {
} else {
size_t j = 0;
while (j < len) {
- /* this was |xord((int)ss[j])| but that doesnt work */
+ /* this was |xord((int)ss[j])| but that doesn't work */
mp_print_char (mp, (ASCII_code) ss[j]);
j++;
}
@@ -1764,8 +1775,7 @@ static void mp_do_print (MP mp, const char *ss, size_t len) {
}
-@
-@<Basic print...@>=
+@ @<Basic print...@>=
void mp_print (MP mp, const char *ss) {
assert (ss != NULL);
mp_do_print (mp, ss, strlen (ss));
@@ -1871,7 +1881,7 @@ This procedure is never called when |interaction<mp_scroll_mode|.
mp_print(mp, (A));
}
mp_term_input(mp);
- } while (0) /* prints a string and gets a line of input */
+ } while (0)@; /* prints a string and gets a line of input */
@c
void mp_term_input (MP mp) { /* gets a line from the terminal */
@@ -1943,7 +1953,7 @@ where |error| is not called at all.
@<Declarations@>=
static void mp_print_err (MP mp, const char *A);
-@ @c
+@ @s line x @c
static void mp_print_err (MP mp, const char *A) {
if (mp->interaction == mp_error_stop_mode)
wake_up_terminal();
@@ -2040,14 +2050,14 @@ whole program. It is used when there is no recovery from a particular error.
The program uses a |jump_buf| to handle this, this is initialized at three
spots: the start of |mp_new|, the start of |mp_initialize|, and the start
-of |mp_run|. Those are the only library enty points.
+of |mp_run|. Those are the only library entry points.
@^system dependencies@>
@<Glob...@>=
jmp_buf *jump_buf;
@ If the array of internals is still |NULL| when |jump_out| is called, a
-crash occured during initialization, and it is not safe to run the normal
+crash occurred during initialization, and it is not safe to run the normal
cleanup routine.
@<Error hand...@>=
@@ -2060,9 +2070,7 @@ void mp_jump_out (MP mp) {
@ @<Internal ...@>=
void mp_jump_out (MP mp);
-@
-
-@<Error hand...@>=
+@ @<Error hand...@>=
void mp_warn (MP mp, const char *msg) {
unsigned saved_selector = mp->selector;
mp_normalize_selector (mp);
@@ -2083,6 +2091,8 @@ Individual lines of help are recorded in the array |help_line|, which
contains entries in positions |0..(help_ptr-1)|. They should be printed
in reverse order, i.e., with |help_line[0]| appearing last.
+@s mp_sym int
+
@c
void mp_error (MP mp, const char *msg, const char **hlp, boolean deletions_allowed) {
ASCII_code c; /* what the user types */
@@ -2118,7 +2128,7 @@ void mp_error (MP mp, const char *msg, const char **hlp, boolean deletions_allow
incr (mp->error_count);
if (mp->error_count == 100) {
mp_print_nl (mp, "(That makes 100 errors; please try again.)");
-@.That makes 100 errors...@>;
+@.That makes 100 errors...@>
mp->history = mp_fatal_error_stop;
mp_jump_out (mp);
}
@@ -2136,7 +2146,7 @@ while (true) {
CONTINUE:
mp_clear_for_error_prompt (mp);
prompt_input ("? ");
-@.?\relax@>;
+@.?\relax@>
if (mp->last == mp->first)
return;
c = mp->buffer[mp->first];
@@ -2155,7 +2165,7 @@ edited and the relevant line number.
@^system dependencies@>
@<Exported types@>=
-typedef void (*mp_editor_cmd) (MP, char *, int);
+typedef void @[@] (*mp_editor_cmd) (MP, char *, int);
@ @<Option variables@>=
mp_editor_cmd run_editor;
@@ -2175,9 +2185,7 @@ void mp_run_editor (MP mp, char *fname, int fline) {
}
-@
-
-@<Interpret code |c| and |return| if done@>=
+@ @<Interpret code |c| and |return| if done@>=
switch (c) {
case '0':
case '1':
@@ -2227,7 +2235,7 @@ default:
@ @<Print the menu...@>=
{
mp_print (mp, "Type <return> to proceed, S to scroll future error messages,");
-@.Type <return> to proceed...@>;
+@.Type <return> to proceed...@>
mp_print_nl (mp, "R to run without stopping, Q to run quietly,");
mp_print_nl (mp, "I to insert something, ");
if (mp->file_ptr > 0)
@@ -2304,7 +2312,7 @@ to be familiar with \MP's input stacks.
mp_get_next (mp); /* one-level recursive call of |error| is possible */
@<Decrease the string reference count, if the current token is a string@>;
c--;
- };
+ }
set_cur_cmd (s1);
set_cur_mod (s2);
set_cur_sym (s3);
@@ -2337,7 +2345,7 @@ in a row.
mp_print (mp, help_line[help_ptr]);
mp_print_ln (mp);
} while (help_ptr != 0);
- };
+ }
help_ptr=4;
help_line[3] = "Sorry, I already gave what help I could...";
help_line[2] = "Maybe you should try asking a human?";
@@ -2360,7 +2368,7 @@ in a row.
else {
j++;
mp_print_char (mp, xord ('%'));
- };
+ }
j++;
}
}
@@ -2379,7 +2387,7 @@ if (mp->use_err_help) {
while (help_ptr > 0) {
decr (help_ptr);
mp_print_nl (mp, help_line[help_ptr]);
- };
+ }
mp_print_ln (mp);
if (! mp->noninteractive) {
if (mp->interaction > mp_batch_mode)
@@ -2439,7 +2447,7 @@ void mp_overflow (MP mp, const char *s, integer n) {
NULL };
mp_normalize_selector (mp);
mp_snprintf (msg, 256, "MetaPost capacity exceeded, sorry [%s=%d]", s, (int) n);
-@.MetaPost capacity exceeded ...@>;
+@.MetaPost capacity exceeded ...@>
if ( mp->interaction==mp_error_stop_mode )
mp->interaction=mp_scroll_mode; /* no more interaction */
if ( mp->log_opened )
@@ -2471,12 +2479,12 @@ void mp_confusion (MP mp, const char *s) {
mp_normalize_selector (mp);
if (mp->history < mp_error_message_issued) {
mp_snprintf (msg, 256, "This can't happen (%s)", s);
-@.This can't happen@>;
+@.This can't happen@>
hlp[0] = "I'm broken. Please show this to someone who can fix can fix";
hlp[1] = NULL;
} else {
mp_snprintf (msg, 256, "I can\'t go on meeting you like this");
-@.I can't go on...@>;
+@.I can't go on...@>
}
if ( mp->interaction==mp_error_stop_mode )
mp->interaction=mp_scroll_mode; /* no more interaction */
@@ -2524,7 +2532,7 @@ static void mp_pause_for_instructions (MP mp) {
mp->interaction = mp_error_stop_mode;
if ((mp->selector == log_only) || (mp->selector == no_print))
incr (mp->selector);
-@.Interruption@>;
+@.Interruption@>
mp_error (mp, "Interruption", hlp, false);
mp->interrupt = 0;
}
@@ -2569,7 +2577,7 @@ an arithmetic error has been detected.
@d check_arith() do {
if ( mp->arith_error )
mp_clear_arith(mp);
-} while (0)
+} while (0)@;
@c
static void mp_clear_arith (MP mp) {
@@ -2580,7 +2588,7 @@ static void mp_clear_arith (MP mp) {
"tactics next time. But I shall try to carry on anyway.",
NULL };
mp_error (mp, "Arithmetic overflow", hlp, true);
-@.Arithmetic overflow@>;
+@.Arithmetic overflow@>
mp->arith_error = false;
}
@@ -2650,7 +2658,7 @@ The global variable |j_random| tells which element has most recently
been consumed.
The global variable |random_seed| was introduced in version 0.9,
for the sole reason of stressing the fact that the initial value of the
-random seed is system-dependant. The initialization code below will initialize
+random seed is system-dependent. The initialization code below will initialize
this variable to |(internal[mp_time] div unity)+internal[mp_day]|, but this
is not good enough on modern fast machines that are capable of running
multiple MetaPost processes within the same second.
@@ -2706,18 +2714,20 @@ void mp_new_randoms (MP mp) {
@ To consume a random fraction, the program below will say `|next_random|'.
Now each number system has its own implementation,
-true to the original as much as possibile.
+true to the original as much as possible.
+
+Unused.
@c
-/* Unused.
-static void mp\_next\_random (MP mp, mp\_number *ret) {
- if ( mp->j\_random==0 )
- mp\_new\_randoms(mp);
+#if 0
+static void mp_next_random (MP mp, mp_number *ret) {
+ if ( mp->j_random==0 )
+ mp_new_randoms(mp);
else
- decr(mp->j\_random);
- number\_clone (*ret, mp->randoms[mp->j\_random]);
+ decr(mp->j_random);
+ number_clone (*ret, mp->randoms[mp->j_random]);
}
-*/
+#endif
@ To produce a uniform random number in the range |0<=u<x| or |0>=u>x|
or |0=u=x|, given a |scaled| value~|x|, we proceed as shown here.
@@ -2729,87 +2739,88 @@ This is the original one,
that stays as reference:
As said before, now each number system has its own implementation.
+Unused.
@c
-/*Unused.
-static void mp\_unif\_rand (MP mp, mp\_number *ret, mp\_number x\_orig) {
- mp\_number y; // trial value
- mp\_number x, abs\_x;
- mp\_number u;
- new\_fraction (y);
- new\_number (x);
- new\_number (abs\_x);
- new\_number (u);
- number\_clone (x, x\_orig);
- number\_clone (abs\_x, x);
- number\_abs (abs\_x);
- mp\_next\_random(mp, \&u);
- take\_fraction (y, abs\_x, u);
- free\_number (u);
- if (number\_equal(y, abs\_x)) {
- set\_number\_to\_zero(*ret);
- } else if (number\_positive(x)) {
- number\_clone (*ret, y);
+#if 0
+static void mp_unif_rand (MP mp, mp_number *ret, mp_number x_orig) {
+ mp_number y; // trial value
+ mp_number x, abs_x;
+ mp_number u;
+ new_fraction (y);
+ new_number (x);
+ new_number (abs_x);
+ new_number (u);
+ number_clone (x, x_orig);
+ number_clone (abs_x, x);
+ number_abs (abs_x);
+ mp_next_random(mp, &u);
+ take_fraction (y, abs_x, u);
+ free_number (u);
+ if (number_equal(y, abs_x)) {
+ set_number_to_zero(*ret);
+ } else if (number_positive(x)) {
+ number_clone (*ret, y);
} else {
- number\_clone (*ret, y);
- number\_negate (*ret);
+ number_clone (*ret, y);
+ number_negate (*ret);
}
- free\_number (abs\_x);
- free\_number (x);
- free\_number (y);
+ free_number (abs_x);
+ free_number (x);
+ free_number (y);
}
-*/
+#endif
@ Finally, a normal deviate with mean zero and unit standard deviation
can readily be obtained with the ratio method (Algorithm 3.4.1R in
{\sl The Art of Computer Programming\/}). This is the original one,
that stays as reference:
Now each number system has its own implementation,
-true to the original as much as possibile.
+true to the original as much as possible.
+ Unused.
@c
-/* Unused.
-static void mp\_norm\_rand (MP mp, mp\_number *ret) {
- mp\_number ab\_vs\_cd;
- mp\_number abs\_x;
- mp\_number u;
- mp\_number r;
- mp\_number la, xa;
- new\_number (ab\_vs\_cd);
- new\_number (la);
- new\_number (xa);
- new\_number (abs\_x);
- new\_number (u);
- new\_number (r);
+#if 0
+static void mp_norm_rand (MP mp, mp_number *ret) {
+ mp_number ab_vs_cd;
+ mp_number abs_x;
+ mp_number u;
+ mp_number r;
+ mp_number la, xa;
+ new_number (ab_vs_cd);
+ new_number (la);
+ new_number (xa);
+ new_number (abs_x);
+ new_number (u);
+ new_number (r);
do {
do {
- mp\_number v;
- new\_number (v);
- mp\_next\_random(mp, \&v);
- number\_substract (v, fraction\_half\_t);
- take\_fraction (xa, sqrt\_8\_e\_k, v);
- free\_number (v);
- mp\_next\_random(mp, \&u);
- number\_clone (abs\_x, xa);
- number\_abs (abs\_x);
- } while (number\_greaterequal (abs\_x, u));
- make\_fraction (r, xa, u);
- number\_clone (xa, r);
- m\_log (la, u);
- set\_number\_from\_substraction(la, twelve\_ln\_2\_k, la);
- ab\_vs\_cd (ab\_vs\_cd, one\_k, la, xa, xa);
- } while (number\_negative(ab\_vs\_cd));
- number\_clone (*ret, xa);
- free\_number (ab\_vs\_cd);
- free\_number (r);
- free\_number (abs\_x);
- free\_number (la);
- free\_number (xa);
- free\_number (u);
+ mp_number v;
+ new_number (v);
+ mp_next_random(mp, &v);
+ number_substract (v, fraction_half_t);
+ take_fraction (xa, sqrt_8_e_k, v);
+ free_number (v);
+ mp_next_random(mp, &u);
+ number_clone (abs_x, xa);
+ number_abs (abs_x);
+ } while (number_greaterequal (abs_x, u));
+ make_fraction (r, xa, u);
+ number_clone (xa, r);
+ m_log (la, u);
+ set_number_from_substraction(la, twelve_ln_2_k, la);
+ ab_vs_cd (ab_vs_cd, one_k, la, xa, xa);
+ } while (number_negative(ab_vs_cd));
+ number_clone (*ret, xa);
+ free_number (ab_vs_cd);
+ free_number (r);
+ free_number (abs_x);
+ free_number (la);
+ free_number (xa);
+ free_number (u);
}
-*/
-
+#endif
@* Packed data.
@@ -2826,6 +2837,9 @@ from quarterwords. These are legacy macros.
@ The reader should study the following definitions closely:
@^system dependencies@>
+@s mp_knot int
+@s mp_variable_type int
+
@<Types...@>=
typedef struct mp_value_node_data *mp_value_node;
typedef struct mp_node_data *mp_node;
@@ -2877,8 +2891,7 @@ int math_mode; /* math mode */
@ @<Allocate or initialize ...@>=
mp->math_mode = opt->math_mode;
-@
-@d xfree(A) do { mp_xfree(A); A=NULL; } while (0)
+@ @d xfree(A) do { mp_xfree(A); A=NULL; } while (0)@;
@d xrealloc(P,A,B) mp_xrealloc(mp,P,(size_t)A,B)
@d xmalloc(A,B) mp_xmalloc(mp,(size_t)A,B)
@d xstrdup(A) mp_xstrdup(mp,A)
@@ -2954,7 +2967,6 @@ while (mp->knot_nodes) {
@d malloc_node(A) do_alloc_node(mp,(A))
-@
@c
void *do_alloc_node (MP mp, size_t size) {
void *p;
@@ -3000,7 +3012,7 @@ void *mp_xmalloc (MP mp, size_t nmem, size_t size) {
mp_jump_out (mp);
}
#endif
- w = calloc(nmem, size); /* TODO: check an un-initialize use of w and replace calloc with malloc. */
+ w = calloc(nmem, size); /* TODO: check an un-initialized use of |w| and replace |calloc| with |malloc|. */
if (w == NULL) {
mp_fputs ("Out of memory!\n", mp->err_out);
mp->history = mp_system_error_stop;
@@ -3020,6 +3032,9 @@ can readily be transported into environments that do not have automatic
facilities for strings, garbage collection, etc., and so that it can be in
control of what error messages the user receives.
+@s mp_name_type_type int
+@s mp_node_data int
+
@d MP_VOID (mp_node)(1) /* |NULL+1|, a |NULL| pointer different from |NULL| */
@d mp_link(A) (A)->link /* the |link| field of a node */
@@ -3027,18 +3042,19 @@ control of what error messages the user receives.
mp_node d = (B);
/* |printf("set link of %p to %p on line %d\n", (A), d, __LINE__);| */
mp_link((A)) = d;
- } while (0)
+ } while (0)@;
@d mp_type(A) (A)->type /* identifies what kind of value this is */
@d mp_name_type(A) (A)->name_type /* a clue to the name of this value */
-@ @<MPlib internal header stuff@>=
+@<MPlib internal header stuff@>=
#define NODE_BODY \
mp_variable_type type; \
mp_name_type_type name_type; \
unsigned short has_number; \
- struct mp_node_data *link
+ struct mp_node_data *link@;
+@#@t\2\2\4\4@>
typedef struct mp_node_data {
- NODE_BODY;
+ NODE_BODY;@+@t}\6{@>
mp_value_data data;
} mp_node_data;
typedef struct mp_node_data *mp_symbolic_node;
@@ -3050,7 +3066,7 @@ can use the special features that keep track of current and maximum memory usage
@d add_var_used(a) do {
mp->var_used+=(a);
if (mp->var_used>mp->var_used_max) mp->var_used_max=mp->var_used;
-} while (0)
+} while (0)@;
@<Glob...@>=
size_t var_used; /* how much memory is in use */
@@ -3060,10 +3076,10 @@ size_t var_used_max; /* how much memory was in use max */
@c
#if DEBUG
-#define mp_sym_info(A) get_mp_sym_info(mp,(A))
-#define set_mp_sym_info(A,B) do_set_mp_sym_info(mp,(A),(B))
-#define mp_sym_sym(A) get_mp_sym_sym(mp,(A))
-#define set_mp_sym_sym(A,B) do_set_mp_sym_sym(mp,(A),(mp_sym)(B))
+#define mp_sym_info(A) @[get_mp_sym_info(mp,(A))@]
+#define set_mp_sym_info(A,B) @[do_set_mp_sym_info(mp,(A),(B))@]
+#define mp_sym_sym(A) @[get_mp_sym_sym(mp,(A))@]
+#define set_mp_sym_sym(A,B) @[do_set_mp_sym_sym(mp,(A),(mp_sym)(B))@]
static void do_set_mp_sym_info (MP mp, mp_node p, halfword v) {
FUNCTION_TRACE3 ("do_set_mp_sym_info(%p,%d)\n", p, v);
assert (p->type == mp_symbol_node);
@@ -3087,10 +3103,10 @@ static mp_sym get_mp_sym_sym (MP mp, mp_node p) {
return pp->data.sym;
}
#else
-#define mp_sym_info(A) indep_value(A)
-#define set_mp_sym_info(A,B) set_indep_value(A, (B))
-#define mp_sym_sym(A) (A)->data.sym
-#define set_mp_sym_sym(A,B) (A)->data.sym = (mp_sym)(B)
+#define mp_sym_info(A) @[indep_value(A)@]
+#define set_mp_sym_info(A,B) @[set_indep_value(A, (B))@]
+#define mp_sym_sym(A) @[(A)->data.sym@]
+#define set_mp_sym_sym(A,B) @[(A)->data.sym = (mp_sym)(B)@]
#endif
@ @<Declarations@>=
@@ -3194,6 +3210,8 @@ void mp_free_value_node (MP mp, mp_node p);
Some nodes are created statically, since static allocation is
more efficient than dynamic allocation when we can get away with it.
+@s mp_dash_node int
+
@<Glob...@>=
mp_dash_node null_dash;
mp_value_node dep_head;
@@ -3371,7 +3389,7 @@ mp_semicolon, /* the operator `\.;', must be |comma+1| */
mp_end_group, /* end a group (\&{endgroup}), must be |semicolon+1| */
mp_stop, /* end a job (\&{end}, \&{dump}), must be |end_group+1| */
mp_outer_tag, /* protection code added to command code */
-mp_undefined_cs, /* protection code added to command code */
+mp_undefined_cs,@[@] /* protection code added to command code */
} mp_command_code;
@ Variables and capsules in \MP\ have a variety of ``types,''
@@ -3436,7 +3454,7 @@ typedef enum {
mp_dash_node_type,
mp_dep_node_type,
mp_if_node_type,
- mp_edge_header_node_type,
+ mp_edge_header_node_type,@[@]
} mp_variable_type;
@ @<Declarations@>=
@@ -3757,9 +3775,9 @@ mp_envelope_of, /* operation code for \.{envelope} */
mp_boundingpath_of, /* operation code for \.{boundingpath} */
mp_glyph_infont, /* operation code for \.{glyph} */
mp_kern_flag, /* operation code for \.{kern} */
-mp_m_get_left_endpoint_op, /* math interval new primitives operation code for \.{interval_get_left_endpoint} */
-mp_m_get_right_endpoint_op, /* math interval new primitives operation code for \.{interval_get_right_endpoint} */
-mp_interval_set_op, /* math interval new primitives operation code for \.{interval_set} */
+mp_m_get_left_endpoint_op, /* math interval new primitives operation code for \.{interval\_get\_left\_endpoint} */
+mp_m_get_right_endpoint_op, /* math interval new primitives operation code for \.{interval\_get\_right\_endpoint} */
+mp_interval_set_op,@[@] /* math interval new primitives operation code for \.{interval\_set} */
@ @c
@@ -4106,7 +4124,7 @@ enum mp_given_internal {
mp_output_format_options, /* the output format options set up by \&{outputformatoptions} */
mp_number_system, /* the number system as set up by \&{numbersystem} */
mp_number_precision, /* the number system precision as set up by \&{numberprecision} */
- mp_job_name, /* the perceived jobname, as set up from the options stucture,
+ mp_job_name, /* the perceived jobname, as set up from the options structure,
the name of the input file, or by \&{jobname} */
mp_tracing_titles, /* show titles online when they appear */
mp_tracing_equations, /* show each variable when it becomes known */
@@ -4146,10 +4164,10 @@ enum mp_given_internal {
mp_true_corners, /* positive to make \&{llcorner} etc. ignore \&{setbounds} */
mp_default_color_model, /* the default color model for unspecified items */
mp_restore_clip_color,
- mp_procset, /* wether or not create PostScript command shortcuts */
+ mp_procset, /* whether or not create PostScript command shortcuts */
mp_hppp, /* horizontal pixels per point (for png output) */
mp_vppp, /* vertical pixels per point (for png output) */
- mp_gtroffmode, /* whether the user specified |-troff| on the command line */
+ mp_gtroffmode,@[@] /* whether the user specified \.{-troff} on the command line */
};
typedef struct {
mp_value v;
@@ -4158,16 +4176,16 @@ typedef struct {
@ @<MPlib internal header stuff@>=
-#define internal_value(A) mp->internal[(A)].v.data.n
+#define internal_value(A) @[mp->internal[(A)].v.data.n@]
#define set_internal_from_number(A,B) do { \
number_clone (internal_value ((A)),(B));\
-} while (0)
-#define internal_string(A) (mp_string)mp->internal[(A)].v.data.str
-#define set_internal_string(A,B) mp->internal[(A)].v.data.str=(B)
-#define internal_name(A) mp->internal[(A)].intname
-#define set_internal_name(A,B) mp->internal[(A)].intname=(B)
-#define internal_type(A) (mp_variable_type)mp->internal[(A)].v.type
-#define set_internal_type(A,B) mp->internal[(A)].v.type=(B)
+} while (0)@;
+#define internal_string(A) @[(mp_string)mp->internal[(A)].v.data.str@]
+#define set_internal_string(A,B) @[mp->internal[(A)].v.data.str=(B)@]
+#define internal_name(A) @[mp->internal[(A)].intname@]
+#define set_internal_name(A,B) @[mp->internal[(A)].intname=(B)@]
+#define internal_type(A) @[(mp_variable_type)mp->internal[(A)].v.type@]
+#define set_internal_type(A,B) @[mp->internal[(A)].v.type=(B)@]
#define set_internal_from_cur_exp(A) do { \
if (internal_type ((A)) == mp_string_type) { \
add_str_ref (cur_exp_str ()); \
@@ -4175,13 +4193,11 @@ typedef struct {
} else { \
set_internal_from_number ((A), cur_exp_value_number ()); \
} \
-} while (0)
-
+} while (0)@;
-@
-@d max_given_internal mp_gtroffmode
+@ @d max_given_internal mp_gtroffmode
@<Glob...@>=
mp_internal *internal; /* the values of internal quantities */
@@ -4232,103 +4248,103 @@ anywhere else.
@<Put each of \MP's primitives into the hash table@>=
mp_primitive (mp, "tracingtitles", mp_internal_quantity, mp_tracing_titles);
-@:tracingtitles_}{\&{tracingtitles} primitive@>;
+@:tracingtitles_}{\&{tracingtitles} primitive@>
mp_primitive (mp, "tracingequations", mp_internal_quantity, mp_tracing_equations);
-@:mp_tracing_equations_}{\&{tracingequations} primitive@>;
+@:mp_tracing_equations_}{\&{tracingequations} primitive@>
mp_primitive (mp, "tracingcapsules", mp_internal_quantity, mp_tracing_capsules);
-@:mp_tracing_capsules_}{\&{tracingcapsules} primitive@>;
+@:mp_tracing_capsules_}{\&{tracingcapsules} primitive@>
mp_primitive (mp, "tracingchoices", mp_internal_quantity, mp_tracing_choices);
-@:mp_tracing_choices_}{\&{tracingchoices} primitive@>;
+@:mp_tracing_choices_}{\&{tracingchoices} primitive@>
mp_primitive (mp, "tracingspecs", mp_internal_quantity, mp_tracing_specs);
-@:mp_tracing_specs_}{\&{tracingspecs} primitive@>;
+@:mp_tracing_specs_}{\&{tracingspecs} primitive@>
mp_primitive (mp, "tracingcommands", mp_internal_quantity, mp_tracing_commands);
-@:mp_tracing_commands_}{\&{tracingcommands} primitive@>;
+@:mp_tracing_commands_}{\&{tracingcommands} primitive@>
mp_primitive (mp, "tracingrestores", mp_internal_quantity, mp_tracing_restores);
-@:mp_tracing_restores_}{\&{tracingrestores} primitive@>;
+@:mp_tracing_restores_}{\&{tracingrestores} primitive@>
mp_primitive (mp, "tracingmacros", mp_internal_quantity, mp_tracing_macros);
-@:mp_tracing_macros_}{\&{tracingmacros} primitive@>;
+@:mp_tracing_macros_}{\&{tracingmacros} primitive@>
mp_primitive (mp, "tracingoutput", mp_internal_quantity, mp_tracing_output);
-@:mp_tracing_output_}{\&{tracingoutput} primitive@>;
+@:mp_tracing_output_}{\&{tracingoutput} primitive@>
mp_primitive (mp, "tracingstats", mp_internal_quantity, mp_tracing_stats);
-@:mp_tracing_stats_}{\&{tracingstats} primitive@>;
+@:mp_tracing_stats_}{\&{tracingstats} primitive@>
mp_primitive (mp, "tracinglostchars", mp_internal_quantity, mp_tracing_lost_chars);
-@:mp_tracing_lost_chars_}{\&{tracinglostchars} primitive@>;
+@:mp_tracing_lost_chars_}{\&{tracinglostchars} primitive@>
mp_primitive (mp, "tracingonline", mp_internal_quantity, mp_tracing_online);
-@:mp_tracing_online_}{\&{tracingonline} primitive@>;
+@:mp_tracing_online_}{\&{tracingonline} primitive@>
mp_primitive (mp, "year", mp_internal_quantity, mp_year);
-@:mp_year_}{\&{year} primitive@>;
+@:mp_year_}{\&{year} primitive@>
mp_primitive (mp, "month", mp_internal_quantity, mp_month);
-@:mp_month_}{\&{month} primitive@>;
+@:mp_month_}{\&{month} primitive@>
mp_primitive (mp, "day", mp_internal_quantity, mp_day);
-@:mp_day_}{\&{day} primitive@>;
+@:mp_day_}{\&{day} primitive@>
mp_primitive (mp, "time", mp_internal_quantity, mp_time);
-@:time_}{\&{time} primitive@>;
+@:time_}{\&{time} primitive@>
mp_primitive (mp, "hour", mp_internal_quantity, mp_hour);
-@:hour_}{\&{hour} primitive@>;
+@:hour_}{\&{hour} primitive@>
mp_primitive (mp, "minute", mp_internal_quantity, mp_minute);
-@:minute_}{\&{minute} primitive@>;
+@:minute_}{\&{minute} primitive@>
mp_primitive (mp, "charcode", mp_internal_quantity, mp_char_code);
-@:mp_char_code_}{\&{charcode} primitive@>;
+@:mp_char_code_}{\&{charcode} primitive@>
mp_primitive (mp, "charext", mp_internal_quantity, mp_char_ext);
-@:mp_char_ext_}{\&{charext} primitive@>;
+@:mp_char_ext_}{\&{charext} primitive@>
mp_primitive (mp, "charwd", mp_internal_quantity, mp_char_wd);
-@:mp_char_wd_}{\&{charwd} primitive@>;
+@:mp_char_wd_}{\&{charwd} primitive@>
mp_primitive (mp, "charht", mp_internal_quantity, mp_char_ht);
-@:mp_char_ht_}{\&{charht} primitive@>;
+@:mp_char_ht_}{\&{charht} primitive@>
mp_primitive (mp, "chardp", mp_internal_quantity, mp_char_dp);
-@:mp_char_dp_}{\&{chardp} primitive@>;
+@:mp_char_dp_}{\&{chardp} primitive@>
mp_primitive (mp, "charic", mp_internal_quantity, mp_char_ic);
-@:mp_char_ic_}{\&{charic} primitive@>;
+@:mp_char_ic_}{\&{charic} primitive@>
mp_primitive (mp, "designsize", mp_internal_quantity, mp_design_size);
-@:mp_design_size_}{\&{designsize} primitive@>;
+@:mp_design_size_}{\&{designsize} primitive@>
mp_primitive (mp, "pausing", mp_internal_quantity, mp_pausing);
-@:mp_pausing_}{\&{pausing} primitive@>;
+@:mp_pausing_}{\&{pausing} primitive@>
mp_primitive (mp, "showstopping", mp_internal_quantity, mp_showstopping);
-@:mp_showstopping_}{\&{showstopping} primitive@>;
+@:mp_showstopping_}{\&{showstopping} primitive@>
mp_primitive (mp, "fontmaking", mp_internal_quantity, mp_fontmaking);
-@:mp_fontmaking_}{\&{fontmaking} primitive@>;
+@:mp_fontmaking_}{\&{fontmaking} primitive@>
mp_primitive (mp, "texscriptmode", mp_internal_quantity, mp_texscriptmode);
-@:mp_texscriptmode_}{\&{texscriptmode} primitive@>;
+@:mp_texscriptmode_}{\&{texscriptmode} primitive@>
mp_primitive (mp, "linejoin", mp_internal_quantity, mp_linejoin);
-@:mp_linejoin_}{\&{linejoin} primitive@>;
+@:mp_linejoin_}{\&{linejoin} primitive@>
mp_primitive (mp, "linecap", mp_internal_quantity, mp_linecap);
-@:mp_linecap_}{\&{linecap} primitive@>;
+@:mp_linecap_}{\&{linecap} primitive@>
mp_primitive (mp, "miterlimit", mp_internal_quantity, mp_miterlimit);
-@:mp_miterlimit_}{\&{miterlimit} primitive@>;
+@:mp_miterlimit_}{\&{miterlimit} primitive@>
mp_primitive (mp, "warningcheck", mp_internal_quantity, mp_warning_check);
-@:mp_warning_check_}{\&{warningcheck} primitive@>;
+@:mp_warning_check_}{\&{warningcheck} primitive@>
mp_primitive (mp, "boundarychar", mp_internal_quantity, mp_boundary_char);
-@:mp_boundary_char_}{\&{boundarychar} primitive@>;
+@:mp_boundary_char_}{\&{boundarychar} primitive@>
mp_primitive (mp, "prologues", mp_internal_quantity, mp_prologues);
-@:mp_prologues_}{\&{prologues} primitive@>;
+@:mp_prologues_}{\&{prologues} primitive@>
mp_primitive (mp, "truecorners", mp_internal_quantity, mp_true_corners);
-@:mp_true_corners_}{\&{truecorners} primitive@>;
+@:mp_true_corners_}{\&{truecorners} primitive@>
mp_primitive (mp, "mpprocset", mp_internal_quantity, mp_procset);
-@:mp_procset_}{\&{mpprocset} primitive@>;
+@:mp_procset_}{\&{mpprocset} primitive@>
mp_primitive (mp, "troffmode", mp_internal_quantity, mp_gtroffmode);
-@:troffmode_}{\&{troffmode} primitive@>;
+@:troffmode_}{\&{troffmode} primitive@>
mp_primitive (mp, "defaultcolormodel", mp_internal_quantity, mp_default_color_model);
-@:mp_default_color_model_}{\&{defaultcolormodel} primitive@>;
+@:mp_default_color_model_}{\&{defaultcolormodel} primitive@>
mp_primitive (mp, "restoreclipcolor", mp_internal_quantity, mp_restore_clip_color);
-@:mp_restore_clip_color_}{\&{restoreclipcolor} primitive@>;
+@:mp_restore_clip_color_}{\&{restoreclipcolor} primitive@>
mp_primitive (mp, "outputtemplate", mp_internal_quantity, mp_output_template);
-@:mp_output_template_}{\&{outputtemplate} primitive@>;
+@:mp_output_template_}{\&{outputtemplate} primitive@>
mp_primitive (mp, "outputfilename", mp_internal_quantity, mp_output_filename);
-@:mp_output_filename_}{\&{outputfilename} primitive@>;
+@:mp_output_filename_}{\&{outputfilename} primitive@>
mp_primitive (mp, "numbersystem", mp_internal_quantity, mp_number_system);
-@:mp_number_system_}{\&{numbersystem} primitive@>;
+@:mp_number_system_}{\&{numbersystem} primitive@>
mp_primitive (mp, "numberprecision", mp_internal_quantity, mp_number_precision);
-@:mp_number_precision_}{\&{numberprecision} primitive@>;
+@:mp_number_precision_}{\&{numberprecision} primitive@>
mp_primitive (mp, "outputformat", mp_internal_quantity, mp_output_format);
-@:mp_output_format_}{\&{outputformat} primitive@>;
+@:mp_output_format_}{\&{outputformat} primitive@>
mp_primitive (mp, "outputformatoptions", mp_internal_quantity, mp_output_format_options);
-@:mp_output_format_options_}{\&{outputformatoptions} primitive@>;
+@:mp_output_format_options_}{\&{outputformatoptions} primitive@>
mp_primitive (mp, "jobname", mp_internal_quantity, mp_job_name);
@:mp_job_name_}{\&{jobname} primitive@>
mp_primitive (mp, "hppp", mp_internal_quantity, mp_hppp);
-@:mp_hppp_}{\&{hppp} primitive@>;
+@:mp_hppp_}{\&{hppp} primitive@>
mp_primitive (mp, "vppp", mp_internal_quantity, mp_vppp);
-@:mp_vppp_}{\&{vppp} primitive@>;
+@:mp_vppp_}{\&{vppp} primitive@>
@ Colors can be specified in four color models. In the special
@@ -4519,9 +4535,7 @@ void mp_end_diagnostic (MP mp, boolean blank_line) {
}
-@
-
-@<Glob...@>=
+@ @<Glob...@>=
unsigned int old_setting;
@ We will occasionally use |begin_diagnostic| in connection with line-number
@@ -4561,7 +4575,7 @@ class numbers in nonstandard extensions of \MP.
@d invalid_class 20 /* bad character in the input */
@d max_class 20 /* the largest class number */
-@d semicolon_class 6 /* the ; */
+@d semicolon_class 6 /* the class number of `\.;' */
@<Glob...@>=
#define digit_class 0 /* the class number of \.{0123456789} */
@@ -4633,38 +4647,38 @@ that holds the current command value of the token, and an
@d set_text(A) do {
FUNCTION_TRACE3 ("set_text(%p, %p)\n",(A),(B));
(A)->text=(B) ;
-} while (0)
+} while (0)@;
@d set_eq_type(A,B) do {
FUNCTION_TRACE3 ("set_eq_type(%p, %d)\n",(A),(B));
(A)->type=(B) ;
-} while (0)
+} while (0)@;
@d set_equiv(A,B) do {
FUNCTION_TRACE3 ("set_equiv(%p, %d)\n",(A),(B));
(A)->v.data.node=NULL ;
(A)->v.data.indep.serial=(B);
-} while (0)
+} while (0)@;
@d set_equiv_node(A,B) do {
FUNCTION_TRACE3 ("set_equiv_node(%p, %p)\n",(A),(B));
(A)->v.data.node=(B) ;
(A)->v.data.indep.serial=0;
-} while (0)
+} while (0)@;
@d set_equiv_sym(A,B) do {
FUNCTION_TRACE3 ("set_equiv_sym(%p, %p)\n",(A),(B));
(A)->v.data.node=(mp_node)(B);
(A)->v.data.indep.serial=0;
-} while (0)
+} while (0)@;
@ @c
#if DEBUG
-#define text(A) do_get_text(mp, (A))
-#define eq_type(A) do_get_eq_type(mp, (A))
-#define equiv(A) do_get_equiv(mp, (A))
-#define equiv_node(A) do_get_equiv_node(mp, (A))
-#define equiv_sym(A) do_get_equiv_sym(mp, (A))
+#define text(A) @[do_get_text(mp, (A))@]
+#define eq_type(A) @[do_get_eq_type(mp, (A))@]
+#define equiv(A) @[do_get_equiv(mp, (A))@]
+#define equiv_node(A) @[do_get_equiv_node(mp, (A))@]
+#define equiv_sym(A) @[do_get_equiv_sym(mp, (A))@]
static mp_string do_get_text (MP mp, mp_sym A) {
FUNCTION_TRACE3 ("%d = do_get_text(%p)\n",A->text,A);
return A->text;
@@ -4686,11 +4700,11 @@ static mp_sym do_get_equiv_sym (MP mp, mp_sym A) {
return (mp_sym)A->v.data.node;
}
#else
-#define text(A) (A)->text
-#define eq_type(A) (A)->type
-#define equiv(A) (A)->v.data.indep.serial
-#define equiv_node(A) (A)->v.data.node
-#define equiv_sym(A) (mp_sym)(A)->v.data.node
+#define text(A) @[(A)->text@]
+#define eq_type(A) @[(A)->type@]
+#define equiv(A) @[(A)->v.data.indep.serial@]
+#define equiv_node(A) @[(A)->v.data.node@]
+#define equiv_sym(A) @[(mp_sym)(A)->v.data.node@]
#endif
@ @<Declarations...@>=
@@ -4710,7 +4724,7 @@ typedef struct mp_symbol_entry {
void *parent;
} mp_symbol_entry;
-@ @<Glob...@>=
+@ @s avl_tree int @<Glob...@>=
integer st_count; /* total number of known identifiers */
avl_tree symbols; /* avl tree of symbolic tokens */
avl_tree frozen_symbols; /* avl tree of frozen symbolic tokens */
@@ -4890,7 +4904,7 @@ static mp_sym mp_frozen_id_lookup (MP mp, char *j, size_t l,
return mp_do_id_lookup (mp, mp->frozen_symbols, j, l, insert_new);
}
-/* see mp\_print\_sym (mp\_sym sym) */
+/* see |mp_print_sym (mp_sym sym)| */
@ Get a numeric value from \MP\ is not easy. We have to consider
the macro and the loops, as also the internal type (this is a
first attempt, and more work is needed). If we are inside
@@ -5017,7 +5031,7 @@ static mp_sym mp_frozen_primitive (MP mp, const char *ss, halfword c,
@ This routine returns |true| if the argument is an un-redefinable symbol
because it is one of the error recovery tokens (as explained elsewhere,
-|frozen_inaccessible| actuall is redefinable).
+|frozen_inaccessible| actually is redefinable).
@c
static boolean mp_is_frozen (MP mp, mp_sym sym) {
@@ -5034,99 +5048,97 @@ as follows:
@<Put each of \MP's primitives into the hash table@>=
mp_primitive (mp, "..", mp_path_join, 0);
-@:.._}{\.{..} primitive@>;
+@:.._}{\.{..} primitive@>
mp_primitive (mp, "[", mp_left_bracket, 0);
mp->frozen_left_bracket = mp_frozen_primitive (mp, "[", mp_left_bracket, 0);
-@:[ }{\.{[} primitive@>;
+@:[ }{\.{[} primitive@>
mp_primitive (mp, "]", mp_right_bracket, 0);
-@:] }{\.{]} primitive@>;
+@:] }{\.{]} primitive@>
mp_primitive (mp, "}", mp_right_brace, 0);
-@:]]}{\.{\char`\}} primitive@>;
+@:]]}{\.{\char`\}} primitive@>
mp_primitive (mp, "{", mp_left_brace, 0);
-@:][}{\.{\char`\{} primitive@>;
+@:][}{\.{\char`\{} primitive@>
mp_primitive (mp, ":", mp_colon, 0);
mp->frozen_colon = mp_frozen_primitive (mp, ":", mp_colon, 0);
-@:: }{\.{:} primitive@>;
+@:: }{\.{:} primitive@>
mp_primitive (mp, "::", mp_double_colon, 0);
-@::: }{\.{::} primitive@>;
+@::: }{\.{::} primitive@>
mp_primitive (mp, "||:", mp_bchar_label, 0);
-@:::: }{\.{\char'174\char'174:} primitive@>;
+@:::: }{\.{\char'174\char'174:} primitive@>
mp_primitive (mp, ":=", mp_assignment, 0);
-@::=_}{\.{:=} primitive@>;
+@::=_}{\.{:=} primitive@>
mp_primitive (mp, ",", mp_comma, 0);
-@:, }{\., primitive@>;
+@:, }{\., primitive@>
mp_primitive (mp, ";", mp_semicolon, 0);
mp->frozen_semicolon = mp_frozen_primitive (mp, ";", mp_semicolon, 0);
-@:; }{\.; primitive@>;
+@:; }{\.; primitive@>
mp_primitive (mp, "\\", mp_relax, 0);
-@:]]\\}{\.{\char`\\} primitive@>;
+@:]]\\}{\.{\char`\\} primitive@>
mp_primitive (mp, "addto", mp_add_to_command, 0);
-@:add_to_}{\&{addto} primitive@>;
+@:add_to_}{\&{addto} primitive@>
mp_primitive (mp, "atleast", mp_at_least, 0);
-@:at_least_}{\&{atleast} primitive@>;
-mp_primitive (mp, "begingroup", mp_begin_group, 0);
+@:at_least_}{\&{atleast} primitive@>
+mp_primitive (mp, "begingroup", mp_begin_group, 0); @+
mp->bg_loc = cur_sym();
-@:begin_group_}{\&{begingroup} primitive@>;
+@:begin_group_}{\&{begingroup} primitive@>
mp_primitive (mp, "controls", mp_controls, 0);
-@:controls_}{\&{controls} primitive@>;
+@:controls_}{\&{controls} primitive@>
mp_primitive (mp, "curl", mp_curl_command, 0);
-@:curl_}{\&{curl} primitive@>;
+@:curl_}{\&{curl} primitive@>
mp_primitive (mp, "delimiters", mp_delimiters, 0);
-@:delimiters_}{\&{delimiters} primitive@>;
-mp_primitive (mp, "endgroup", mp_end_group, 0);
+@:delimiters_}{\&{delimiters} primitive@>
+mp_primitive (mp, "endgroup", mp_end_group, 0); @+
mp->eg_loc = cur_sym();
mp->frozen_end_group = mp_frozen_primitive (mp, "endgroup", mp_end_group, 0);
-@:endgroup_}{\&{endgroup} primitive@>;
+@:endgroup_}{\&{endgroup} primitive@>
mp_primitive (mp, "everyjob", mp_every_job_command, 0);
-@:every_job_}{\&{everyjob} primitive@>;
+@:every_job_}{\&{everyjob} primitive@>
mp_primitive (mp, "exitif", mp_exit_test, 0);
-@:exit_if_}{\&{exitif} primitive@>;
+@:exit_if_}{\&{exitif} primitive@>
mp_primitive (mp, "expandafter", mp_expand_after, 0);
-@:expand_after_}{\&{expandafter} primitive@>;
+@:expand_after_}{\&{expandafter} primitive@>
mp_primitive (mp, "interim", mp_interim_command, 0);
-@:interim_}{\&{interim} primitive@>;
+@:interim_}{\&{interim} primitive@>
mp_primitive (mp, "let", mp_let_command, 0);
-@:let_}{\&{let} primitive@>;
+@:let_}{\&{let} primitive@>
mp_primitive (mp, "newinternal", mp_new_internal, 0);
-@:new_internal_}{\&{newinternal} primitive@>;
+@:new_internal_}{\&{newinternal} primitive@>
mp_primitive (mp, "of", mp_of_token, 0);
-@:of_}{\&{of} primitive@>;
+@:of_}{\&{of} primitive@>
mp_primitive (mp, "randomseed", mp_random_seed, 0);
-@:mp_random_seed_}{\&{randomseed} primitive@>;
+@:mp_random_seed_}{\&{randomseed} primitive@>
mp_primitive (mp, "save", mp_save_command, 0);
-@:save_}{\&{save} primitive@>;
+@:save_}{\&{save} primitive@>
mp_primitive (mp, "scantokens", mp_scan_tokens, 0);
-@:scan_tokens_}{\&{scantokens} primitive@>;
-
+@:scan_tokens_}{\&{scantokens} primitive@>
mp_primitive (mp, "runscript", mp_runscript, 0);
-@:run_script_}{\&{runscript} primitive@>;
+@:run_script_}{\&{runscript} primitive@>
mp_primitive (mp, "maketext", mp_maketext, 0);
-@:make_text_}{\&{maketext} primitive@>;
-
+@:make_text_}{\&{maketext} primitive@>
mp_primitive (mp, "shipout", mp_ship_out_command, 0);
-@:ship_out_}{\&{shipout} primitive@>;
+@:ship_out_}{\&{shipout} primitive@>
mp_primitive (mp, "skipto", mp_skip_to, 0);
-@:skip_to_}{\&{skipto} primitive@>;
+@:skip_to_}{\&{skipto} primitive@>
mp_primitive (mp, "special", mp_special_command, 0);
-@:special}{\&{special} primitive@>;
+@:special}{\&{special} primitive@>
mp_primitive (mp, "fontmapfile", mp_special_command, 1);
-@:fontmapfile}{\&{fontmapfile} primitive@>;
+@:fontmapfile}{\&{fontmapfile} primitive@>
mp_primitive (mp, "fontmapline", mp_special_command, 2);
-@:fontmapline}{\&{fontmapline} primitive@>;
+@:fontmapline}{\&{fontmapline} primitive@>
mp_primitive (mp, "step", mp_step_token, 0);
-@:step_}{\&{step} primitive@>;
+@:step_}{\&{step} primitive@>
mp_primitive (mp, "str", mp_str_op, 0);
-@:str_}{\&{str} primitive@>;
+@:str_}{\&{str} primitive@>
mp_primitive (mp, "void", mp_void_op, 0);
-@:void_}{\&{void} primitive@>;
+@:void_}{\&{void} primitive@>
mp_primitive (mp, "tension", mp_tension, 0);
-@:tension_}{\&{tension} primitive@>;
+@:tension_}{\&{tension} primitive@>
mp_primitive (mp, "to", mp_to_token, 0);
-@:to_}{\&{to} primitive@>;
+@:to_}{\&{to} primitive@>
mp_primitive (mp, "until", mp_until_token, 0);
-@:until_}{\&{until} primitive@>;
+@:until_}{\&{until} primitive@>
mp_primitive (mp, "within", mp_within_token, 0);
-@:within_}{\&{within} primitive@>;
+@:within_}{\&{within} primitive@>
mp_primitive (mp, "write", mp_write_command, 0);
@:write_}{\&{write} primitive@>
@@ -5331,19 +5343,22 @@ typedef struct mp_node_data *mp_token_node;
@ @c
#if DEBUG
-#define value_sym(A) do_get_value_sym(mp,(mp_token_node)(A))
-/* |#define value_number(A) do_get_value_number(mp,(mp_token_node)(A))| */
-#define value_number(A) ((mp_token_node)(A))->data.n
-#define value_node(A) do_get_value_node(mp,(mp_token_node)(A))
-#define value_str(A) do_get_value_str(mp,(mp_token_node)(A))
-#define value_knot(A) do_get_value_knot(mp,(mp_token_node)(A))
+#define value_sym(A) @[do_get_value_sym(mp,(mp_token_node)(A))@]
+@[@]/*|
+#define value_number(A) @[do_get_value_number(mp,(mp_token_node)(A))@]
+| */
+#define value_number(A) @[((mp_token_node)(A))->data.n@]
+#define value_node(A) @[do_get_value_node(mp,(mp_token_node)(A))@]
+#define value_str(A) @[do_get_value_str(mp,(mp_token_node)(A))@]
+#define value_knot(A) @[do_get_value_knot(mp,(mp_token_node)(A))@]
#else
-#define value_sym(A) ((mp_token_node)(A))->data.sym
-#define value_number(A) ((mp_token_node)(A))->data.n
-#define value_node(A) ((mp_token_node)(A))->data.node
-#define value_str(A) ((mp_token_node)(A))->data.str
-#define value_knot(A) ((mp_token_node)(A))->data.p
+#define value_sym(A) @[((mp_token_node)(A))->data.sym@]
+#define value_number(A) @[((mp_token_node)(A))->data.n@]
+#define value_node(A) @[((mp_token_node)(A))->data.node@]
+#define value_str(A) @[((mp_token_node)(A))->data.str@]
+#define value_knot(A) @[((mp_token_node)(A))->data.p@]
#endif
+@/@t\2\2\4\4@>
static void do_set_value_sym(MP mp, mp_token_node A, mp_sym B) {
FUNCTION_TRACE3 ("set_value_sym(%p,%p)\n", (A),(B));
A->data.sym=(B);
@@ -5426,8 +5441,7 @@ static void do_set_value_node (MP mp, mp_token_node A, mp_node B);
static void do_set_value_str (MP mp, mp_token_node A, mp_string B);
static void do_set_value_knot (MP mp, mp_token_node A, mp_knot B);
-@
-@c
+@ @c
static mp_node mp_get_token_node (MP mp) {
mp_node p;
if (mp->token_nodes) {
@@ -5516,7 +5530,7 @@ static void mp_flush_token_list (MP mp, mp_node p) {
break;
default:
mp_confusion (mp, "token");
-@:this can't happen token}{\quad token@>;
+@:this can't happen token}{\quad token@>
}
mp_free_token_node (mp, q);
}
@@ -5730,7 +5744,7 @@ static void mp_show_macro (MP mp, mp_node p, mp_node q, integer l) {
else
return;
} /* control printing of `\.{ETC.}' */
-@.ETC@>;
+@.ETC@>
mp->tally = 0;
switch (mp_sym_info (p)) {
case mp_general_macro:
@@ -5822,7 +5836,7 @@ structure is not worth the minimal extra code clarification.
@<MPlib internal header stuff@>=
typedef struct mp_value_node_data {
- NODE_BODY;
+ NODE_BODY;@+@t}\6{@>
mp_value_data data;
mp_number subscript_;
mp_sym hashloc_;
@@ -6016,10 +6030,10 @@ information in their collective subscript attributes.
@c
#if DEBUG
-#define hashloc(A) do_get_hashloc(mp,(mp_value_node)(A))
-#define set_hashloc(A,B) do_set_hashloc (mp,(mp_value_node)A, B)
-#define parent(A) do_get_parent(mp, A)
-#define set_parent(A,B) do_set_parent (mp,(mp_value_node)A, B)
+#define hashloc(A) @[do_get_hashloc(mp,(mp_value_node)(A))@]
+#define set_hashloc(A,B) @[do_set_hashloc (mp,(mp_value_node)A, B)@]
+#define parent(A) @[do_get_parent(mp, A)@]
+#define set_parent(A,B) @[do_set_parent (mp,(mp_value_node)A, B)@]
static mp_sym do_get_hashloc (MP mp, mp_value_node A) {
assert((A)->type == mp_attr_node_type || (A)->name_type == mp_attr);
return (A)->hashloc_;
@@ -6039,17 +6053,16 @@ static void do_set_parent (MP mp, mp_value_node A, mp_node d) {
A->parent_ = d;
}
#else
-#define hashloc(A) ((mp_value_node)(A))->hashloc_
-#define set_hashloc(A,B) ((mp_value_node)(A))->hashloc_ = B
-#define parent(A) ((mp_value_node)(A))->parent_
-#define set_parent(A,B) ((mp_value_node)(A))->parent_ = B
+#define hashloc(A) @[((mp_value_node)(A))->hashloc_@]
+#define set_hashloc(A,B) @[((mp_value_node)(A))->hashloc_ = B@]
+#define parent(A) @[((mp_value_node)(A))->parent_@]
+#define set_parent(A,B) @[((mp_value_node)(A))->parent_ = B@]
#endif
-@
-@d mp_free_attr_node(a,b) do {
+@ @d mp_free_attr_node(a,b) do {
assert((b)->type == mp_attr_node_type || (b)->name_type == mp_attr);
mp_free_value_node(a,b);
-} while (0)
+} while (0)@;
@c
static mp_value_node mp_get_attr_node (MP mp) {
@@ -6074,8 +6087,7 @@ set_parent ((mp_value_node) mp->end_attr, NULL);
@ @<Free table...@>=
mp_free_attr_node (mp, mp->end_attr);
-@
-@d collective_subscript (void *)0 /* code for the attribute `\.{[]}' */
+@ @d collective_subscript (void *)0 /* code for the attribute `\.{[]}' */
@d subscript(A) ((mp_value_node)(A))->subscript_
@d set_subscript(A,B) do_set_subscript (mp, (mp_value_node)(A), B)
@@ -6086,8 +6098,7 @@ static void do_set_subscript (MP mp, mp_value_node A, mp_number B) {
number_clone(A->subscript_,B); /* subscript of this variable */
}
-@
-@c
+@ @c
static mp_value_node mp_get_subscr_node (MP mp) {
mp_value_node p = (mp_value_node) mp_get_value_node (mp);
mp_type (p) = mp_subscr_node_type;
@@ -6106,14 +6117,13 @@ to this four-word node.
@<MPlib internal header stuff@>=
typedef struct mp_pair_node_data {
- NODE_BODY;
+ NODE_BODY;@+@t}\6{@>
mp_node x_part_;
mp_node y_part_;
} mp_pair_node_data;
typedef struct mp_pair_node_data *mp_pair_node;
-@
-@d pair_node_size sizeof(struct mp_pair_node_data) /* the number of words in a subscript node */
+@ @d pair_node_size sizeof(struct mp_pair_node_data) /* the number of words in a subscript node */
@c
static mp_node mp_get_pair_node (MP mp) {
@@ -6170,8 +6180,7 @@ static void mp_init_pair_node (MP mp, mp_node p) {
}
-@
-Variables of type \&{transform} are similar, but in this case their
+@ Variables of type \&{transform} are similar, but in this case their
|value| points to a 12-word node containing six values, identified by
|x_part_sector|, |y_part_sector|, |mp_xx_part_sector|, |mp_xy_part_sector|,
|mp_yx_part_sector|, and |mp_yy_part_sector|.
@@ -6185,7 +6194,7 @@ Variables of type \&{transform} are similar, but in this case their
@<MPlib internal header stuff@>=
typedef struct mp_transform_node_data {
- NODE_BODY;
+ NODE_BODY;@+@t}\6{@>
mp_node tx_part_;
mp_node ty_part_;
mp_node xx_part_;
@@ -6195,8 +6204,7 @@ typedef struct mp_transform_node_data {
} mp_transform_node_data;
typedef struct mp_transform_node_data *mp_transform_node;
-@
-@d transform_node_size sizeof(struct mp_transform_node_data) /* the number of words in a subscript node */
+@ @d transform_node_size sizeof(struct mp_transform_node_data) /* the number of words in a subscript node */
@c
static mp_node mp_get_transform_node (MP mp) {
@@ -6239,8 +6247,7 @@ static void mp_init_transform_node (MP mp, mp_node p) {
}
-@
-Variables of type \&{color} have 3~values in 6~words identified by |mp_red_part_sector|,
+@ Variables of type \&{color} have 3~values in 6~words identified by |mp_red_part_sector|,
|mp_green_part_sector|, and |mp_blue_part_sector|.
@d red_part(A) ((mp_color_node)(A))->red_part_ /* where the \&{redpart} is found in a color node */
@@ -6251,15 +6258,14 @@ Variables of type \&{color} have 3~values in 6~words identified by |mp_red_part_
@<MPlib internal header stuff@>=
typedef struct mp_color_node_data {
- NODE_BODY;
+ NODE_BODY;@+@t}\6{@>
mp_node red_part_;
mp_node green_part_;
mp_node blue_part_;
} mp_color_node_data;
typedef struct mp_color_node_data *mp_color_node;
-@
-@d color_node_size sizeof(struct mp_color_node_data) /* the number of words in a subscript node */
+@ @d color_node_size sizeof(struct mp_color_node_data) /* the number of words in a subscript node */
@c
static mp_node mp_get_color_node (MP mp) {
@@ -6270,8 +6276,7 @@ static mp_node mp_get_color_node (MP mp) {
}
-@
-@c
+@ @c
static void mp_init_color_node (MP mp, mp_node p) {
mp_node q; /* the new node */
mp_type (p) = mp_color_type;
@@ -6301,7 +6306,7 @@ static void mp_init_color_node (MP mp, mp_node p) {
@<MPlib internal header stuff@>=
typedef struct mp_cmykcolor_node_data {
- NODE_BODY;
+ NODE_BODY;@+@t}\6{@>
mp_node cyan_part_;
mp_node magenta_part_;
mp_node yellow_part_;
@@ -6309,8 +6314,7 @@ typedef struct mp_cmykcolor_node_data {
} mp_cmykcolor_node_data;
typedef struct mp_cmykcolor_node_data *mp_cmykcolor_node;
-@
-@d cmykcolor_node_size sizeof(struct mp_cmykcolor_node_data) /* the number of words in a subscript node */
+@ @d cmykcolor_node_size sizeof(struct mp_cmykcolor_node_data) /* the number of words in a subscript node */
@c
static mp_node mp_get_cmykcolor_node (MP mp) {
@@ -6321,8 +6325,7 @@ static mp_node mp_get_cmykcolor_node (MP mp) {
}
-@
-@c
+@ @c
static void mp_init_cmykcolor_node (MP mp, mp_node p) {
mp_node q; /* the new node */
mp_type (p) = mp_cmykcolor_type;
@@ -6361,7 +6364,7 @@ static mp_node mp_id_transform (MP mp) {
mp_node p, q; /* list manipulation registers */
p = mp_get_value_node (mp);
mp_name_type (p) = mp_capsule;
- set_value_number (p, zero_t); /* todo: this was |null| */
+ set_value_number (p, zero_t); /* TODO: this was |NULL| */
mp_init_transform_node (mp, p);
q = value_node (p);
mp_type (tx_part (q)) = mp_known;
@@ -6423,8 +6426,8 @@ void mp_print_variable_name (MP mp, mp_node p) {
case mp_black_part_sector: mp_print (mp, "blackpart "); break;
case mp_grey_part_sector: mp_print (mp, "greypart "); break;
case mp_capsule: mp_printf (mp, "%%CAPSULE%p",p); return; break;
- /* this is to please the compiler: the remaining cases are operation codes */
- default: break;
+ default: /* this is to please the compiler: the remaining cases are operation codes */
+ break;
}
p = mp_link (p);
}
@@ -6627,7 +6630,7 @@ static mp_node mp_new_structure (MP mp, mp_node p) {
return r;
}
-@ The |find_variable| routine is given a pointer~|t| to a nonempty token
+@ The |mp_find_variable| routine is given a pointer~|t| to a nonempty token
list of suffixes; it returns a pointer to the corresponding non-symbolic
value. For example, if |t| points to token \.x followed by a numeric
token containing the value~7, |find_variable| finds where the value of
@@ -6646,7 +6649,7 @@ static mp_node mp_find_variable (MP mp, mp_node t) {
mp_node p, q, r, s; /* nodes in the ``value'' line */
mp_sym p_sym;
mp_node pp, qq, rr, ss; /* nodes in the ``collective'' line */
-@^inner loop@>;
+@^inner loop@>
p_sym = mp_sym_sym (t);
t = mp_link (t);
if ((eq_type (p_sym) % mp_outer_tag) != mp_tag_token)
@@ -7182,8 +7185,7 @@ typedef struct mp_knot_data {
} mp_knot_data;
-@
-@d mp_gr_next_knot(A) (A)->next /* the next knot in this list */
+@ @d mp_gr_next_knot(A) (A)->next /* the next knot in this list */
@<Exported types...@>=
typedef struct mp_gr_knot_data *mp_gr_knot;
@@ -7245,7 +7247,7 @@ The rules for |mp_left_type| are similar, but they refer to the curve entering
the knot, and to \\{left} fields instead of \\{right} fields.
Non-|explicit| control points will be chosen based on ``tension'' parameters
-in the |left_tension| and |right_tension| fields. The
+in the |left_tension|/|right_tension| fields. The
`\&{atleast}' option is represented by negative tension values.
@:at_least_}{\&{atleast} primitive@>
@@ -7276,6 +7278,8 @@ path syntax:
|mp_left_type| of the following node is |explicit|.
(iii)~|endpoint| types occur only at the ends, as mentioned above.
+@s explicit x @q Undefine C++ keyword @>
+
@d left_curl left_x /* curl information when entering this knot */
@d left_given left_x /* given direction when entering this knot */
@d left_tension left_y /* tension information when entering this knot */
@@ -7321,9 +7325,8 @@ void mp_pr_path (MP mp, mp_knot h) {
@<Print information for adjacent knots |p| and |q|@>;
DONE1:
p = q;
- if (p && ((p != h) || (mp_left_type (h) != mp_endpoint))) {
- @<Print two dots, followed by |given| or |curl| if present@>;
- }
+ if (p && ((p != h) || (mp_left_type (h) != mp_endpoint)))
+ @<Print two dots, followed by |given| or |curl| if present@>@;
} while (p != h);
if (mp_left_type (h) != mp_endpoint)
mp_print (mp, "cycle");
@@ -7336,7 +7339,7 @@ switch (mp_right_type (p)) {
case mp_endpoint:
if (mp_left_type (p) == mp_open)
mp_print (mp, "{open?}"); /* can't happen */
-@.open?@>;
+@.open?@>
if ((mp_left_type (q) != mp_endpoint) || (q != h))
q = NULL; /* force an error */
goto DONE1;
@@ -7353,15 +7356,14 @@ case mp_given:
break;
default:
mp_print (mp, "???"); /* can't happen */
-@.???@>;
+@.???@>
break;
}
if (mp_left_type (q) <= mp_explicit) {
mp_print (mp, "..control?"); /* can't happen */
@.control?@>
-} else if ((!number_equal(p->right_tension, unity_t)) || (!number_equal(q->left_tension, unity_t))) {
- @<Print tension between |p| and |q|@>;
-}
+} else if ((!number_equal(p->right_tension, unity_t)) || (!number_equal(q->left_tension, unity_t)))
+ @<Print tension between |p| and |q|@>@;
@ Since |n_sin_cos| produces |fraction| results, which we will print as if they
were |scaled|, the magnitude of a |given| direction vector will be~4096.
@@ -7439,7 +7441,7 @@ if ((mp_left_type (p) != mp_explicit) && (mp_left_type (p) != mp_open)) {
{
if (mp_left_type (p) == mp_open)
mp_print (mp, "??"); /* can't happen */
-@.??@>;
+@.??@>
if (mp_right_type (p) == mp_curl) {
mp_print (mp, "{curl ");
print_number (p->right_curl);
@@ -7469,7 +7471,7 @@ static void mp_print_path (MP mp, mp_knot h, const char *s, boolean nuline);
void mp_print_path (MP mp, mp_knot h, const char *s, boolean nuline) {
mp_print_diagnostic (mp, "Path", s, nuline);
mp_print_ln (mp);
-@.Path at line...@>;
+@.Path at line...@>
mp_pr_path (mp, h);
mp_end_diagnostic (mp, true);
}
@@ -7789,7 +7791,7 @@ void mp_make_choices (MP mp, mp_knot knots) {
mp_knot p, q; /* consecutive breakpoints being processed */
@<Other local variables for |make_choices|@>;
FUNCTION_TRACE1 ("make_choices()\n");
- check_arith(); /* make sure that |arith_error=false| */
+ check_arith(); /* make sure that |arith_error==false| */
if (number_positive(internal_value (mp_tracing_choices)))
mp_print_path (mp, knots, ", before choices", true);
@<If consecutive knots are equal, join them explicitly@>;
@@ -7802,9 +7804,8 @@ void mp_make_choices (MP mp, mp_knot knots) {
} while (p != h);
if (number_positive(internal_value (mp_tracing_choices)))
mp_print_path (mp, knots, ", after choices", true);
- if (mp->arith_error) {
- @<Report an unexpected problem during the choice-making@>;
- }
+ if (mp->arith_error)
+ @<Report an unexpected problem during the choice-making@>@;
}
@ @<Internal ...@>=
@@ -7817,7 +7818,7 @@ void mp_make_choices (MP mp, mp_knot knots);
"So it will probably look funny. Proceed, for a laugh.",
NULL };
mp_back_error (mp, "Some number got too big", hlp, true);
-@.Some number got too big@>;
+@.Some number got too big@>
mp_get_x_next (mp);
mp->arith_error = false;
}
@@ -7850,7 +7851,7 @@ do {
number_clone (q->left_y, p->y_coord);
}
p = q;
-} while (p != knots)
+} while (p != knots)@;
@ If there are no breakpoints, it is necessary to compute the direction
angles around an entire cycle. In this case the |mp_left_type| of the first
@@ -7881,9 +7882,8 @@ if (mp_right_type (p) >= mp_given) {
q = mp_next_knot (q);
}
@<Fill in the control information between consecutive breakpoints |p| and |q|@>;
-} else if (mp_right_type (p) == mp_endpoint) {
- @<Give reasonable values for the unused control points between |p| and~|q|@>;
-}
+} else if (mp_right_type (p) == mp_endpoint)
+ @<Give reasonable values for the unused control points between |p| and~|q|@>@;
p = q
@ This step makes it possible to transform an explicitly computed path without
@@ -8247,11 +8247,11 @@ void mp_solve_choices (MP mp, mp_knot p, mp_knot q, halfword n) {
r = 0;
while (1) {
t = mp_next_knot (s);
- if (k == 0) {
+ if (k == 0)
@<Get the linear equations started; or |return|
with the control points in place, if linear equations
- needn't be solved@>
- } else {
+ needn't be solved@>@;
+ else {
switch (mp_left_type (s)) {
case mp_end_cycle:
case mp_open:
@@ -8283,29 +8283,28 @@ FOUND:
defined. The first linear equation, if any, will have $A_0=B_0=0$.
@<Get the linear equations started...@>=
-switch (mp_right_type (s)) {
-case mp_given:
- if (mp_left_type (t) == mp_given) {
- @<Reduce to simple case of two givens and |return|@>
- } else {
- @<Set up the equation for a given value of $\theta_0$@>;
- }
- break;
-case mp_curl:
- if (mp_left_type (t) == mp_curl) {
- @<Reduce to simple case of straight line and |return|@>
- } else {
- @<Set up the equation for a curl at $\theta_0$@>;
- }
- break;
-case mp_open:
- set_number_to_zero(mp->uu[0]);
- set_number_to_zero(mp->vv[0]);
- number_clone(mp->ww[0], fraction_one_t);
- /* this begins a cycle */
- break;
-} /* there are no other cases */
-
+{
+ switch (mp_right_type (s)) {
+ case mp_given:
+ if (mp_left_type (t) == mp_given)
+ @<Reduce to simple case of two givens and |return|@>@;
+ else
+ @<Set up the equation for a given value of $\theta_0$@>@;
+ break;
+ case mp_curl:
+ if (mp_left_type (t) == mp_curl)
+ @<Reduce to simple case of straight line and |return|@>@;
+ else
+ @<Set up the equation for a curl at $\theta_0$@>@;
+ break;
+ case mp_open:
+ set_number_to_zero(mp->uu[0]);
+ set_number_to_zero(mp->vv[0]);
+ number_clone(mp->ww[0], fraction_one_t);
+ /* this begins a cycle */
+ break;
+ } /* there are no other cases */
+}
@ The general equation that specifies equality of mock curvature at $z_k$ is
$$A_k\theta_{k-1}+(B_k+C_k)\theta_k+D_k\theta\k=-B_k\psi_k-D_k\psi\k,$$
@@ -8323,7 +8322,7 @@ suitable precision.
The calculations will be performed in several registers that
provide temporary storage for intermediate quantities.
-@ @<Set up equation to match mock curvatures...@>=
+@<Set up equation to match mock curvatures...@>=
{
mp_number aa, bb, cc, acc; /* temporary registers */
mp_number dd, ee; /* likewise, but |scaled| */
@@ -8339,9 +8338,8 @@ provide temporary storage for intermediate quantities.
@<Calculate the ratio $\\{ff}=C_k/(C_k+B_k-u_{k-1}A_k)$@>;
take_fraction (mp->uu[k], ff, bb);
@<Calculate the values of $v_k$ and $w_k$@>;
- if (mp_left_type (s) == mp_end_cycle) {
- @<Adjust $\theta_n$ to equal $\theta_0$ and |goto found|@>;
- }
+ if (mp_left_type (s) == mp_end_cycle)
+ @<Adjust $\theta_n$ to equal $\theta_0$ and |goto found|@>@;
free_number(aa);
free_number(bb);
free_number(cc);
@@ -8524,7 +8522,7 @@ so we can solve for $\theta_n=\theta_0$.
new_number (arg2);
new_number (r1);
set_number_to_zero (aa);
- number_clone (bb, fraction_one_t); /* we have |k=n| */
+ number_clone (bb, fraction_one_t); /* we have |k==n| */
do {
decr (k);
if (k == 0)
@@ -8832,10 +8830,9 @@ void mp_set_controls (MP mp, mp_knot p, mp_knot q, integer k) {
new_fraction (ss);
velocity (rr, mp->st, mp->ct, mp->sf, mp->cf, rt);
velocity (ss, mp->sf, mp->cf, mp->st, mp->ct, lt);
- if (number_negative(p->right_tension) || number_negative(q->left_tension)) {
+ if (number_negative(p->right_tension) || number_negative(q->left_tension))
@<Decrease the velocities,
- if necessary, to stay inside the bounding triangle@>;
- }
+ if necessary, to stay inside the bounding triangle@>@;
take_fraction (r1, mp->delta_x [k], mp->ct);
take_fraction (r2, mp->delta_y [k], mp->st);
number_substract (r1, r2);
@@ -9042,7 +9039,6 @@ static int out_of_range(MP mp, double a)
return 0;
}
-static int mp_link_knotpair (MP mp, mp_knot p, mp_knot q);
static int mp_link_knotpair (MP mp, mp_knot p, mp_knot q)
{
if (p==NULL ||q==NULL) return 0;
@@ -9236,9 +9232,7 @@ int mp_set_knotpair_directions (MP mp, mp_knot p, mp_knot q, double x1, double y
return 0;
}
-@
-@c
-static int path_needs_fixing (mp_knot source);
+@ @c
static int path_needs_fixing (mp_knot source) {
mp_knot sourcehead = source;
do {
@@ -9478,9 +9472,8 @@ static void mp_bound_cubic (MP mp, mp_knot p, mp_knot q, quarterword c) {
number_negate (del3);
}
crossing_point (t, del1, del2, del3);
- if (number_less(t, fraction_one_t)) {
- @<Test the extremes of the cubic against the bounding box@>;
- }
+ if (number_less(t, fraction_one_t))
+ @<Test the extremes of the cubic against the bounding box@>@;
}
free_number (del3);
free_number (del2);
@@ -9577,9 +9570,8 @@ must cut it to zero to avoid confusion.
free_number (arg2);
free_number (arg3);
}
- if (number_less(tt, fraction_one_t)) {
- @<Test the second extreme against the bounding box@>;
- }
+ if (number_less(tt, fraction_one_t))
+ @<Test the second extreme against the bounding box@>@;
}
@@ -9725,13 +9717,11 @@ static void mp_arc_test (MP mp, mp_number *ret, mp_number dx0, mp_number dy0, mp
if (simple && number_lessequal(simply, tol)) {
if (number_less(arc, a_goal)){
number_clone(*ret, arc);
- } else {
+ } else
@<Estimate when the arc length reaches |a_goal| and set |arc_test| to
- that time minus |two|@>;
- }
- } else {
- @<Use one or two recursive calls to compute the |arc_test| function@>;
- }
+ that time minus |two|@>@;
+ } else
+ @<Use one or two recursive calls to compute the |arc_test| function@>@;
DONE:
free_number (arc);
free_number (arc1);
@@ -9777,11 +9767,11 @@ calls, but $1.5$ is an adequate approximation. It is best to avoid using
mp_arc_test (mp, &a, dx0, dy0, dx01, dy01, dx02, dy02,
v0, v002, half_v02, a_new, tol);
if (number_negative(a)) {
- set_number_to_unity(*ret);
- number_double(*ret); /* two */
- number_substract(*ret, a); /* two - a */
+ set_number_to_unity(*ret); /* |1| */
+ number_double(*ret); /* |2| */
+ number_substract(*ret, a); /* |2 - a| */
number_halfp(*ret);
- number_negate(*ret); /* -halfp(two - a) */
+ number_negate(*ret); /* |-halfp(2 - a)| */
} else {
@<Update |a_new| to reduce |a_new+a_aux| by |a|@>;
new_number (b);
@@ -9797,12 +9787,12 @@ calls, but $1.5$ is an adequate approximation. It is best to avoid using
number_clone(*ret, tmp);
set_number_to_unity(tmp);
number_halfp(tmp);
- number_substract(*ret, tmp); /* (-(halfp(-b)) - 1/2) */
+ number_substract(*ret, tmp); /* |-(halfp(-b)) - 1/2| */
free_number (tmp);
} else {
set_number_from_substraction(*ret, b, a);
number_half(*ret);
- set_number_from_addition(*ret, a, *ret); /* (a + half(b - a)) */
+ set_number_from_addition(*ret, a, *ret); /* |a + half(b - a)| */
}
free_number (b);
}
@@ -9898,8 +9888,7 @@ number_half(dy02);
number_half (arc);
set_number_from_addition(arc, v022, arc);
- /* reuse |tmp| for the next |if| test: */
- set_number_to_inf(tmp);
+ set_number_to_inf(tmp); /* reuse |tmp| for the next |if| test */
number_substract(tmp,arc1);
if (number_less(arc, tmp)) {
free_number (tmp);
@@ -9912,7 +9901,7 @@ number_half(dy02);
} else {
set_number_to_unity(*ret);
number_double(*ret);
- number_negate(*ret); /* -two */
+ number_negate(*ret); /* |-2| */
}
goto DONE;
}
@@ -10002,7 +9991,7 @@ $\tau$ given $a$, $b$, $c$, and $x$.
number_clone(tmp, v02);
number_add_scaled(tmp, 2);
number_half(tmp);
- number_half(tmp); /* (v02+2) / 4 */
+ number_half(tmp); /* |(v02+2) / 4| */
if (number_lessequal(a_goal, arc1)) {
number_clone(tmp2, v0);
number_halfp(tmp2);
@@ -10060,7 +10049,7 @@ void mp_solve_rising_cubic (MP mp, mp_number *ret, mp_number a_orig, mp_number b
mp_number neg_x; /* temporary for an |if| */
if (number_negative(a_orig) || number_negative(c_orig))
mp_confusion (mp, "rising?");
-@:this can't happen rising?}{\quad rising?@>;
+@:this can't happen rising?}{\quad rising?@>
new_number (t);
new_number (abc);
new_number (a);
@@ -10290,11 +10279,10 @@ static void mp_get_arc_time (MP mp, mp_number *ret, mp_knot h, mp_number arc0_or
set_number_from_substraction(arg6, q->y_coord, q->left_y);
mp_do_arc_test (mp, &t, arg1, arg2, arg3, arg4, arg5, arg6, arc);
@<Update |arc| and |t_tot| after |do_arc_test| has just returned |t|@>;
- if (q == h) {
+ if (q == h)
@<Update |t_tot| and |arc| to avoid going around the cyclic
- path too many times but set |arith_error:=true| and |goto done| on
- overflow@>;
- }
+ path too many times but set |arith_error=true| and |goto done| on
+ overflow@>@;
p = q;
}
check_arith();
@@ -10352,15 +10340,21 @@ if (number_positive(arc)) {
new_number (d1);
new_number (v1);
- set_number_from_substraction (d1, arc0, arc); /* d1 = arc0 - arc */
- set_number_from_div (n1, arc, d1); /* n1 = (arc / d1) */
+ set_number_from_substraction (d1, arc0, arc); /* |d1 = arc0 - arc| */
+ if (number_greater (d1,arc)) {
+ set_number_to_zero(n1); /* |n1 = 0| */
+ } else {
+ set_number_from_div (n1, arc, d1); /* |n1 = (arc / d1)| */
+ floor_scaled(n1);
+ }
number_clone (n, n1);
- set_number_from_mul (n1, n1, d1); /* n1 = (n1 * d1) */
- number_substract (arc, n1); /* arc = arc - n1 */
+ set_number_from_mul (n1, n1, d1); /* |n1 = (n1 * d1)| */
+ number_substract (arc, n1); /* |arc = arc - n1| */
- number_clone (d1, inf_t); /* reuse d1 */
- number_clone (v1, n); /* v1 = n */
- number_add (v1, epsilon_t); /* v1 = n1+1 */
+ number_clone (d1, inf_t); /* reuse |d1| */
+ number_clone (v1, n); /* |v1 = n| */
+
+ set_number_from_int(v1, number_to_int(v1)+1); /* |v1 = n1+1| */
set_number_from_div (d1, d1, v1); /* |d1 = EL_GORDO / v1| */
if (number_greater (t_tot, d1)) {
mp->arith_error = true;
@@ -10474,9 +10468,9 @@ static void mp_pr_pen (MP mp, mp_knot h);
@ @c
void mp_pr_pen (MP mp, mp_knot h) {
mp_knot p, q; /* for list traversal */
- if (pen_is_elliptical (h)) {
- @<Print the elliptical pen |h|@>;
- } else {
+ if (pen_is_elliptical (h))
+ @<Print the elliptical pen |h|@>@;
+ else {
p = h;
do {
mp_print_two (mp, p->x_coord, p->y_coord);
@@ -10533,7 +10527,7 @@ static void mp_print_pen (MP mp, mp_knot h, const char *s, boolean nuline);
void mp_print_pen (MP mp, mp_knot h, const char *s, boolean nuline) {
mp_print_diagnostic (mp, "Pen", s, nuline);
mp_print_ln (mp);
-@.Pen at line...@>;
+@.Pen at line...@>
mp_pr_pen (mp, h);
mp_end_diagnostic (mp, true);
}
@@ -10557,18 +10551,18 @@ static void mp_make_path (MP mp, mp_knot h) {
do {
mp_left_type (p) = mp_explicit;
mp_right_type (p) = mp_explicit;
- @<copy the coordinates of knot |p| into its control points@>;
+ @<Copy the coordinates of knot |p| into its control points@>;
p = mp_next_knot (p);
} while (p != h);
}
}
-@ @<copy the coordinates of knot |p| into its control points@>=
+@ @<Copy the coordinates of knot |p| into its control points@>=
number_clone (p->left_x, p->x_coord);
number_clone (p->left_y, p->y_coord);
number_clone (p->right_x, p->x_coord);
-number_clone (p->right_y, p->y_coord)
+number_clone (p->right_y, p->y_coord)@;
@ We need an eight knot path to get a good approximation to an ellipse.
@@ -10658,7 +10652,7 @@ kk = (k + 6) % 8;
}
mp_left_type (p) = mp_explicit;
mp_right_type (p) = mp_explicit;
-mp_originator (p) = mp_program_code
+mp_originator (p) = mp_program_code@;
@ @<Glob...@>=
mp_number half_cos[8]; /* ${1\over2}\cos(45k)$ */
@@ -10732,9 +10726,8 @@ mp_knot mp_convex_hull (MP mp, mp_knot h) { /* Mak
@<Sort the path from |l| to |r| by increasing $x$@>;
@<Sort the path from |r| to |l| by decreasing $x$@>;
}
- if (l != mp_next_knot (l)) {
- @<Do a Gramm scan and remove vertices where there is no left turn@>;
- }
+ if (l != mp_next_knot (l))
+ @<Do a Gramm scan and remove vertices where there is no left turn@>@;
ret = l;
}
free_number (dx);
@@ -10794,10 +10787,10 @@ while (p != h) {
}
-@ The |move_knot| procedure removes |p| from a doubly linked list and inserts
+@ The |mp_move_knot| procedure removes |p| from a doubly linked list and inserts
it after |q|.
-@ @<Declarations@>=
+@<Declarations@>=
static void mp_move_knot (MP mp, mp_knot p, mp_knot q);
@ @c
@@ -10905,9 +10898,8 @@ where the |then| clause is not executed.
set_number_from_substraction (arg1, q->y_coord, p->y_coord);
set_number_from_substraction (arg2, q->x_coord, p->x_coord);
ab_vs_cd (ab_vs_cd, dx, arg1, dy, arg2);
- if (number_nonpositive(ab_vs_cd)) {
- @<Remove knot |p| and back up |p| and |q| but don't go past |l|@>;
- }
+ if (number_nonpositive(ab_vs_cd))
+ @<Remove knot |p| and back up |p| and |q| but don't go past |l|@>@;
}
}
free_number (ab_vs_cd);
@@ -11100,9 +11092,9 @@ is stored in the global variables |minx|, |maxx|, |miny|, and |maxy|.
@c
static void mp_pen_bbox (MP mp, mp_knot h) {
mp_knot p; /* for scanning the knot list */
- if (pen_is_elliptical (h)) {
- @<Find the bounding box of an elliptical pen@>;
- } else {
+ if (pen_is_elliptical (h))
+ @<Find the bounding box of an elliptical pen@>@;
+ else {
number_clone (mp_minx, h->x_coord);
number_clone (mp_maxx, mp_minx);
number_clone (mp_miny, h->y_coord);
@@ -11149,13 +11141,16 @@ static void mp_pen_bbox (MP mp, mp_knot h) {
This first set goes into the header
+@s mp_fraction mp_number
+@s mp_angle mp_number
+
@<MPlib internal header stuff@>=
#define mp_fraction mp_number
#define mp_angle mp_number
-#define new_number(A) (((math_data *)(mp->math))->allocate)(mp, &(A), mp_scaled_type)
-#define new_fraction(A) (((math_data *)(mp->math))->allocate)(mp, &(A), mp_fraction_type)
-#define new_angle(A) (((math_data *)(mp->math))->allocate)(mp, &(A), mp_angle_type)
-#define free_number(A) (((math_data *)(mp->math))->free)(mp, &(A))
+#define new_number(A) @[(((math_data *)(mp->math))->allocate)(mp, &(A), mp_scaled_type)@]
+#define new_fraction(A) @[(((math_data *)(mp->math))->allocate)(mp, &(A), mp_fraction_type)@]
+#define new_angle(A) @[(((math_data *)(mp->math))->allocate)(mp, &(A), mp_angle_type)@]
+#define free_number(A) @[(((math_data *)(mp->math))->free)(mp, &(A))@]
@
@d set_precision() (((math_data *)(mp->math))->set_precision)(mp)
@@ -11177,7 +11172,7 @@ This first set goes into the header
@d set_number_to_unity(A) (((math_data *)(mp->math))->clone)(&(A), unity_t)
@d set_number_to_zero(A) (((math_data *)(mp->math))->clone)(&(A), zero_t)
@d set_number_to_inf(A) (((math_data *)(mp->math))->clone)(&(A), inf_t)
-@d set_number_to_neg_inf(A) do { set_number_to_inf(A); number_negate (A); } while (0)
+@d set_number_to_neg_inf(A) do { set_number_to_inf(A); number_negate (A); } while (0)@;
@#
@d init_randoms(A) (((math_data *)(mp->math))->init_randoms)(mp,A)
@d print_number(A) (((math_data *)(mp->math))->print)(mp,A)
@@ -11260,7 +11255,7 @@ let the second one overwrite it if necessary.
@<MPlib header stuff@>=
enum mp_graphical_object_code {
- @<Graphical object codes@>
+ @<Graphical object codes@>@;
mp_final_graphic
};
@@ -11283,7 +11278,7 @@ give the relevant information.
@<MPlib internal header stuff@>=
typedef struct mp_fill_node_data {
- NODE_BODY;
+ NODE_BODY;@+@t}\6{@>
halfword color_model_;
mp_number red;
mp_number green;
@@ -11299,7 +11294,7 @@ typedef struct mp_fill_node_data {
typedef struct mp_fill_node_data *mp_fill_node;
@ @<Graphical object codes@>=
-mp_fill_code = 1,
+mp_fill_code = 1,@[@]@;
@ Make a fill node for cyclic path |p| and color black.
@@ -11364,7 +11359,7 @@ be transformed without touching the picture that |dash_p| points to.
@<MPlib internal header stuff@>=
typedef struct mp_stroked_node_data {
- NODE_BODY;
+ NODE_BODY;@+@t}\6{@>
halfword color_model_;
mp_number red;
mp_number green;
@@ -11384,7 +11379,7 @@ typedef struct mp_stroked_node_data *mp_stroked_node;
@ @<Graphical object codes@>=
-mp_stroked_code = 2,
+mp_stroked_code = 2,@[@]@;
@ Make a stroked node for path |p| with |mp_pen_p(p)| temporarily |NULL|.
@@ -11428,7 +11423,7 @@ static mp_node mp_new_stroked_node (MP mp, mp_knot p) {
return (mp_node) t;
}
-@ @c
+@ @s mp_edge_header_node int @c
static mp_edge_header_node mp_free_stroked_node (MP mp, mp_stroked_node p) {
mp_edge_header_node e = NULL;
mp_toss_knot_list (mp, mp_path_p (p));
@@ -11452,16 +11447,16 @@ static mp_edge_header_node mp_free_stroked_node (MP mp, mp_stroked_node p) {
@ When a dashed line is computed in a transformed coordinate system, the dash
lengths get scaled like the pen shape and we need to compensate for this. Since
there is no unique scale factor for an arbitrary transformation, we use the
-the square root of the determinant. The properties of the determinant make it
+square root of the determinant. The properties of the determinant make it
easier to maintain the |dash_scale|. The computation is fairly straight-forward
except for the initialization of the scale factor |s|. The factor of 64 is
needed because |square_rt| scales its result by $2^8$ while we need $2^{14}$
to counteract the effect of |take_fraction|.
-@ @c
+@c
void mp_sqrt_det (MP mp, mp_number *ret, mp_number a_orig, mp_number b_orig, mp_number c_orig, mp_number d_orig) {
mp_number a,b,c,d;
- mp_number maxabs; /* $max(|a|,|b|,|c|,|d|)$ */
+ mp_number maxabs; /* |max(a,b,c,d)| */
unsigned s; /* amount by which the result of |square_rt| needs to be scaled */
new_number(a);
new_number(b);
@@ -11564,7 +11559,7 @@ black with its reference point at the origin.
@<MPlib internal header stuff@>=
typedef struct mp_text_node_data {
- NODE_BODY;
+ NODE_BODY;@+@t}\6{@>
halfword color_model_;
mp_number red;
mp_number green;
@@ -11587,7 +11582,7 @@ typedef struct mp_text_node_data {
typedef struct mp_text_node_data *mp_text_node;
@ @<Graphical object codes@>=
-mp_text_code = 3,
+mp_text_code = 3,@[@]@;
@ Make a text node for font |f| and text string |s|.
@@ -11665,12 +11660,12 @@ of objects to clip or bound followed by a closing node.
@<MPlib internal header stuff@>=
typedef struct mp_start_clip_node_data {
- NODE_BODY;
+ NODE_BODY;@+@t}\6{@>
mp_knot path_p_;
} mp_start_clip_node_data;
typedef struct mp_start_clip_node_data *mp_start_clip_node;
typedef struct mp_start_bounds_node_data {
- NODE_BODY;
+ NODE_BODY;@+@t}\6{@>
mp_knot path_p_;
} mp_start_bounds_node_data;
typedef struct mp_start_bounds_node_data *mp_start_bounds_node;
@@ -11688,11 +11683,10 @@ typedef struct mp_stop_bounds_node_data *mp_stop_bounds_node;
mp_start_clip_code = 4, /* |type| of a node that starts clipping */
mp_start_bounds_code = 5, /* |type| of a node that gives a \&{setbounds} path */
mp_stop_clip_code = 6, /* |type| of a node that stops clipping */
- mp_stop_bounds_code = 7, /* |type| of a node that stops \&{setbounds} */
+ mp_stop_bounds_code = 7,@[@]@; /* |type| of a node that stops \&{setbounds} */
@
-
@d start_clip_size sizeof(struct mp_start_clip_node_data)
@d stop_clip_size sizeof(struct mp_stop_clip_node_data)
@d start_bounds_size sizeof(struct mp_start_bounds_node_data)
@@ -11774,7 +11768,7 @@ The |dash_info| is explained below.
@<MPlib internal header stuff@>=
typedef struct mp_dash_node_data {
- NODE_BODY;
+ NODE_BODY;@+@t}\6{@>
mp_number start_x; /* the starting $x$~coordinate in a dash node */
mp_number stop_x; /* the ending $x$~coordinate in a dash node */
mp_number dash_y; /* $y$ value for the dash list in an edge header */
@@ -11790,8 +11784,7 @@ mp->null_dash = mp_get_dash_node (mp);
@ @<Free table entries@>=
mp_free_node (mp, (mp_node)mp->null_dash, dash_node_size);
-@
-@d dash_node_size sizeof(struct mp_dash_node_data)
+@ @d dash_node_size sizeof(struct mp_dash_node_data)
@c
static mp_dash_node mp_get_dash_node (MP mp) {
@@ -11830,7 +11823,7 @@ field is needed to keep track of this.
@<MPlib internal header stuff@>=
typedef struct mp_edge_header_node_data {
- NODE_BODY;
+ NODE_BODY;@+@t}\6{@>
mp_number start_x;
mp_number stop_x;
mp_number dash_y;
@@ -11887,7 +11880,7 @@ static mp_edge_header_node mp_get_edge_header_node (MP mp) {
return p;
}
static void mp_init_edges (MP mp, mp_edge_header_node h) {
- /* initialize an edge header to NULL values */
+ /* initialize an edge header to \.{NULL} values */
set_dash_list (h, mp->null_dash);
obj_tail (h) = edge_list (h);
mp_link (edge_list (h)) = NULL;
@@ -11939,7 +11932,7 @@ void mp_toss_edges (MP mp, mp_edge_header_node h) {
void mp_flush_dash_list (MP mp, mp_edge_header_node h) {
mp_dash_node p, q; /* pointers that scan the list being recycled */
q = dash_list (h);
- while (q != mp->null_dash) { /* todo: NULL check should not be needed */
+ while (q != mp->null_dash) { /* TODO: |NULL| check should not be needed */
p = q;
q = (mp_dash_node)mp_link (q);
mp_free_node (mp, (mp_node)p, dash_node_size);
@@ -12016,11 +12009,13 @@ while ((p != mp->null_dash)) {
p = (mp_dash_node)mp_link (p);
}
mp_link (pp) = (mp_node)mp->null_dash;
-number_clone(hh->dash_y, h->dash_y )
+number_clone(hh->dash_y, h->dash_y )@;
@ |h| is an edge structure
+@s mp_dash_object int
+
@c
static mp_dash_object *mp_export_dashes (MP mp, mp_stroked_node q, mp_number w) {
mp_dash_object *d;
@@ -12094,7 +12089,7 @@ pp = (mp_dash_node)edge_list (hh);
while ((p != (mp_dash_node)bblast (h))) {
if (p == NULL)
mp_confusion (mp, "bblast");
-@:this can't happen bblast}{\quad bblast@>;
+@:this can't happen bblast}{\quad bblast@>
p = (mp_dash_node)mp_link (p);
pp = (mp_dash_node)mp_link (pp);
}
@@ -12117,9 +12112,9 @@ mp_edge_header_node mp_copy_objects (MP mp, mp_node p, mp_node q) {
set_dash_list (hh, mp->null_dash);
edge_ref_count (hh) = 0;
pp = edge_list (hh);
- while (p != q) {
- @<Make |mp_link(pp)| point to a copy of object |p|, and update |p| and |pp|@>;
- }
+ while (p != q)
+ @<Make |mp_link(pp)| point to a copy of object |p|,
+ and update |p| and |pp|@>@;
obj_tail (hh) = pp;
mp_link (pp) = NULL;
return hh;
@@ -12299,7 +12294,7 @@ void mp_print_edges (MP mp, mp_node h, const char *s, boolean nuline) {
mp_print_nl (mp, "End edges");
if (p != obj_tail (h))
mp_print (mp, "?");
-@.End edges?@>;
+@.End edges?@>
mp_end_diagnostic (mp, true);
free_number (scf);
}
@@ -12335,7 +12330,7 @@ case 2:
break;
default:
mp_print (mp, "?? joins");
-@.??@>;
+@.??@>
break;
}
@@ -12359,7 +12354,7 @@ default:
@.??@>
}
mp_print (mp, " ends, ");
-@<Print join type for graphical object |p|@>
+@<Print join type for graphical object |p|@>@;
@ Here is a routine that prints the color of a graphical object if it isn't
@@ -12377,7 +12372,7 @@ void mp_print_obj_color (MP mp, mp_node p) {
mp_print_char (mp, xord ('('));
print_number (p0->grey);
mp_print_char (mp, xord (')'));
- };
+ }
} else if (mp_color_model (p) == mp_cmyk_model) {
if (number_positive(p0->cyan) || number_positive(p0->magenta) ||
number_positive(p0->yellow) || number_positive(p0->black)) {
@@ -12391,7 +12386,7 @@ void mp_print_obj_color (MP mp, mp_node p) {
mp_print_char (mp, xord (','));
print_number (p0->black);
mp_print_char (mp, xord (')'));
- };
+ }
} else if (mp_color_model (p) == mp_rgb_model) {
if (number_positive(p0->red) || number_positive(p0->green) ||
number_positive(p0->blue)) {
@@ -12403,7 +12398,7 @@ void mp_print_obj_color (MP mp, mp_node p) {
mp_print_char (mp, xord (','));
print_number (p0->blue);
mp_print_char (mp, xord (')'));
- };
+ }
}
}
@@ -12489,7 +12484,7 @@ static void mp_dash_offset (MP mp, mp_number *x, mp_dash_node h);
void mp_dash_offset (MP mp, mp_number *x, mp_dash_node h) {
if (dash_list (h) == mp->null_dash || number_negative(h->dash_y ))
mp_confusion (mp, "dash0");
-@:this can't happen dash0}{\quad dash0@>;
+@:this can't happen dash0}{\quad dash0@>
if (number_zero(h->dash_y)) {
set_number_to_zero(*x);
} else {
@@ -12575,7 +12570,7 @@ static mp_edge_header_node mp_make_dashes (MP mp, mp_edge_header_node h) { /* re
p = mp_link (edge_list (h));
while (p != NULL) {
if (mp_type (p) != mp_stroked_node_type) {
- @<Compain that the edge structure contains a node of the wrong type
+ @<Complain that the edge structure contains a node of the wrong type
and |goto not_found|@>;
}
pp = mp_path_p ((mp_stroked_node) p);
@@ -12600,7 +12595,7 @@ NOT_FOUND:
}
-@ @<Compain that the edge structure contains a node of the wrong type...@>=
+@ @<Complain that the edge structure contains a node of the wrong type...@>=
{
const char *hlp[] = {
"When you say `dashed p', picture p should not contain any",
@@ -12746,10 +12741,10 @@ if (dd != (mp_dash_node)h) {
if (number_greater(dd->stop_x, d->start_x)) {
mp_x_retrace_error (mp);
goto NOT_FOUND;
- };
+ }
}
mp_link (d) = mp_link (dd);
-mp_link (dd) = (mp_node)d
+mp_link (dd) = (mp_node)d@;
@ @<Set |dash_y(h)| and merge the first and last dashes if necessary@>=
d = dash_list (h);
@@ -12779,7 +12774,7 @@ since it is not being used for the return value.
@<Flush the dash list, recycle |h| and return |NULL|@>=
mp_flush_dash_list (mp, h);
delete_edge_ref (h);
-return NULL
+return NULL@;
@ Having carefully saved the dashed stroked nodes in the
corresponding dash nodes, we must be prepared to break up these dashes into
@@ -12799,14 +12794,15 @@ while (mp_link (d) != (mp_node)mp->null_dash) {
number_clone(hsf, ((mp_stroked_node)ds)->dash_scale);
if (hh == NULL)
mp_confusion (mp, "dash1");
-@:this can't happen dash0}{\quad dash1@>;
- /* clang: dereference null pointer 'hh' */ assert(hh);
+@:this can't happen dash0}{\quad dash1@>
+ assert(hh);
+ /* clang: dereference null pointer 'hh' */
if (number_zero(((mp_dash_node)hh)->dash_y )) {
d = (mp_dash_node)mp_link (d);
} else {
if (dash_list (hh) == NULL)
mp_confusion (mp, "dash1");
-@:this can't happen dash0}{\quad dash1@>;
+@:this can't happen dash0}{\quad dash1@>
@<Replace |mp_link(d)| by a dashed version as determined by edge header
|hh| and scale factor |ds|@>;
}
@@ -12905,16 +12901,14 @@ if (dd == mp->null_dash) {
number_add (r1, xoff);
if (number_greater(dln->start_x, r1))
number_clone(d->start_x, dln->start_x);
- else {
+ else
number_clone(d->start_x, r1);
- }
take_scaled (r1, hsf, dd->stop_x);
number_add (r1, xoff);
if (number_less(dln->stop_x, r1))
number_clone(d->stop_x, dln->stop_x );
- else {
+ else
number_clone(d->stop_x, r1);
- }
}
free_number (r1);
}
@@ -12973,9 +12967,8 @@ static void mp_box_ends (MP mp, mp_knot p, mp_knot pp, mp_edge_header_node h) {
}
if (mp_right_type (p) == mp_endpoint) {
goto DONE;
- } else {
- @<Advance |p| to the end of the path and make |q| the previous knot@>;
- }
+ } else
+ @<Advance |p| to the end of the path and make |q| the previous knot@>@;
}
}
DONE:
@@ -13040,7 +13033,7 @@ set_number_from_substraction(dy, p->y_coord, q->y_coord);
set_number_from_addition(d, r1, r2);
if ((number_negative(d) && (i == 1)) || (number_positive(d) && (i == 2)))
mp_confusion (mp, "box_ends");
-@:this can't happen box ends}{\quad\\{box\_ends}@>;
+@:this can't happen box ends}{\quad\\{box\_ends}@>
take_fraction (r1, d, dx);
set_number_from_addition(z, p->x_coord, mp->cur_x);
number_add (z, r1);
@@ -13064,7 +13057,7 @@ set_number_from_substraction(dy, p->y_coord, q->y_coord);
do {
q = p;
p = mp_next_knot (p);
-} while (mp_right_type (p) != mp_endpoint)
+} while (mp_right_type (p) != mp_endpoint);
@ The major difficulty in finding the bounding box of an edge structure is the
effect of clipping paths. We treat them conservatively by only clipping to the
@@ -13102,9 +13095,9 @@ void mp_set_bbox (MP mp, mp_edge_header_node h, boolean top_level) {
mp_confusion (mp, "bbox");
else
return;
-@:this can't happen bbox}{\quad bbox@>;
+@:this can't happen bbox}{\quad bbox@>
break;
- @<Other cases for updating the bounding box based on the type of object |p|@>;
+ @t\4@>@<Other cases for updating the bounding box based on the type of object |p|@>@;
default: /* there are no other valid cases, but please the compiler */
break;
}
@@ -13159,7 +13152,7 @@ case mp_start_bounds_node_type:
case mp_stop_bounds_node_type:
if (number_nonpositive (internal_value (mp_true_corners)))
mp_confusion (mp, "bbox2");
-@:this can't happen bbox2}{\quad bbox2@>;
+@:this can't happen bbox2}{\quad bbox2@>
break;
@ @<Scan to the matching |mp_stop_bounds_node| node and update |p| and...@>=
@@ -13167,7 +13160,7 @@ lev = 1;
while (lev != 0) {
if (mp_link (p) == NULL)
mp_confusion (mp, "bbox2");
-@:this can't happen bbox2}{\quad bbox2@>;
+@:this can't happen bbox2}{\quad bbox2@>
/* clang: dereference null pointer */ assert(mp_link(p));
p = mp_link (p);
if (mp_type (p) == mp_start_bounds_node_type)
@@ -13175,7 +13168,7 @@ while (lev != 0) {
else if (mp_type (p) == mp_stop_bounds_node_type)
decr (lev);
}
-bblast (h) = p
+bblast (h) = p@;
@ It saves a lot of grief here to be slightly conservative and not account for
omitted parts of dashed lines. We also don't worry about the material omitted
@@ -13206,7 +13199,7 @@ mp_path_bbox (mp, mp_path_p ((mp_stroked_node) p));
free_number (y1a);
}
mp_adjust_bbox (mp, h);
-if ((mp_left_type (mp_path_p ((mp_stroked_node) p)) == mp_endpoint)
+if ((mp_left_type (mp_path_p ((mp_stroked_node) p)) == mp_endpoint) @|
&& (((mp_stroked_node) p)->lcap == 2))
mp_box_ends (mp, mp_path_p ((mp_stroked_node) p),
mp_pen_p ((mp_stroked_node) p), h);
@@ -13322,7 +13315,7 @@ set_number_to_inf(h->minx);
set_number_to_inf(h->miny);
set_number_to_neg_inf(h->maxx);
set_number_to_neg_inf(h->maxy);
-mp_set_bbox (mp, h, false)
+mp_set_bbox (mp, h, false)@;
@ @<Clip the bounding box in |h| to the rectangle given by |x0a|, |x1a|,...@>=
@@ -13368,8 +13361,7 @@ for cubic curve |B(t)| given by |p|,|c1|,|c2|,|q|
and it's used for |t| near 0 and |t| near 1. We use double mode, otherwise we have to
take care of overflow.
-
-@ @c
+@c
static mp_knot mp_offset_prep (MP mp, mp_knot c, mp_knot h) {
int n; /* the number of vertices in the pen polygon */
mp_knot c0, p, q, q0, r, w, ww; /* for list manipulation */
@@ -13419,21 +13411,21 @@ static mp_knot mp_offset_prep (MP mp, mp_knot c, mp_knot h) {
new_fraction (ss);
new_fraction (s);
new_fraction (t);
- @<Initialize the pen size~|n|@>;
- @<Initialize the incoming direction and pen offset at |c|@>;
+ @<Initialize the pen size~|n|@>@;
+ @<Initialize the incoming direction and pen offset at |c|@>
p = c;
c0 = c;
k_needed = 0;
#ifdef DEBUGENVELOPE
-dbg_nl;dbg_str(--[==[BEGIN]==]);dbg_nl;
-dbg_str(return {);dbg_nl;
+dbg_nl;dbg_str(@=--[==[BEGIN]==]@>);dbg_nl;
+dbg_str(@=return@>);dbg_nl;
dbg_n(w0->x_coord);
dbg_n(w0->y_coord);
#endif
do {
q = mp_next_knot (p);
#ifdef DEBUGENVELOPE
-dbg_nl;dbg_open_t;dbg_str(--[==[begin loop]==]);dbg_nl;
+dbg_nl;dbg_open_t;dbg_str(@=--[==[begin loop]==]@>);dbg_nl;
dbg_n(p->x_coord);dbg_n(p->y_coord);
dbg_n(p->right_x);dbg_n(p->right_y);
dbg_n(q->left_x);dbg_n(q->left_y);
@@ -13445,7 +13437,7 @@ dbg_n(w0->y_coord);
associated with single offsets, after which |q| should
point to the end of the final such cubic@>;
#ifdef DEBUGENVELOPE
-dbg_key(end Split the cubic between |p| and |q|);dbg_open_t;dbg_nl;
+dbg_key(@=end Split the cubic between p and q@>);dbg_open_t;dbg_nl;
dbg_n(w->x_coord);dbg_n(w->y_coord);
dbg_n(w0->x_coord);dbg_n(w0->y_coord);
dbg_close_t; dbg_comma;dbg_nl;
@@ -13455,11 +13447,11 @@ dbg_close_t; dbg_comma;dbg_nl;
might have been introduced by the splitting process@>;
#ifdef DEBUGENVELOPE
dbg_n(w0->x_coord);dbg_n(w0->y_coord);
-dbg_str(--[==[end loop]==]);dbg_nl; dbg_close_t;dbg_comma;dbg_nl;
+dbg_str(@=--[==[end loop]==]@>);dbg_nl; dbg_close_t;dbg_comma;dbg_nl;
#endif
} while (q != c);
#ifdef DEBUGENVELOPE
- dbg_key(Fix the offset change);dbg_open_t;dbg_nl;
+ dbg_key(@=Fix the offset change@>);dbg_open_t;dbg_nl;
dbg_n(p->x_coord);dbg_n(p->y_coord);
dbg_key_ival(info pre,mp_knot_info(p));dbg_comma;dbg_nl;
dbg_n(c->x_coord);dbg_n(c->y_coord);
@@ -13473,7 +13465,7 @@ dbg_key_ival(info post,mp_knot_info(p));dbg_comma;dbg_nl;
dbg_n(c->x_coord);dbg_n(c->y_coord);
dbg_key_ival(info post,mp_knot_info(c));
dbg_close_t;
-dbg_nl;dbg_str(--[==[END]==]);dbg_nl;
+dbg_nl;dbg_str(@=--[==[END]==]@>);dbg_nl;
#endif
free_number (ss);
free_number (s);
@@ -13537,7 +13529,7 @@ p = h;
do {
incr (n);
p = mp_next_knot (p);
-} while (p != h)
+} while (p != h);
@ Since the true incoming direction isn't known yet, we just pick a direction
consistent with the pen offset~|h|. If this is wrong, it can be corrected
@@ -13554,7 +13546,7 @@ later.
set_number_from_substraction(dyin, h->x_coord, hp->x_coord);
}
}
-w0 = h
+w0 = h;
@ We must be careful not to remove the only cubic in a cycle.
@@ -13568,21 +13560,20 @@ on Sarovar.)
@<Advance |p| to node |q|, removing any ``dead'' cubics...@>=
#ifdef DEBUGENVELOPE
-dbg_comment(Advance |p| to node |q|);dbg_nl;
+dbg_comment(@=Advance p to node q@>);dbg_nl;
#endif
q0 = q;
do {
r = mp_next_knot (p);
if (number_equal (p->x_coord, p->right_x) &&
- number_equal (p->y_coord, p->right_y) &&
+ number_equal (p->y_coord, p->right_y) && @|
number_equal (p->x_coord, r->left_x) &&
- number_equal (p->y_coord, r->left_y) &&
+ number_equal (p->y_coord, r->left_y) && @|
number_equal (p->x_coord, r->x_coord) &&
- number_equal (p->y_coord, r->y_coord) &&
- r != p && r != q) {
+ number_equal (p->y_coord, r->y_coord) && @|
+ r != p && r != q)
@<Remove the cubic following |p| and update the data structures
- to merge |r| into |p|@>;
- }
+ to merge |r| into |p|@>@;
p = r;
} while (p != q);
/* Check if we removed too much */
@@ -13592,11 +13583,11 @@ if ((q != q0) && (q != c || c == c0))
@ @<Remove the cubic following |p| and update the data structures...@>=
{
- #ifdef DEBUGENVELOPE
- dbg_key(Remove the cubic following p);dbg_open_t;dbg_nl;
+#ifdef DEBUGENVELOPE
+ dbg_key(@=Remove the cubic following p@>);dbg_open_t;dbg_nl;
dbg_n(p->x_coord);dbg_n(p->y_coord);
- dbg_key_ival(pre info p,mp_knot_info(p)); dbg_close_t;dbg_comma;dbg_nl;
- #endif
+ dbg_key_ival(pre info(p),mp_knot_info(p)); dbg_close_t;dbg_comma;dbg_nl;
+#endif
k_needed = mp_knot_info (p) - zero_off;
if (r == q) {
q = p;
@@ -13614,11 +13605,11 @@ if ((q != q0) && (q != c || c == c0))
mp->spec_p2 = p;
r = p;
mp_remove_cubic (mp, p);
- #ifdef DEBUGENVELOPE
- dbg_key(Remove the cubic following p);dbg_open_t;dbg_nl;
+#ifdef DEBUGENVELOPE
+ dbg_key(@=Remove the cubic following p@>);dbg_open_t;dbg_nl;
dbg_n(p->x_coord);dbg_n(p->y_coord);
- dbg_key_ival(post info p,mp_knot_info (p)); dbg_close_t;dbg_comma;dbg_nl;
- #endif
+ dbg_key_ival(post info(p),mp_knot_info (p)); dbg_close_t;dbg_comma;dbg_nl;
+#endif
}
@@ -13688,14 +13679,14 @@ piece corresponds to a unique offset.
@<Split the cubic between |p| and |q|, if necessary, into cubics...@>=
#ifdef DEBUGENVELOPE
-dbg_comment(Split the cubic between |p| and |q|);dbg_nl;
-dbg_key(Split the cubic);dbg_open_t;dbg_nl;
-dbg_key_ival(pre info p,mp_knot_info(p));dbg_comma;
+dbg_comment(@=Split the cubic between p and q@>);dbg_nl;
+dbg_key(@=Split the cubic@>);dbg_open_t;dbg_nl;
+dbg_key_ival(pre info(p),mp_knot_info(p));dbg_comma;
dbg_n(w0->x_coord);dbg_n(w0->y_coord);
#endif
mp_knot_info (p) = zero_off + k_needed;
#ifdef DEBUGENVELOPE
-dbg_key_ival(post info p,mp_knot_info(p));dbg_close_t;dbg_comma; dbg_nl;
+dbg_key_ival(post info(p),mp_knot_info(p));dbg_close_t;dbg_comma; dbg_nl;
#endif
k_needed = 0;
@<Prepare for derivative computations;
@@ -13707,7 +13698,7 @@ k_needed = 0;
@<Find the final direction |(dxin,dyin)|@>;
@<Decide on the net change in pen offsets and set |turn_amt|@>;
@<Complete the offset splitting process@>;
-w0 = mp_pen_walk (mp, w0, turn_amt)
+w0 = mp_pen_walk (mp, w0, turn_amt)@;
@ @<Declarations@>=
@@ -13763,7 +13754,7 @@ set_number_from_substraction(y0, p->right_y, p->y_coord);
set_number_from_substraction(y2, q->y_coord, q->left_y);
set_number_from_substraction(y1, q->left_y, p->right_y);
#ifdef DEBUGENVELOPE
-dbg_key(Prepare for derivative computations);dbg_open_t;dbg_nl;
+dbg_key(@=Prepare for derivative computations@>);dbg_open_t;dbg_nl;
dbg_n(x0);dbg_n(y0);dbg_n(x1);dbg_n(y1);dbg_n(x2);dbg_n(y2);
dbg_close_t;dbg_comma;dbg_nl;
#endif
@@ -13838,15 +13829,16 @@ be set properly. The |turn_amt| parameter gives the absolute value of the
overall net change in pen offsets.
@<Declarations@>=
-static void mp_fin_offset_prep (MP mp, mp_knot p, mp_knot w, mp_number
- x0, mp_number x1, mp_number x2, mp_number y0,
- mp_number y1, mp_number y2, integer rise,
- integer turn_amt);
+static void mp_fin_offset_prep (MP mp, mp_knot p, mp_knot w, @|
+ mp_number x0, mp_number x1, mp_number x2, @|
+ mp_number y0, mp_number y1, mp_number y2, @|
+ integer rise, integer turn_amt);
@ @c
-void mp_fin_offset_prep (MP mp, mp_knot p, mp_knot w, mp_number
- x0, mp_number x1, mp_number x2, mp_number y0, mp_number y1,
- mp_number y2, integer rise, integer turn_amt) {
+void mp_fin_offset_prep (MP mp, mp_knot p, mp_knot w, @|
+ mp_number x0, mp_number x1, mp_number x2, @|
+ mp_number y0, mp_number y1, mp_number y2, @|
+ integer rise, integer turn_amt) {
mp_knot ww; /* for list manipulation */
mp_number du, dv; /* for slope calculation */
mp_number t0, t1, t2; /* test coefficients */
@@ -13872,7 +13864,7 @@ dbg_key(mp_fin_offset_prep);dbg_open_t;dbg_nl;
else
ww = mp_prev_knot (w); /* a pointer to $w_{k-1}$ */
#ifdef DEBUGENVELOPE
-dbg_comment(begin iteration);
+dbg_comment(@=begin iteration@>);
dbg_open_t;dbg_nl;
dbg_n(w->x_coord);dbg_n(w->y_coord);
dbg_n(ww->x_coord);dbg_n(ww->y_coord);
@@ -13883,7 +13875,7 @@ dbg_in(rise);
@<Compute test coefficients |(t0,t1,t2)|
for $d(t)$ versus $d_k$ or $d_{k-1}$@>;
#ifdef DEBUGENVELOPE
-dbg_comment(crossing_point);
+dbg_comment(@=crossing_point@>);
#endif
crossing_point (t, t0, t1, t2);
#ifdef DEBUGENVELOPE
@@ -13899,18 +13891,18 @@ dbg_close_t; dbg_comma;dbg_nl;
goto RETURN;
}
#ifdef DEBUGENVELOPE
-dbg_comment(Split the cubic at $t$ and split off another cubic if the derivative crosses back);
+dbg_comment(@=Split the cubic at t, and split off another cubic if the derivative crosses back@>);
#endif
@<Split the cubic at $t$,
and split off another cubic if the derivative crosses back@>;
w = ww;
#ifdef DEBUGENVELOPE
-dbg_comment(end iteration);
+dbg_comment(@=end iteration@>);
#endif
}
RETURN:
#ifdef DEBUGENVELOPE
-dbg_comment(RETURN);
+dbg_comment(@=RETURN@>);
dbg_n(t);
#endif
free_number (s);
@@ -13938,7 +13930,7 @@ begins to fail.
new_number (abs_du);
new_number (abs_dv);
#ifdef DEBUGENVELOPE
-dbg_key(Compute test coefficients |(t0,t1,t2)| for $d(t)$ versus...);dbg_open_t;dbg_nl;
+dbg_key(@=Compute test coefficients (t0,t1,t2) for d(t) versus...@>);dbg_open_t;dbg_nl;
#endif
set_number_from_substraction(du, ww->x_coord, w->x_coord);
set_number_from_substraction(dv, ww->y_coord, w->y_coord);
@@ -14063,7 +14055,7 @@ degenerate.
@<Find the initial direction |(dx,dy)|@>=
#ifdef DEBUGENVELOPE
dbg_nl;
-dbg_comment(Find the initial direction |(dx,dy)|);dbg_nl;
+dbg_comment(@=Find the initial direction (dx,dy)@>);dbg_nl;
dbg_n(w0->x_coord);dbg_n(w0->y_coord);
#endif
number_clone(dx_m, zero_t);
@@ -14105,17 +14097,17 @@ dbg_n(q->x_coord);dbg_n(q->y_coord);
#endif
#ifdef DEBUGENVELOPE
dbg_close_t;dbg_comma;dbg_nl;
-dbg_key(derivatives);dbg_open_t;dbg_nl;
+dbg_key(@=derivatives@>);dbg_open_t;dbg_nl;
dbg_n(dx_m);dbg_n(dy_m);
dbg_n(dx);dbg_n(dy);dbg_n(dx_ap);dbg_n(dy_ap);dbg_close_t;dbg_comma;dbg_nl;
#endif
#ifdef DEBUGENVELOPE
-dbg_key(derivatives after first patch );dbg_open_t;dbg_nl;
+dbg_key(@=derivatives after first patch@>);dbg_open_t;dbg_nl;
dbg_n(dx_m);dbg_n(dy_m);
dbg_n(dx);dbg_n(dy);dbg_n(dx_ap);dbg_n(dy_ap);dbg_close_t;dbg_comma;dbg_nl;
#endif
#ifdef DEBUGENVELOPE
-dbg_key(derivatives patched);dbg_open_t;dbg_nl;
+dbg_key(@=derivatives patched@>);dbg_open_t;dbg_nl;
dbg_n(dx_m);dbg_n(dy_m);
dbg_n(dx);dbg_n(dy);dbg_n(dx_ap);dbg_n(dy_ap);dbg_close_t;dbg_comma;dbg_nl;
#endif
@@ -14134,23 +14126,23 @@ if (number_zero(dxin) && number_zero(dyin)) {
}
}
#ifdef DEBUGENVELOPE
-dbg_key(dxin dyin before);dbg_open_t;dbg_nl;
+dbg_key(@=dxin dyin before@>);dbg_open_t;dbg_nl;
dbg_n(dxin);dbg_n(dyin);
dbg_close_t;dbg_comma;
#endif
#ifdef DEBUGENVELOPE
-dbg_key(dxin dyin after);dbg_open_t;dbg_nl;
+dbg_key(@=dxin dyin after@>);dbg_open_t;dbg_nl;
dbg_n(dxin);dbg_n(dyin);
dbg_close_t;dbg_comma;
#endif
/* BEGIN PATCH */
#ifdef DEBUGENVELOPE
-dbg_key(dx dy dxin dyin after patch);dbg_open_t;dbg_nl;
+dbg_key(@=dx dy dxin dyin after patch@>);dbg_open_t;dbg_nl;
dbg_n(dx);dbg_n(dy);dbg_n(dx_ap);dbg_n(dy_ap);
dbg_n(dxin);dbg_n(dyin);dbg_n(dxin_ap);dbg_n(dyin_ap);
dbg_close_t;dbg_comma;
#endif
-/* END PATCH ****/
+/* END PATCH */
@ The next step is to bracket the initial direction between consecutive
edges of the pen polygon. We must be careful to turn clockwise only if
@@ -14166,8 +14158,8 @@ right.) This code depends on |w0| being the offset for |(dxin,dyin)|.
ab_vs_cd (ab_vs_cd, dy, dxin, dx, dyin);
#ifdef DEBUGENVELOPE
dbg_nl;
-dbg_comment(Update |mp_knot_info(p)|);dbg_nl;
-dbg_key(mp_get_turn_amt_dx_dy);dbg_open_t;dbg_str(--[==[call mp_get_turn_amt]==]);dbg_nl;
+dbg_comment(@=Update mp_knot_info(p)@>);dbg_nl;
+dbg_key(mp_get_turn_amt_dx_dy);dbg_open_t;dbg_str(@=--[==[call mp_get_turn_amt]==]@>);dbg_nl;
dbg_n(w0->x_coord);dbg_n(w0->y_coord);dbg_n(dx);dbg_n(dy);dbg_in(number_nonnegative(ab_vs_cd));
dbg_n(ab_vs_cd);
#endif
@@ -14181,7 +14173,7 @@ dbg_nl;
#endif
free_number (ab_vs_cd);
#ifdef DEBUGENVELOPE
-dbg_key(w0 before walk);dbg_open_t;dbg_nl;
+dbg_key(@=w0 before walk@>);dbg_open_t;dbg_nl;
dbg_n(w0->x_coord);dbg_n(w0->y_coord);
dbg_dn(turn_amt);
dbg_close_t;dbg_comma;
@@ -14189,7 +14181,7 @@ dbg_close_t;dbg_comma;
w = mp_pen_walk (mp, w0, turn_amt);
w0 = w;
#ifdef DEBUGENVELOPE
-dbg_key(w0 after walk);dbg_open_t;dbg_nl;
+dbg_key(@=w0 after walk@>);dbg_open_t;dbg_nl;
dbg_n(w0->x_coord);dbg_n(w0->y_coord);
dbg_close_t;dbg_comma;
dbg_open_t;dbg_in(mp_knot_info(p));
@@ -14233,7 +14225,7 @@ integer mp_get_turn_amt (MP mp, mp_knot w, mp_number dx, mp_number dy, boolean c
ab_vs_cd (t, dy, arg1, dx, arg2);
#ifdef DEBUGENVELOPE
dbg_sp;
- dbg_open_t;dbg_str(--[==[inside mp_get_turn_amt do loop ]==]);dbg_nl;
+ dbg_open_t;dbg_str(@=--[==[inside mp_get_turn_amt do loop]==]@>);dbg_nl;
dbg_n(w->x_coord);dbg_n(w->y_coord);dbg_n(ww->x_coord);dbg_n(ww->y_coord);
dbg_n(t);dbg_n(dy);dbg_n(arg1);dbg_n(dx);dbg_n(arg2);
dbg_n(t_ap);dbg_n(dy_ap);dbg_n(dx_ap);dbg_n(dyin_ap);dbg_n(dxin_ap);
@@ -14259,7 +14251,7 @@ integer mp_get_turn_amt (MP mp, mp_knot w, mp_number dx, mp_number dy, boolean c
ab_vs_cd (t, dy, arg1, dx, arg2);
#ifdef DEBUGENVELOPE
dbg_sp;
- dbg_open_t;dbg_str(--[==[outside mp_get_turn_amt do loop ]==]);dbg_nl;
+ dbg_open_t;dbg_str(@=--[==[outside mp_get_turn_amt do loop]==]@>);dbg_nl;
dbg_n(w->x_coord);dbg_n(w->y_coord);dbg_n(ww->x_coord);dbg_n(ww->y_coord);
dbg_n(t);dbg_n(dy);dbg_n(arg1);dbg_n(dx);dbg_n(arg2);
dbg_n(t_ap);dbg_n(dy_ap);dbg_n(dx_ap);dbg_n(dyin_ap);dbg_n(dxin_ap);
@@ -14275,7 +14267,7 @@ integer mp_get_turn_amt (MP mp, mp_knot w, mp_number dx, mp_number dy, boolean c
ab_vs_cd (t, dy, arg1, dx, arg2);
#ifdef DEBUGENVELOPE
dbg_sp;
- dbg_open_t;dbg_str(--[==[inside mp_get_turn_amt do loop for t<0 ]==]);dbg_nl;
+ dbg_open_t;dbg_str(@=--[==[inside mp_get_turn_amt do loop for t<0]==]@>);dbg_nl;
dbg_n(w->x_coord);dbg_n(w->y_coord);dbg_n(ww->x_coord);dbg_n(ww->y_coord);
dbg_n(t);dbg_n(dy);dbg_n(arg1);dbg_n(dx);dbg_n(arg2);
dbg_n(t_ap);dbg_n(dy_ap);dbg_n(dx_ap);
@@ -14329,14 +14321,14 @@ with respect to $d_{k-1}$, and apply |fin_offset_prep| to each part.
@<Complete the offset splitting process@>=
ww = mp_prev_knot (w);
#ifdef DEBUGENVELOPE
-dbg_key(Complete the offset splitting process);dbg_open_t;dbg_nl;
+dbg_key(@=Complete the offset splitting process@>);dbg_open_t;dbg_nl;
dbg_n(w->x_coord);dbg_n(w->y_coord);
dbg_n(ww->x_coord);dbg_n(ww->y_coord);
dbg_close_t; dbg_comma;dbg_nl;
#endif
@<Compute test coeff...@>;
#ifdef DEBUGENVELOPE
-dbg_key(after Compute test coeff);dbg_open_t;dbg_nl;
+dbg_key(@=after Compute test coeff@>);dbg_open_t;dbg_nl;
dbg_n(w->x_coord);dbg_n(w->y_coord);
dbg_n(ww->x_coord);dbg_n(ww->y_coord);
dbg_close_t; dbg_comma;dbg_nl;
@@ -14345,7 +14337,7 @@ dbg_close_t; dbg_comma;dbg_nl;
|t:=fraction_one+1|@>;
if (number_greater(t, fraction_one_t)) {
#ifdef DEBUGENVELOPE
-dbg_key(t > fraction_one_t);dbg_open_t;dbg_nl;
+dbg_key(@=t > fraction_one_t@>);dbg_open_t;dbg_nl;
dbg_n(p->x_coord);dbg_n(p->y_coord);
dbg_n(w->x_coord);dbg_n(w->y_coord);
dbg_n(x0);dbg_n(x1);dbg_n(x2);
@@ -14363,7 +14355,7 @@ dbg_close_t; dbg_comma;dbg_nl;
set_number_from_of_the_way(y1, t, y1, y2);
set_number_from_of_the_way(y2a, t, y1a, y1);
#ifdef DEBUGENVELOPE
-dbg_key(t <= fraction_one_t);dbg_open_t;dbg_nl;
+dbg_key(@=t <= fraction_one_t@>);dbg_open_t;dbg_nl;
dbg_n(p->x_coord);dbg_n(p->y_coord);
dbg_n(t);
dbg_n(r->x_coord);dbg_n(r->y_coord);
@@ -14401,7 +14393,7 @@ dbg_close_t; dbg_comma;dbg_nl;
}
}
#ifdef DEBUGENVELOPE
-dbg_key(end Complete the offset splitting process);dbg_open_t;dbg_nl;
+dbg_key(@=end Complete the offset splitting process@>);dbg_open_t;dbg_nl;
dbg_n(w->x_coord);dbg_n(w->y_coord);
dbg_n(w0->x_coord);dbg_n(w0->y_coord);
dbg_in(turn_amt);
@@ -14419,7 +14411,7 @@ set_number_from_of_the_way(y1, t, y0, y1);
set_number_from_of_the_way(y0a, t, y1, y1a);
mp_fin_offset_prep (mp, mp_next_knot (r), w, x0a, x1a, x2, y0a, y1a, y2, 1, turn_amt);
number_clone(x2, x0a);
-number_clone(y2, y0a)
+number_clone(y2, y0a)@;
@ At this point, the direction of the incoming pen edge is |(-du,-dv)|.
When the component of $d(t)$ perpendicular to |(-du,-dv)| crosses zero, we
@@ -14432,7 +14424,7 @@ crossing and the first crossing cannot be antiparallel.
@<Find the first |t| where $d(t)$ crosses $d_{k-1}$ or set...@>=
#ifdef DEBUGENVELOPE
-dbg_key(Find the first |t| where);dbg_open_t;dbg_nl;
+dbg_key(@=Find the first t where@>);dbg_open_t;dbg_nl;
#endif
crossing_point (t, t0, t1, t2);
if (turn_amt >= 0) {
@@ -14491,7 +14483,7 @@ the path should always change the sign of |turn_amt|.
new_number (ab_vs_cd);
#ifdef DEBUGENVELOPE
dbg_sp;
-dbg_key(Decide on the net change in pen offsets and set turn_amt);dbg_open_t;dbg_nl;
+dbg_key(@=Decide on the net change in pen offsets and set turn_amt@>);dbg_open_t;dbg_nl;
#endif
ab_vs_cd (ab_vs_cd, dx, dyin, dxin, dy);
#ifdef DEBUGENVELOPE
@@ -14512,9 +14504,8 @@ dbg_close_t;dbg_comma;dbg_nl;
free_number (ab_vs_cd);
free_number (t_ap);
}
-if (d_sign == 0) {
- @<Check rotation direction based on node position@>
-}
+if (d_sign == 0)
+ @<Check rotation direction based on node position@>@;
if (d_sign == 0) {
if (number_zero(dx)) {
if (number_positive(dy))
@@ -14532,8 +14523,8 @@ if (d_sign == 0) {
more than $180^\circ$@>;
#ifdef DEBUGENVELOPE
dbg_nl;
-dbg_key(Make |ss| negative if and only if); dbg_open_t;dbg_nl;
-dbg_key(mp_get_turn_amt_dxin_dyin);dbg_open_t;dbg_str(--[==[call mp_get_turn_amt]==]);dbg_nl; ;
+dbg_key(@=Make ss negative if and only if@>); dbg_open_t;dbg_nl;
+dbg_key(mp_get_turn_amt_dxin_dyin);dbg_open_t;dbg_str(@=--[==[call mp_get_turn_amt]==]@>);dbg_nl;
dbg_n(w->x_coord);dbg_n(w->y_coord);dbg_n(dxin);dbg_n(dyin);dbg_in((d_sign > 0));
#endif
is_dxindyin=true;
@@ -14657,11 +14648,11 @@ if (number_positive(t0)) {
set_number_from_addition (ss, r1, r2);
/* BEGIN PATCH */
#ifdef DEBUGENVELOPE
-dbg_key(patch ss before);dbg_open_t;
+dbg_key(@=patch ss before@>);dbg_open_t;
dbg_n(ss);dbg_close_t;dbg_comma;
#endif
#ifdef DEBUGENVELOPE
-dbg_key(patch ss after);dbg_open_t;
+dbg_key(@=patch ss after@>);dbg_open_t;
dbg_n(ss);dbg_close_t;dbg_comma;
#endif
free_number(abs_ss);
@@ -14698,9 +14689,8 @@ static void mp_print_spec (MP mp, mp_knot cur_spec, mp_knot cur_pen,
if ((p == cur_spec) || (mp_knot_info (p) != zero_off))
break;
}
- if (mp_knot_info (p) != zero_off) {
- @<Update |w| as indicated by |mp_knot_info(p)| and print an explanation@>;
- }
+ if (mp_knot_info (p) != zero_off)
+ @<Update |w| as indicated by |mp_knot_info(p)| and print an explanation@>@;
} while (p != cur_spec);
mp_print_nl (mp, " & cycle");
mp_end_diagnostic (mp, true);
@@ -14712,12 +14702,12 @@ static void mp_print_spec (MP mp, mp_knot cur_spec, mp_knot cur_pen,
w = mp_pen_walk (mp, w, (mp_knot_info (p) - zero_off));
mp_print (mp, " % ");
#ifdef DEBUGENVELOPE
- dbg_nl;dbg_open_t;dbg_str(--[==[START]==]);dbg_nl;
- dbg_key(Printing mp_knot_info (p));dbg_open_t;dbg_nl;
+ dbg_nl;dbg_open_t;dbg_str(@=--[==[START]==]@>);dbg_nl;
+ dbg_key(@=Printing mp_knot_info (p)@>);dbg_open_t;dbg_nl;
dbg_n(p->x_coord);dbg_n(p->y_coord);
dbg_in(mp_knot_info(p));
dbg_close_t;dbg_close_t;dbg_comma;dbg_nl;
- dbg_nl;dbg_str(--[==[STOP]==]);dbg_nl;
+ dbg_nl;dbg_str(@=--[==[STOP]==]@>);dbg_nl;
#endif
if (mp_knot_info (p) > zero_off)
mp_print (mp, "counter");
@@ -14788,9 +14778,8 @@ static mp_knot mp_make_envelope (MP mp, mp_knot c, mp_knot h, quarterword ljoin,
k = mp_knot_info (q);
k0 = k;
w0 = w;
- if (k != zero_off) {
- @<Set |join_type| to indicate how to handle offset changes at~|q|@>;
- }
+ if (k != zero_off)
+ @<Set |join_type| to indicate how to handle offset changes at~|q|@>@;
@<Add offset |w| to the cubic from |p| to |q|@>;
while (k != zero_off) {
@<Step |w| and move |k| one step closer to |zero_off|@>;
@@ -14805,10 +14794,9 @@ static mp_knot mp_make_envelope (MP mp, mp_knot c, mp_knot h, quarterword ljoin,
free_number (ytot);
}
}
- if (q != mp_next_knot (p)) {
+ if (q != mp_next_knot (p))
@<Set |p=mp_link(p)| and add knots between |p| and |q| as
- required by |join_type|@>;
- }
+ required by |join_type|@>@;
p = q;
} while (q0 != c);
free_number (max_ht);
@@ -14837,26 +14825,26 @@ degenerate cubic. Setting |join_type:=2| in this case makes the computed
envelope degenerate as well.
@<Set |join_type| to indicate how to handle offset changes at~|q|@>=
-if (k < zero_off) {
- join_type = 2;
-} else {
- if ((q != mp->spec_p1) && (q != mp->spec_p2))
- join_type = ljoin;
- else if (lcap == 2)
- join_type = 3;
- else
- join_type = 2 - lcap;
- if ((join_type == 0) || (join_type == 3)) {
- @<Set the incoming and outgoing directions at |q|; in case of
- degeneracy set |join_type:=2|@>;
- if (join_type == 0) {
- @<If |miterlim| is less than the secant of half the angle at |q|
- then set |join_type:=2|@>;
+{
+ if (k < zero_off) {
+ join_type = 2;
+ } else {
+ if ((q != mp->spec_p1) && (q != mp->spec_p2))
+ join_type = ljoin;
+ else if (lcap == 2)
+ join_type = 3;
+ else
+ join_type = 2 - lcap;
+ if ((join_type == 0) || (join_type == 3)) {
+ @<Set the incoming and outgoing directions at |q|; in case of
+ degeneracy set |join_type:=2|@>;
+ if (join_type == 0)
+ @<If |miterlim| is less than the secant of half the angle at |q|
+ then set |join_type:=2|@>@;
}
}
}
-
@ @<If |miterlim| is less than the secant of half the angle at |q|...@>=
{
mp_number r1, r2;
@@ -14895,7 +14883,7 @@ number_add (q->left_y, w->y_coord);
number_add (q->x_coord, w->x_coord);
number_add (q->y_coord, w->y_coord);
mp_left_type (q) = mp_explicit;
-mp_right_type (q) = mp_explicit
+mp_right_type (q) = mp_explicit@;
@ @<Step |w| and move |k| one step closer to |zero_off|@>=
if (k > zero_off) {
@@ -14942,12 +14930,11 @@ mp_knot mp_insert_knot (MP mp, mp_knot q, mp_number x, mp_number y) {
{
p = mp_next_knot (p);
if ((join_type == 0) || (join_type == 3)) {
- if (join_type == 0) {
- @<Insert a new knot |r| between |p| and |q| as required for a mitered join@>
- } else {
+ if (join_type == 0)
+ @<Insert a new knot |r| between |p| and |q| as required for a mitered join@>@;
+ else
@<Make |r| the last of two knots inserted between |p| and |q| to form a
- squared join@>;
- }
+ squared join@>@;
if (r != NULL) {
number_clone (r->right_x, r->x_coord);
number_clone (r->right_y, r->y_coord);
@@ -15135,9 +15122,8 @@ if (mp_left_type (c) == mp_endpoint) {
if (c != mp_next_knot (c)) {
mp_originator (mp->spec_p2) = mp_program_code;
mp_remove_cubic (mp, mp->spec_p2);
- } else {
- @<Make |c| look like a cycle of length one@>;
- }
+ } else
+ @<Make |c| look like a cycle of length one@>@;
}
@ @<Make |c| look like a cycle of length one@>=
@@ -15187,7 +15173,7 @@ That knot is |p| but if |p<>c|, its coordinates have already been offset by |w|.
@ If |q=c| then the coordinates of |r| and the control points between |q|
-and~|r| have already been offset by |h|.
+and~|r| have already been offset by~|h|.
@<Set the outgoing direction at |q|@>=
{
@@ -15209,7 +15195,7 @@ and~|r| have already been offset by |h|.
pyth_add (tmp, dxout, dyout);
if (number_zero(tmp)) {
/* |mp_confusion (mp, "degenerate spec");| */
-@:this can't happen degerate spec}{\quad degenerate spec@>;
+@:this can't happen degenerate spec}{\quad degenerate spec@>
/* But apparently, it actually can happen. The test case is this:
path p;
@@ -15815,7 +15801,7 @@ if (int_packets + (17+2) * int_increment > bistack_size)
@ Computation of the min and max is a tedious but fairly fast sequence of
instructions; exactly four comparisons are made in each branch.
-@d set_min_max(A)
+@d set_min_max(A) @/
debug_number (stack_1(A));
debug_number (stack_3(A));
debug_number (stack_2(A));
@@ -15914,10 +15900,10 @@ static void mp_cubic_intersection (MP mp, mp_knot p, mp_knot pp) {
CONTINUE:
while (1) {
/* When we are in arbitrary precision math, low precisions can */
- /* lead to acces locations beyond the |stack_size|: in this case */
+ /* lead to access locations beyond the |stack_size|: in this case */
/* we say that there is no intersection.*/
if ( ((x_packet (mp->xy))+4)>bistack_size ||
- ((u_packet (mp->uv))+4)>bistack_size ||
+ ((u_packet (mp->uv))+4)>bistack_size || @|
((y_packet (mp->xy))+4)>bistack_size ||
((v_packet (mp->uv))+4)>bistack_size ){
set_number_from_scaled (mp->cur_t, 1);
@@ -15974,21 +15960,18 @@ CONTINUE:
if (odd (number_to_scaled (mp->cur_tt))) {
if (odd (number_to_scaled (mp->cur_t))) {
/* Descend to the previous level and |goto not_found| */
- {
- set_number_from_scaled (mp->cur_t, half (number_to_scaled (mp->cur_t)));
- set_number_from_scaled (mp->cur_tt, half (number_to_scaled (mp->cur_tt)));
- if (number_to_scaled (mp->cur_t) == 0)
- return;
- mp->bisect_ptr -= int_increment;
- mp->three_l -= (integer) mp->tol_step;
- number_clone (mp->delx, stack_dx);
- number_clone (mp->dely, stack_dy);
- mp->tol = number_to_scaled (stack_tol);
- mp->uv = number_to_scaled (stack_uv);
- mp->xy = number_to_scaled (stack_xy);
- goto NOT_FOUND;
- }
-
+ set_number_from_scaled (mp->cur_t, half (number_to_scaled (mp->cur_t)));
+ set_number_from_scaled (mp->cur_tt, half (number_to_scaled (mp->cur_tt)));
+ if (number_to_scaled (mp->cur_t) == 0)
+ return;
+ mp->bisect_ptr -= int_increment;
+ mp->three_l -= (integer) mp->tol_step;
+ number_clone (mp->delx, stack_dx);
+ number_clone (mp->dely, stack_dy);
+ mp->tol = number_to_scaled (stack_tol);
+ mp->uv = number_to_scaled (stack_uv);
+ mp->xy = number_to_scaled (stack_xy);
+ goto NOT_FOUND;
} else {
set_number_from_scaled (mp->cur_t, number_to_scaled (mp->cur_t) + 1);
number_add (mp->delx, stack_1 (u_packet (mp->uv)));
@@ -16079,11 +16062,9 @@ mp->uv = r_packets;
mp->xy = r_packets;
mp->three_l = 0;
set_number_from_scaled (mp->cur_t, 1);
-set_number_from_scaled (mp->cur_tt, 1)
+set_number_from_scaled (mp->cur_tt, 1)@;
-@
-
-@<Subdivide for a new level of intersection@>=
+@ @<Subdivide for a new level of intersection@>=
number_clone (stack_dx, mp->delx);
number_clone (stack_dy, mp->dely);
set_number_from_scaled (stack_tol, mp->tol);
@@ -16130,7 +16111,7 @@ number_double(mp->delx);
number_double(mp->dely);
mp->tol = mp->tol - mp->three_l + (integer) mp->tol_step;
mp->tol += mp->tol;
-mp->three_l = mp->three_l + (integer) mp->tol_step
+mp->three_l = mp->three_l + (integer) mp->tol_step@;
@ The |path_intersection| procedure is much simpler.
It invokes |cubic_intersection| in lexicographic order until finding a
@@ -16302,19 +16283,19 @@ structures have to match.
mp_value_node d = (mp_value_node)(B);
FUNCTION_TRACE4("set_dep_info(%p,%p) on %d\n",(A),d,__LINE__);
((mp_value_node)(A))->parent_ = (mp_node)d;
-} while (0)
+} while (0)@;
@d dep_list(A) ((mp_value_node)(A))->attr_head_ /* half of the |value| field in a |dependent| variable */
@d set_dep_list(A,B) do {
mp_value_node d = (mp_value_node)(B);
FUNCTION_TRACE4("set_dep_list(%p,%p) on %d\n",(A),d,__LINE__);
dep_list((A)) = (mp_node)d;
-} while (0)
+} while (0)@;
@d prev_dep(A) ((mp_value_node)(A))->subscr_head_ /* the other half; makes a doubly linked list */
@d set_prev_dep(A,B) do {
mp_value_node d = (mp_value_node)(B);
FUNCTION_TRACE4("set_prev_dep(%p,%p) on %d\n",(A),d,__LINE__);
prev_dep((A)) = (mp_node)d;
-} while (0)
+} while (0)@;
@c
static mp_node get_dep_info (MP mp, mp_value_node p) {
@@ -16333,9 +16314,7 @@ static void do_set_dep_value (MP mp, mp_value_node p, mp_number q) {
@ @<Declarations...@>=
static mp_node get_dep_info (MP mp, mp_value_node p);
-@
-
-@c
+@ @c
static mp_value_node mp_get_dep_node (MP mp) {
mp_value_node p = (mp_value_node) mp_get_value_node (mp);
mp_type (p) = mp_dep_node_type;
@@ -16828,8 +16807,7 @@ by a given |scaled| constant.
static mp_value_node mp_p_over_v (MP mp, mp_value_node p, mp_number v, quarterword
t0, quarterword t1);
-@
-@d p_over_v_threshold_k ((math_data *)mp->math)->p_over_v_threshold_t
+@ @d p_over_v_threshold_k ((math_data *)mp->math)->p_over_v_threshold_t
@c
mp_value_node mp_p_over_v (MP mp, mp_value_node p, mp_number v_orig, quarterword
@@ -16964,7 +16942,7 @@ static void mp_val_too_big (MP mp, mp_number x) {
char msg[256];
const char *hlp[] = {
"The equation I just processed has given some variable a",
- "value outside of the safetyp range. Continue and I'll try",
+ "value outside of the safety range. Continue and I'll try",
"to cope with that big value; but it might be dangerous.",
"(Set warningcheck:=0 to suppress this message.)",
NULL };
@@ -17023,8 +17001,7 @@ to zero, so that a variable will become known more or less by default.
@<Declarations@>=
static void mp_fix_dependencies (MP mp);
-@
-@d independent_being_fixed 1 /* this variable already appears in |s| */
+@ @d independent_being_fixed 1 /* this variable already appears in |s| */
@c
static void mp_fix_dependencies (MP mp) {
mp_value_node p, q, r, s, t; /* list manipulation registers */
@@ -17226,8 +17203,7 @@ static void mp_linear_eq (MP mp, mp_value_node p, quarterword t) {
}
-@
-@c
+@ @c
static mp_value_node find_node_with_largest_coefficient(MP mp, mp_value_node p, mp_number *v) {
mp_number vabs; /* its absolute value of v*/
mp_number rabs; /* the absolute value of |dep_value(r)| */
@@ -17311,8 +17287,7 @@ static mp_value_node divide_p_by_minusv_removing_q (MP mp, mp_value_node p, mp_v
}
-@
-@c
+@ @c
static void display_new_dependency (MP mp, mp_value_node p, mp_node x, integer n) {
if (mp_interesting (mp, x)) {
int w0;
@@ -17372,8 +17347,7 @@ static mp_value_node divide_p_by_2_n (MP mp, mp_value_node p, integer n) {
return pp;
}
-@
-@c
+@ @c
static void change_to_known (MP mp, mp_value_node p, mp_node x, mp_value_node final_node, integer n) {
if (dep_info (p) == NULL) {
mp_number absx;
@@ -17521,7 +17495,7 @@ static void mp_ring_merge (MP mp, mp_node p, mp_node q) {
if (r == q) {
exclaim_redundant_equation(mp);
return;
- };
+ }
r = value_node (r);
}
r = value_node (p);
@@ -17624,7 +17598,7 @@ static void mp_print_cmd_mod (MP mp, integer c, integer m);
@ @c
void mp_print_cmd_mod (MP mp, integer c, integer m) {
switch (c) {
- @<Cases of |print_cmd_mod| for symbolic printing of primitives@>
+ @t\4@>@<Cases of |print_cmd_mod| for symbolic printing of primitives@>@;
default:
mp_print (mp, "[unknown command code!]");
break;
@@ -17936,8 +17910,8 @@ integer mp_true_line (MP mp) {
return line;
} else {
k = mp->input_ptr;
- while ((k > 0) &&
- ((mp->input_stack[(k - 1)].index_field < file_bottom) ||
+ while ((k > 0) && @|
+ ((mp->input_stack[(k - 1)].index_field < file_bottom) || @|
(mp->input_stack[(k - 1)].name_field <= max_spec_src))) {
decr (k);
}
@@ -18216,7 +18190,7 @@ new level (having, initially, the same properties as the old).
mp->max_in_stack=mp->input_ptr;
if ( mp->input_ptr==mp->stack_size ) {
int l = (mp->stack_size+(mp->stack_size/4));
- /* The mp->stack_size < 1001 condition is necessary to prevent C stack overflow due infinite recursion. */
+ /* The |mp->stack_size < 1001| condition is necessary to prevent C stack overflow due infinite recursion. */
if (l>1000) {fprintf(stderr, "input stack overflow\n");exit(EXIT_FAILURE);}
XREALLOC(mp->input_stack, l, in_state_record);
mp->stack_size = l;
@@ -18402,7 +18376,7 @@ static void mp_end_file_reading (MP mp) {
if (mp->in_open > iindex) {
if ((mp->mpx_name[mp->in_open] == absent) || (name <= max_spec_src)) {
mp_confusion (mp, "endinput");
-@:this can't happen endinput}{\quad endinput@>;
+@:this can't happen endinput}{\quad endinput@>
} else {
(mp->close_file) (mp, mp->input_file[mp->in_open]); /* close an \.{MPX} file */
delete_str_ref (mp->mpx_name[mp->in_open]);
@@ -18461,7 +18435,7 @@ static boolean mp_begin_mpx_reading (MP mp) {
static void mp_end_mpx_reading (MP mp) {
if (mp->in_open != iindex)
mp_confusion (mp, "mpx");
-@:this can't happen mpx}{\quad mpx@>;
+@:this can't happen mpx}{\quad mpx@>
if (loc < limit) {
/* Complain that we are not at the end of a line in the \.{MPX} file */
/* Here we enforce a restriction that simplifies the input stacks considerably.
@@ -18590,7 +18564,7 @@ static boolean mp_check_outer_validity (MP mp) {
"the matching `fi'. I've inserted a `fi'; this might work.",
NULL };
mp_snprintf(msg, 256, "Incomplete if; all text was ignored after line %d", (int)mp->warning_line);
-@.Incomplete if...@>;
+@.Incomplete if...@>
if (cur_sym() == NULL) {
hlp[0] = "The file ended while I was skipping conditional text.";
}
@@ -18646,7 +18620,7 @@ if (cur_sym() != NULL) {
}
switch (mp->scanner_status) {
@<Complete the error message,
- and set |cur_sym| to a token that might help recover from the error@>
+ and set |cur_sym| to a token that might help recover from the error@>@;
} /* there are no other cases */
mp_ins_error (mp, msg, hlp, true);
}
@@ -18739,7 +18713,7 @@ static void mp_firm_up_the_line (MP mp);
@ And now we're ready to take the plunge into |get_next| itself.
Note that the behavior depends on the |scanner_status| because percent signs
-and double quotes need to be passed over when skipping TeX material.
+and double quotes need to be passed over when skipping \TeX\ material.
@c
void mp_get_next (MP mp) {
@@ -18942,13 +18916,13 @@ static int move_to_next_line (MP mp) {
mp_firm_up_the_line (mp); /* this sets |limit| */
else
mp->force_eof = true;
- };
+ }
if (mp->force_eof) {
mp->force_eof = false;
decr (loc);
if (mpx_reading) {
- /* Complain that the \.{MPX} file ended unexpectly; then set
- |cur_sym:=mp->frozen_mpx_break| and |goto comon_ending| */
+ /* Complain that the \.{MPX} file ended unexpectedly; then set
+ |cur_sym:=mp->frozen_mpx_break| and |goto common_ending| */
/* We should never actually come to the end of an \.{MPX} file because such
files should have an \&{mpxbreak} after the translation of the last
\&{btex}$\,\ldots\,$\&{etex} block. */
@@ -19032,7 +19006,7 @@ void mp_firm_up_the_line (MP mp) {
}
mp->first = (size_t) limit;
prompt_input ("=>"); /* wait for user response */
-@.=>@>;
+@.=>@>
if (mp->last > mp->first) {
for (k = mp->first; k < mp->last; k++) { /* move line down in buffer */
mp->buffer[k + (size_t) start - mp->first] = mp->buffer[k];
@@ -19046,7 +19020,7 @@ void mp_firm_up_the_line (MP mp) {
@* Dealing with \TeX\ material.
The \&{btex}$\,\ldots\,$\&{etex} and \&{verbatimtex}$\,\ldots\,$\&{etex}
features need to be implemented at a low level in the scanning process
-so that \MP\ can stay in synch with the a preprocessor that treats
+so that \MP\ can stay in sync with the a preprocessor that treats
blocks of \TeX\ material as they occur in the input file without trying
to expand \MP\ macros. Thus we need a special version of |get_next|
that does not expand macros and such but does handle \&{btex},
@@ -19062,12 +19036,12 @@ $\,\ldots\,$\&{etex} blocks, switching to the \.{MPX} file when it sees
@ @<Put each...@>=
mp_primitive (mp, "btex", mp_start_tex, btex_code);
-@:btex_}{\&{btex} primitive@>;
+@:btex_}{\&{btex} primitive@>
mp_primitive (mp, "verbatimtex", mp_start_tex, verbatim_code);
-@:verbatimtex_}{\&{verbatimtex} primitive@>;
+@:verbatimtex_}{\&{verbatimtex} primitive@>
mp_primitive (mp, "etex", mp_etex_marker, 0);
mp->frozen_etex = mp_frozen_primitive (mp, "etex", mp_etex_marker, 0);
-@:etex_}{\&{etex} primitive@>;
+@:etex_}{\&{etex} primitive@>
mp_primitive (mp, "mpxbreak", mp_mpx_break, 0);
mp->frozen_mpx_break = mp_frozen_primitive (mp, "mpxbreak", mp_mpx_break, 0);
@:mpx_break_}{\&{mpxbreak} primitive@>
@@ -19095,9 +19069,8 @@ is encountered.
mp_get_next (mp);
if (cur_cmd() <= mp_max_pre_command)
mp_t_next (mp);
-} while (0)
+} while (0)@;
-@c
@ @<Declarations@>=
static void mp_t_next (MP mp);
static void mp_start_mpx_input (MP mp);
@@ -19107,33 +19080,32 @@ static void mp_t_next (MP mp) {
int old_status; /* saves the |scanner_status| */
integer old_info; /* saves the |warning_info| */
-if ((mp->extensions == 1) && (cur_cmd() == mp_start_tex)) {
- @<Pass btex ... etex to script@>;
-} else {
+if ((mp->extensions == 1) && (cur_cmd() == mp_start_tex))
+ @<Pass \&{btex} ... \&{etex} to script@>@;
+else {
while (cur_cmd() <= mp_max_pre_command) {
if (cur_cmd() == mp_mpx_break) {
- if (!file_state || (mp->mpx_name[iindex] == absent)) {
- @<Complain about a misplaced \&{mpxbreak}@>;
- } else {
+ if (!file_state || (mp->mpx_name[iindex] == absent))
+ @<Complain about a misplaced \&{mpxbreak}@>@;
+ else {
mp_end_mpx_reading (mp);
goto TEX_FLUSH;
}
} else if (cur_cmd() == mp_start_tex) {
- if (token_state || (name <= max_spec_src)) {
- @<Complain that we are not reading a file@>;
- } else if (mpx_reading) {
- @<Complain that \.{MPX} files cannot contain \TeX\ material@>;
- } else if ((cur_mod() != verbatim_code) &&
+ if (token_state || (name <= max_spec_src))
+ @<Complain that we are not reading a file@>@;
+ else if (mpx_reading)
+ @<Complain that \.{MPX} files cannot contain \TeX\ material@>@;
+ else if ((cur_mod() != verbatim_code) &&
(mp->mpx_name[iindex] != mpx_finished)) {
if (!mp_begin_mpx_reading (mp))
mp_start_mpx_input (mp);
} else {
goto TEX_FLUSH;
}
- } else {
- @<Complain about a misplaced \&{etex}@>;
- }
+ } else
+ @<Complain about a misplaced \&{etex}@>@;
goto COMMON_ENDING;
TEX_FLUSH:
@<Flush the \TeX\ material@>;
@@ -19157,7 +19129,7 @@ do {
mp_get_next (mp);
} while (cur_cmd() != mp_etex_marker);
mp->scanner_status = old_status;
-mp->warning_line = old_info
+mp->warning_line = old_info@;
@ @<Complain that \.{MPX} files cannot contain \TeX\ material@>=
{
@@ -19220,24 +19192,24 @@ like \&{enddef} and \&{endfor}.
@<Put each...@>=
mp_primitive (mp, "def", mp_macro_def, start_def);
-@:def_}{\&{def} primitive@>;
+@:def_}{\&{def} primitive@>
mp_primitive (mp, "vardef", mp_macro_def, var_def);
-@:var_def_}{\&{vardef} primitive@>;
+@:var_def_}{\&{vardef} primitive@>
mp_primitive (mp, "primarydef", mp_macro_def, mp_secondary_primary_macro);
-@:primary_def_}{\&{primarydef} primitive@>;
+@:primary_def_}{\&{primarydef} primitive@>
mp_primitive (mp, "secondarydef", mp_macro_def, mp_tertiary_secondary_macro);
-@:secondary_def_}{\&{secondarydef} primitive@>;
+@:secondary_def_}{\&{secondarydef} primitive@>
mp_primitive (mp, "tertiarydef", mp_macro_def, mp_expression_tertiary_macro);
-@:tertiary_def_}{\&{tertiarydef} primitive@>;
+@:tertiary_def_}{\&{tertiarydef} primitive@>
mp_primitive (mp, "enddef", mp_macro_def, end_def);
mp->frozen_end_def = mp_frozen_primitive (mp, "enddef", mp_macro_def, end_def);
-@:end_def_}{\&{enddef} primitive@>;
+@:end_def_}{\&{enddef} primitive@>
mp_primitive (mp, "for", mp_iteration, start_for);
-@:for_}{\&{for} primitive@>;
+@:for_}{\&{for} primitive@>
mp_primitive (mp, "forsuffixes", mp_iteration, start_forsuffixes);
-@:for_suffixes_}{\&{forsuffixes} primitive@>;
+@:for_suffixes_}{\&{forsuffixes} primitive@>
mp_primitive (mp, "forever", mp_iteration, start_forever);
-@:forever_}{\&{forever} primitive@>;
+@:forever_}{\&{forever} primitive@>
mp_primitive (mp, "endfor", mp_iteration, end_for);
mp->frozen_end_for = mp_frozen_primitive (mp, "endfor", mp_iteration, end_for);
@:end_for_}{\&{endfor} primitive@>
@@ -19301,8 +19273,7 @@ typedef struct mp_subst_list_item {
struct mp_subst_list_item *link;
} mp_subst_list_item;
-@
-@c
+@ @c
static mp_node mp_scan_toks (MP mp, mp_command_code terminator,
mp_subst_list_item * subst_list, mp_node tail_end,
quarterword suffix_count) {
@@ -19319,9 +19290,9 @@ static mp_node mp_scan_toks (MP mp, mp_command_code terminator,
cur_data = -1;
if (cur_sym() != NULL) {
@<Substitute for |cur_sym|, if it's on the |subst_list|@>;
- if (cur_cmd() == terminator) {
- @<Adjust the balance; |break| if it's zero@>;
- } else if (cur_cmd() == mp_macro_special) {
+ if (cur_cmd() == terminator)
+ @<Adjust the balance; |break| if it's zero@>@;
+ else if (cur_cmd() == mp_macro_special) {
/* Handle quoted symbols, \.{\#\AT!}, \.{\AT!}, or \.{\AT!\#} */
if (cur_mod() == quote) {
get_t_next (mp);
@@ -19350,10 +19321,10 @@ static mp_node mp_scan_toks (MP mp, mp_command_code terminator,
return mp_link (mp->hold_head);
}
-@
-@c
+@ @c
void mp_print_sym (mp_sym sym) {
- printf("{type = %d, v = {type = %d, data = {indep = {scale = %d, serial = %d}, n = %d, str = %p, sym = %p, node = %p, p = %p}}, text = %p}\n", sym->type, sym->v.type, (int)sym->v.data.indep.scale, (int)sym->v.data.indep.serial,
+ printf("{type = %d, v = {type = %d, data = {indep = {scale = %d, serial = %d}, n = %d, str = %p, sym = %p, node = %p, p = %p}}, text = %p}\n",
+ sym->type, sym->v.type, (int)sym->v.data.indep.scale, (int)sym->v.data.indep.serial,
sym->v.data.n.type, sym->v.data.str, sym->v.data.sym, sym->v.data.node, sym->v.data.p, sym->text);
if (is_number(sym->v.data.n)) {
mp_number n = sym->v.data.n;
@@ -19365,8 +19336,7 @@ void mp_print_sym (mp_sym sym) {
}
}
-@
-@<Declarations@>=
+@ @<Declarations@>=
void mp_print_sym (mp_sym sym) ;
@ @<Substitute for |cur_sym|...@>=
@@ -19385,15 +19355,16 @@ void mp_print_sym (mp_sym sym) ;
@ @<Adjust the balance; |break| if it's zero@>=
-if (cur_mod() > 0) {
- incr (balance);
-} else {
- decr (balance);
- if (balance == 0)
- break;
+{
+ if (cur_mod() > 0) {
+ incr (balance);
+ } else {
+ decr (balance);
+ if (balance == 0)
+ break;
+ }
}
-
@ Four commands are intended to be used only within macro texts: \&{quote},
\.{\#\AT!}, \.{\AT!}, and \.{\AT!\#}. They are variants of a single command
code called |macro_special|.
@@ -19405,11 +19376,11 @@ code called |macro_special|.
@<Put each...@>=
mp_primitive (mp, "quote", mp_macro_special, quote);
-@:quote_}{\&{quote} primitive@>;
+@:quote_}{\&{quote} primitive@>
mp_primitive (mp, "#@@", mp_macro_special, macro_prefix);
-@:]]]\#\AT!_}{\.{\#\AT!} primitive@>;
+@:]]]\#\AT!_}{\.{\#\AT!} primitive@>
mp_primitive (mp, "@@", mp_macro_special, macro_at);
-@:]]]\AT!_}{\.{\AT!} primitive@>;
+@:]]]\AT!_}{\.{\AT!} primitive@>
mp_primitive (mp, "@@#", mp_macro_special, macro_suffix);
@:]]]\AT!\#_}{\.{\AT!\#} primitive@>
@@ -19453,7 +19424,7 @@ RESTART:
delete_str_ref (cur_mod_str());
set_cur_sym(mp->frozen_inaccessible);
mp_ins_error (mp, "Missing symbolic token inserted", hlp, true);
-@.Missing symbolic token...@>;
+@.Missing symbolic token...@>
goto RESTART;
}
}
@@ -19485,7 +19456,7 @@ static void mp_check_equals (MP mp) {
"will be the replacement text of this macro.",
NULL };
mp_back_error (mp, "Missing `=' has been inserted", hlp, true);
-@.Missing `='@>;
+@.Missing `='@>
}
}
@@ -19538,15 +19509,15 @@ static void mp_make_op_def (MP mp) {
@<Put each...@>=
mp_primitive (mp, "expr", mp_param_type, mp_expr_param);
-@:expr_}{\&{expr} primitive@>;
+@:expr_}{\&{expr} primitive@>
mp_primitive (mp, "suffix", mp_param_type, mp_suffix_param);
-@:suffix_}{\&{suffix} primitive@>;
+@:suffix_}{\&{suffix} primitive@>
mp_primitive (mp, "text", mp_param_type, mp_text_param);
-@:text_}{\&{text} primitive@>;
+@:text_}{\&{text} primitive@>
mp_primitive (mp, "primary", mp_param_type, mp_primary_macro);
-@:primary_}{\&{primary} primitive@>;
+@:primary_}{\&{primary} primitive@>
mp_primitive (mp, "secondary", mp_param_type, mp_secondary_macro);
-@:secondary_}{\&{secondary} primitive@>;
+@:secondary_}{\&{secondary} primitive@>
mp_primitive (mp, "tertiary", mp_param_type, mp_tertiary_macro);
@:tertiary_}{\&{tertiary} primitive@>
@@ -19571,10 +19542,10 @@ break;
and \&{vardef}. When the following procedure is called, |cur_mod|
should be either |start_def| or |var_def|.
-Note that although the macro scanner allows |def = := enddef| and
-|def := = enddef|; |def = = enddef| and |def := := enddef| will generate
-an error because by the time the second of the two identical tokens is
-seen, its meaning has already become undefined.
+Note that although the macro scanner allows \&{def} = := \&{enddef} and
+\&{def} := = \&{enddef}; \&{def} = = \&{enddef} and \&{def} := := \&{enddef}
+will generate an error because by the time the second of the two identical
+tokens is seen, its meaning has already become undefined.
@c
static void mp_scan_def (MP mp) {
@@ -19790,7 +19761,7 @@ static void mp_stop_iteration (MP mp);
(Near) infinite recursion is a problem because it translates into
C function calls that eat up the available call stack. A better solution
would be to depend on signal trapping, but that is problematic when
-Metapost is used as a library.
+\MP\ is used as a library.
@<Global...@>=
int expand_depth_count; /* current expansion depth */
@@ -19842,7 +19813,7 @@ static void mp_expand (MP mp) {
show_cur_cmd_mod;
switch (cur_cmd()) {
case mp_if_test:
- mp_conditional (mp); /* this procedure is discussed in Part 36 below */
+ mp_conditional (mp); /* this procedure is discussed in Part ``Conditional processing'' below */
break;
case mp_fi_or_else:
@<Terminate the current conditional and skip to \&{fi}@>;
@@ -19851,10 +19822,10 @@ static void mp_expand (MP mp) {
@<Initiate or terminate input from a file@>;
break;
case mp_iteration:
- if (cur_mod() == end_for) {
- @<Scold the user for having an extra \&{endfor}@>;
- } else {
- mp_begin_iteration (mp); /* this procedure is discussed in Part 37 below */
+ if (cur_mod() == end_for)
+ @<Scold the user for having an extra \&{endfor}@>@;
+ else {
+ mp_begin_iteration (mp); /* this procedure is discussed in Part ``Iterations'' below */
}
break;
case mp_repeat_loop:
@@ -19882,7 +19853,7 @@ static void mp_expand (MP mp) {
break;
default:
break; /* make the compiler happy */
- }; /* there are no other cases */
+ } /* there are no other cases */
mp->expand_depth_count--;
}
@@ -19894,16 +19865,16 @@ static void mp_expand (MP mp) {
"so I had better not try to end anything.",
NULL };
mp_error (mp, "Extra `endfor'", hlp, true);
-@.Extra `endfor'@>;
+@.Extra `endfor'@>
}
-@ The processing of \&{input} involves the |start_input| subroutine,
+@ The processing of \&{input} involves the |mp_start_input| subroutine,
which will be declared later; the processing of \&{endinput} is trivial.
@<Put each...@>=
mp_primitive (mp, "input", mp_input, 0);
-@:input_}{\&{input} primitive@>;
+@:input_}{\&{input} primitive@>
mp_primitive (mp, "endinput", mp_input, 1);
@:end_input_}{\&{endinput} primitive@>
@@ -19937,9 +19908,9 @@ that will be |NULL| if no loop is in progress.
"to want to repeat it. I'll try to forget the problem.",
NULL };
mp_error (mp, "Lost loop", hlp, true);
-@.Lost loop@>;
+@.Lost loop@>
} else {
- mp_resume_iteration (mp); /* this procedure is in Part 37 below */
+ mp_resume_iteration (mp); /* this procedure is in Part ``Iterations'' below */
}
}
@@ -19958,17 +19929,16 @@ that will be |NULL| if no loop is in progress.
mp_error (mp, "No loop is in progress", hlp, true);
else
mp_back_error (mp, "No loop is in progress", hlp, true);
-@.No loop is in progress@>;
- } else {
- @<Exit prematurely from an iteration@>;
- }
+@.No loop is in progress@>
+ } else
+ @<Exit prematurely from an iteration@>@;
} else if (cur_cmd() != mp_semicolon) {
const char *hlp[] = {
"After `exitif <boolean exp>' I expect to see a semicolon.",
"I shall pretend that one was there.",
NULL };
mp_back_error (mp, "Missing `;' has been inserted", hlp, true);
-@.Missing `;'@>;
+@.Missing `;'@>
}
}
@@ -19990,8 +19960,8 @@ is less than |loop_text|.
} while (p == NULL);
if (p != mp->loop_ptr->info)
mp_fatal_error (mp, "*** (loop confusion)");
-@.loop confusion@>;
- mp_stop_iteration (mp); /* this procedure is in Part 34 below */
+@.loop confusion@>
+ mp_stop_iteration (mp); /* this procedure is in Part ``Iterations'' below */
}
@@ -20023,7 +19993,7 @@ is less than |loop_text|.
new_number(new_expr.data.n);
mp_disp_err (mp, NULL);
mp_back_error (mp, "Not a string", hlp, true);
-@.Not a string@>;
+@.Not a string@>
mp_get_x_next (mp);
mp_flush_cur_exp (mp, new_expr);
} else {
@@ -20076,28 +20046,29 @@ if (s != NULL) {
new_number(new_expr.data.n);
mp_disp_err (mp, NULL);
mp_back_error (mp, "Not a string", hlp, true);
- @.Not a string@>;
+ @.Not a string@>
mp_get_x_next (mp);
mp_flush_cur_exp (mp, new_expr);
} else {
mp_back_input (mp);
if (cur_exp_str ()->len > 0) {
char *s = mp->run_script(mp,(const char*) cur_exp_str()->str, cur_exp_str()->len) ;
- @<Run a script@>
+ @<Run a script@>@;
free(s);
}
}
}
-@ The |texscriptmode| parameter controls how spaces and newlines get honoured in
-|btex| or |verbatimtex| ... |etex|. The default value is~1. Possible values are:
-0: no newlines, 1: newlines in |verbatimtex|, 2: newlines in |verbatimtex| and
-|etex|, 3: no leading and trailing strip in |verbatimtex|, 4: no leading and
-trailing strip in |verbatimtex| and |btex|. That way the Lua handler can do what
-it likes. An |etex| has to be followed by a space or |;| or be at the end of a
-line and preceded by a space or at the beginning of a line.
+@ The |texscriptmode| parameter controls how spaces and newlines get honored in
+\&{btex} or \&{verbatimtex} ... \&{etex}. The default value is~1. Possible
+values are: 0: no newlines, 1: newlines in \&{verbatimtex}, 2: newlines in
+\&{verbatimtex} and \&{etex}, 3: no leading and trailing strip in
+\&{verbatimtex}, 4: no leading and trailing strip in \&{verbatimtex} and
+\&{btex}. That way the Lua handler can do what it likes. An \&{etex} has to be
+followed by a space or |;| or be at the end of a line and preceded by a space
+or at the beginning of a line.
-@<Pass btex ... etex to script@>=
+@<Pass \&{btex} ... \&{etex} to script@>=
{
char *txt = NULL;
char *ptr = NULL;
@@ -20141,7 +20112,7 @@ line and preceded by a space or at the beginning of a line.
/* we're past the 'x' */
break;
} else {
- /* this is no valid etex */
+ /* this is no valid \&{etex} */
done = 0;
}
} else {
@@ -20156,7 +20127,7 @@ line and preceded by a space or at the beginning of a line.
}
}
}
- /* no etex seen (yet) */
+ /* no \&{etex} seen (yet) */
if (loc >= limit) {
if (size) {
txt = realloc(txt, size + limit - first + 1);
@@ -20168,10 +20139,10 @@ line and preceded by a space or at the beginning of a line.
if (mode <= 0) {
txt[size - 1] = ' ';
} else if (verb) {
- /* modes $\geq 1$ permit a newline in verbatimtex */
+ /* modes $\geq 1$ permit a newline in \&{verbatimtex} */
txt[size - 1] = '\n';
} else if (mode >= 2) {
- /* modes $\geq 2$ permit a newline in btex */
+ /* modes $\geq 2$ permit a newline in \&{btex} */
txt[size - 1] = '\n';
} else {
txt[size - 1] = ' ';
@@ -20189,12 +20160,12 @@ line and preceded by a space or at the beginning of a line.
/* we're past the 'x' */
int l = loc - 5 ; // 4
int n = l - first + 1 ;
- /* we're before the 'etex' */
+ /* we're before the \&{etex} */
if (done == 2) {
- /* we had ' etex' */
+ /* we had \&{etex} */
l -= 1;
n -= 1;
- /* we're before the ' etex' */
+ /* we're before the \&{etex} */
}
if (size) {
txt = realloc(txt, size + n + 1);
@@ -20204,11 +20175,11 @@ line and preceded by a space or at the beginning of a line.
(void) memcpy (txt + size, mp->buffer + first, n); /* 0 */
size += n;
if (verb && mode >= 3) {
- /* don't strip verbatimtex */
+ /* don't strip \&{verbatimtex} */
txt[size] = '\0';
ptr = txt;
} else if (mode >= 4) {
- /* don't strip btex */
+ /* don't strip \&{btex} */
txt[size] = '\0';
ptr = txt;
} else {
@@ -20229,7 +20200,7 @@ line and preceded by a space or at the beginning of a line.
/* action */
{
char *s = mp->make_text(mp,ptr,size,verb) ;
- @<Run a script@>
+ @<Run a script@>@;
free(s);
}
free(txt);
@@ -20243,7 +20214,7 @@ line and preceded by a space or at the beginning of a line.
*/
FATAL_ERROR:
{
- /* line numbers are not always meaningfull so we can get a 0 reported */
+ /* line numbers are not always meaningful so we can get a 0 reported */
char msg[256];
const char *hlp[] = { "An 'etex' is missing at this input level, nothing gets done.", NULL };
if (slin > 0) {
@@ -20273,14 +20244,14 @@ line and preceded by a space or at the beginning of a line.
new_number(new_expr.data.n);
mp_disp_err (mp, NULL);
mp_back_error (mp, "Not a string", hlp, true);
- @.Not a string@>;
+ @.Not a string@>
mp_get_x_next (mp);
mp_flush_cur_exp (mp, new_expr);
} else {
mp_back_input (mp);
if (cur_exp_str ()->len > 0) {
char *s = mp->make_text(mp,(const char*) cur_exp_str()->str,cur_exp_str()->len,0) ;
- @<Run a script@>
+ @<Run a script@>@;
free(s);
}
}
@@ -20390,13 +20361,11 @@ void mp_macro_call (MP mp, mp_node def_ref, mp_node arg_list, mp_sym macro_name)
add_mac_ref (def_ref);
if (arg_list == NULL) {
n = 0;
- } else {
+ } else
@<Determine the number |n| of arguments already supplied,
- and set |tail| to the tail of |arg_list|@>;
- }
- if (number_positive (internal_value (mp_tracing_macros))) {
- @<Show the text of the macro being expanded, and the existing arguments@>;
- }
+ and set |tail| to the tail of |arg_list|@>@;
+ if (number_positive (internal_value (mp_tracing_macros)))
+ @<Show the text of the macro being expanded, and the existing arguments@>@;
@<Scan the remaining arguments, if any; set |r| to the first token
of the replacement text@>;
@<Feed the arguments and replacement text to the scanner@>;
@@ -20404,24 +20373,25 @@ void mp_macro_call (MP mp, mp_node def_ref, mp_node arg_list, mp_sym macro_name)
@ @<Show the text of the macro...@>=
-mp_begin_diagnostic (mp);
-mp_print_ln (mp);
-mp_print_macro_name (mp, arg_list, macro_name);
-if (n == 3)
- mp_print (mp, "@@#"); /* indicate a suffixed macro */
-mp_show_macro (mp, def_ref, NULL, 100000);
-if (arg_list != NULL) {
- n = 0;
- p = arg_list;
- do {
- q = (mp_node)mp_sym_sym (p);
- mp_print_arg (mp, q, n, 0, 0);
- incr (n);
- p = mp_link (p);
- } while (p != NULL);
+{
+ mp_begin_diagnostic (mp);
+ mp_print_ln (mp);
+ mp_print_macro_name (mp, arg_list, macro_name);
+ if (n == 3)
+ mp_print (mp, "@@#"); /* indicate a suffixed macro */
+ mp_show_macro (mp, def_ref, NULL, 100000);
+ if (arg_list != NULL) {
+ n = 0;
+ p = arg_list;
+ do {
+ q = (mp_node)mp_sym_sym (p);
+ mp_print_arg (mp, q, n, 0, 0);
+ incr (n);
+ p = mp_link (p);
+ } while (p != NULL);
+ }
+ mp_end_diagnostic (mp, false);
}
-mp_end_diagnostic (mp, false)
-
@ @<Declarations@>=
static void mp_print_macro_name (MP mp, mp_node a, mp_sym n);
@@ -20504,13 +20474,12 @@ if (cur_cmd() == mp_comma) {
mp_snprintf (msg, 256, "Too many arguments to %s; Missing `%s' has been inserted",
mp_str(mp, rname), mp_str(mp, text(r_delim)));
delete_str_ref(rname);
-@.Too many arguments...@>;
-@.Missing `)'...@>;
+@.Too many arguments...@>
+@.Missing `)'...@>
mp_error (mp, msg, hlp, true);
}
-if (mp_sym_info (r) != mp_general_macro) {
- @<Scan undelimited argument(s)@>;
-}
+if (mp_sym_info (r) != mp_general_macro)
+ @<Scan undelimited argument(s)@>@;
r = mp_link (r)
@@ -20540,10 +20509,10 @@ if (cur_cmd() != mp_comma) {
sname = mp_make_string(mp);
mp->selector = old_setting;
mp_snprintf (msg, 256, "Missing argument to %s", mp_str(mp, sname));
-@.Missing argument...@>;
+@.Missing argument...@>
delete_str_ref(sname);
if (mp_name_type (r) == mp_suffix_sym || mp_name_type (r) == mp_text_sym) {
- set_cur_exp_value_number (zero_t); /* todo: this was |null| */
+ set_cur_exp_value_number (zero_t); /* TODO: this was |NULL| */
mp->cur_exp.type = mp_token_list;
} else {
set_cur_exp_value_number (zero_t);
@@ -20558,7 +20527,7 @@ if (cur_cmd() != mp_comma) {
}
@<Scan the argument represented by |mp_sym_info(r)|@>;
if (cur_cmd() != mp_comma)
- @<Check that the proper right delimiter was present@>;
+ @<Check that the proper right delimiter was present@>@;
FOUND:
@<Append the current expression to |arg_list|@>
@@ -20574,7 +20543,7 @@ if ((cur_cmd() != mp_right_delimiter) || (equiv_sym (cur_sym()) != l_delim)) {
"You might want to delete some tokens before continuing.",
NULL };
mp_back_error (mp, "Missing `,' has been inserted", hlp, true);
-@.Missing `,'@>;
+@.Missing `,'@>
set_cur_cmd((mp_variable_type)mp_comma);
} else {
char msg[256];
@@ -20583,7 +20552,7 @@ if ((cur_cmd() != mp_right_delimiter) || (equiv_sym (cur_sym()) != l_delim)) {
"You might want to delete some tokens before continuing.",
NULL };
mp_snprintf(msg, 256, "Missing `%s' has been inserted", mp_str(mp, text(r_delim)));
-@.Missing `)'@>;
+@.Missing `)'@>
mp_back_error (mp, msg, hlp, true);
}
}
@@ -20645,11 +20614,10 @@ void mp_scan_text_arg (MP mp, mp_sym l_delim, mp_sym r_delim) {
mp_link (mp->hold_head) = NULL;
while (1) {
get_t_next (mp);
- if (l_delim == NULL) {
- @<Adjust the balance for an undelimited argument; |break| if done@>;
- } else {
- @<Adjust the balance for a delimited argument; |break| if done@>;
- }
+ if (l_delim == NULL)
+ @<Adjust the balance for an undelimited argument; |break| if done@>@;
+ else
+ @<Adjust the balance for a delimited argument; |break| if done@>@;
mp_link (p) = mp_cur_tok (mp);
p = mp_link (p);
}
@@ -20660,27 +20628,31 @@ void mp_scan_text_arg (MP mp, mp_sym l_delim, mp_sym r_delim) {
@ @<Adjust the balance for a delimited argument...@>=
-if (cur_cmd() == mp_right_delimiter) {
- if (equiv_sym (cur_sym()) == l_delim) {
- decr (balance);
- if (balance == 0)
- break;
+{
+ if (cur_cmd() == mp_right_delimiter) {
+ if (equiv_sym (cur_sym()) == l_delim) {
+ decr (balance);
+ if (balance == 0)
+ break;
+ }
+ } else if (cur_cmd() == mp_left_delimiter) {
+ if (equiv_sym (cur_sym()) == r_delim)
+ incr (balance);
}
-} else if (cur_cmd() == mp_left_delimiter) {
- if (equiv_sym (cur_sym()) == r_delim)
- incr (balance);
}
@ @<Adjust the balance for an undelimited...@>=
-if (mp_end_of_statement) { /* |cur_cmd=semicolon|, |end_group|, or |stop| */
- if (balance == 1) {
- break;
- } else {
- if (cur_cmd() == mp_end_group)
- decr (balance);
+{
+ if (mp_end_of_statement) { /* |cur_cmd=semicolon|, |end_group|, or |stop| */
+ if (balance == 1) {
+ break;
+ } else {
+ if (cur_cmd() == mp_end_group)
+ decr (balance);
+ }
+ } else if (cur_cmd() == mp_begin_group) {
+ incr (balance);
}
-} else if (cur_cmd() == mp_begin_group) {
- incr (balance);
}
@ @<Scan undelimited argument(s)@>=
@@ -20749,7 +20721,7 @@ if (mp_end_of_statement) { /* |cur_cmd=semicolon|, |end_group|, or |stop
mp->selector = old_setting;
mp_snprintf (msg, 256, "Missing `of' has been inserted for %s", mp_str(mp, sname));
delete_str_ref(sname);
-@.Missing `of'@>;
+@.Missing `of'@>
mp_back_error (mp, msg, hlp, true);
}
mp_get_x_next (mp);
@@ -20775,7 +20747,7 @@ if (mp_end_of_statement) { /* |cur_cmd=semicolon|, |end_group|, or |stop
"You might want to delete some tokens before continuing.",
NULL };
mp_snprintf(msg, 256, "Missing `%s' has been inserted", mp_str (mp, text (r_delim)));
-@.Missing `)'@>;
+@.Missing `)'@>
mp_back_error (mp, msg, hlp, true);
}
mp_get_x_next (mp);
@@ -20851,13 +20823,12 @@ corresponding |if_line|.
@<MPlib internal header stuff@>=
typedef struct mp_if_node_data {
- NODE_BODY;
+ NODE_BODY;@+@t}\6{@>
int if_line_field_;
} mp_if_node_data;
typedef struct mp_if_node_data *mp_if_node;
-@
-@d if_node_size sizeof(struct mp_if_node_data) /* number of words in stack entry for conditionals */
+@ @d if_node_size sizeof(struct mp_if_node_data) /* number of words in stack entry for conditionals */
@c
static mp_node mp_get_if_node (MP mp) {
@@ -20881,12 +20852,12 @@ mp->if_line = 0;
@ @<Put each...@>=
mp_primitive (mp, "if", mp_if_test, if_code);
-@:if_}{\&{if} primitive@>;
+@:if_}{\&{if} primitive@>
mp_primitive (mp, "fi", mp_fi_or_else, fi_code);
mp->frozen_fi = mp_frozen_primitive (mp, "fi", mp_fi_or_else, fi_code);
-@:fi_}{\&{fi} primitive@>;
+@:fi_}{\&{fi} primitive@>
mp_primitive (mp, "else", mp_fi_or_else, else_code);
-@:else_}{\&{else} primitive@>;
+@:else_}{\&{else} primitive@>
mp_primitive (mp, "elseif", mp_fi_or_else, else_if_code);
@:else_if_}{\&{elseif} primitive@>
@@ -20934,10 +20905,9 @@ void mp_pass_text (MP mp) {
if (cur_mod() == fi_code)
decr (l);
}
- } else {
+ } else
@<Decrease the string reference count,
- if the current token is a string@>;
- }
+ if the current token is a string@>@;
}
mp->scanner_status = normal;
}
@@ -20991,7 +20961,7 @@ static void mp_change_if_limit (MP mp, quarterword l, mp_node p) {
while (1) {
if (q == NULL)
mp_confusion (mp, "if");
-@:this can't happen if}{\quad if@>;
+@:this can't happen if}{\quad if@>
/* clang: dereference of null pointer */ assert(q);
if (mp_link (q) == p) {
mp_type (q) = l;
@@ -21014,7 +20984,7 @@ static void mp_check_colon (MP mp) {
"I shall pretend that one was there.",
NULL };
mp_back_error (mp, "Missing `:' has been inserted", hlp, true);
-@.Missing `:'@>;
+@.Missing `:'@>
}
}
@@ -21042,7 +21012,7 @@ FOUND:
if (cur_exp_value_boolean () == mp_true_code) {
mp_change_if_limit (mp, (quarterword) new_if_limit, save_cond_ptr);
return; /* wait for \&{elseif}, \&{else}, or \&{fi} */
- };
+ }
@<Skip to \&{elseif} or \&{else} or \&{fi}, then |goto done|@>;
DONE:
mp->cur_if = (quarterword) cur_mod();
@@ -21097,12 +21067,12 @@ if (cur_mod() > mp->if_limit) {
mp_back_input (mp);
set_cur_sym(mp->frozen_colon);
mp_ins_error (mp, "Missing `:' has been inserted", hlp, true);
-@.Missing `:'@>;
+@.Missing `:'@>
} else {
const char *hlp[] = {"I'm ignoring this; it doesn't match any if.", NULL};
if (cur_mod() == fi_code) {
mp_error(mp, "Extra fi", hlp, true);
-@.Extra fi@>;
+@.Extra fi@>
} else if (cur_mod() == else_code) {
mp_error(mp, "Extra else", hlp, true);
@.Extra else@>
@@ -21158,7 +21128,7 @@ typedef struct mp_loop_data {
mp_node type; /* the special type of this loop, or a pointer into
mem */
mp_node list; /* the remaining list elements */
- mp_node list_start; /* head fo the list of elements */
+ mp_node list_start; /* head of the list of elements */
mp_number old_value; /* previous value of current arithmetic value */
mp_number value; /* current arithmetic value */
mp_number step_size; /* arithmetic step size */
@@ -21190,7 +21160,7 @@ static void mp_bad_for (MP mp, const char *s) {
mp_disp_err (mp, NULL);
/* show the bad expression above the message */
mp_snprintf(msg, 256, "Improper %s has been replaced by 0", s);
-@.Improper...replaced by 0@>;
+@.Improper...replaced by 0@>
mp_back_error (mp, msg, hlp, true);
mp_get_x_next (mp);
mp_flush_cur_exp (mp, new_expr);
@@ -21239,9 +21209,9 @@ void mp_begin_iteration (MP mp) {
p->value_mod = mp_suffix_sym;
}
mp_get_x_next (mp);
- if (p->value_mod == mp_expr_sym && cur_cmd() == mp_within_token) {
- @<Set up a picture iteration@>;
- } else {
+ if (p->value_mod == mp_expr_sym && cur_cmd() == mp_within_token)
+ @<Set up a picture iteration@>@;
+ else {
@<Check for the assignment in a loop header@>;
@<Scan the values to be used in the loop@>;
}
@@ -21260,7 +21230,7 @@ if ((cur_cmd() != mp_equals) && (cur_cmd() != mp_assignment)) {
"was present, and I'll look for the values next.",
NULL };
mp_back_error (mp, "Missing `=' has been inserted", hlp, true);
-@.Missing `='@>;
+@.Missing `='@>
}
@ @<Check for the presence of a colon@>=
@@ -21271,7 +21241,7 @@ if (cur_cmd() != mp_colon) {
"everything from here to `endfor' will be iterated.",
NULL };
mp_back_error (mp, "Missing `:' has been inserted", hlp, true);
-@.Missing `:'@>;
+@.Missing `:'@>
}
@ We append a special |mp->frozen_repeat_loop| token in place of the
@@ -21292,7 +21262,7 @@ mp->warning_info = n;
s->info = mp_scan_toks (mp, mp_iteration, p, q, 0);
mp->scanner_status = normal;
s->link = mp->loop_ptr;
-mp->loop_ptr = s
+mp->loop_ptr = s@;
@ @<Initialize table...@>=
mp->frozen_repeat_loop =
@@ -21356,10 +21326,9 @@ void mp_resume_iteration (MP mp) {
} else if (p == MP_VOID) {
mp_begin_token_list (mp, mp->loop_ptr->info, (quarterword) forever_text);
return;
- } else {
+ } else
@<Make |q| a capsule containing the next picture component from
- |loop_list(loop_ptr)| or |goto not_found|@>;
- }
+ |loop_list(loop_ptr)| or |goto not_found|@>@;
mp_begin_token_list (mp, mp->loop_ptr->info, (quarterword) loop_text);
mp_stack_argument (mp, q);
if (number_greater (internal_value (mp_tracing_commands), unity_t)) {
@@ -21381,7 +21350,7 @@ NOT_FOUND:
{
mp_begin_diagnostic (mp);
mp_print_nl (mp, "{loop value=");
-@.loop value=n@>;
+@.loop value=n@>
if ((q != NULL) && (mp_link (q) == MP_VOID))
mp_print_exp (mp, q, 1);
else
@@ -21490,7 +21459,7 @@ do {
mp->cur_exp.type = mp_vacuous;
CONTINUE:
;
-} while (cur_cmd() == mp_comma)
+} while (cur_cmd() == mp_comma)@;
@ @<Prepare for step-until construction and |break|@>=
{
@@ -21509,7 +21478,7 @@ CONTINUE:
"So I'll look for the final value and colon next.",
NULL };
mp_back_error (mp, "Missing `until' has been inserted", hlp, true);
-@.Missing `until'@>;
+@.Missing `until'@>
}
mp_get_x_next (mp);
mp_scan_expression (mp);
@@ -21646,7 +21615,7 @@ of the occurrences of area and extension delimiters.
integer area_delimiter;
/* most recent `\.>' or `\.:' relative to |str_start[str_ptr]| */
integer ext_delimiter; /* the relevant `\..', if any */
-boolean quoted_filename; /* whether the filename is wrapped in " markers */
+boolean quoted_filename; /* whether the filename is wrapped in `\."' markers */
@ Here now is the first of the system-dependent routines for file name scanning.
@^system dependencies@>
@@ -21704,7 +21673,7 @@ boolean mp_more_name (MP mp, ASCII_code c) {
void mp_end_name (MP mp) {
size_t s = 0; /* length of area, name, and extension */
size_t len;
- /* "my/w.mp" */
+ /* \.{"my/w.mp"} */
if (mp->area_delimiter < 0) {
mp->cur_area = xstrdup ("");
} else {
@@ -21866,7 +21835,7 @@ boolean mp_open_mem_file (MP mp) {
wterm (mp->mem_name);
wterm ("' preload file; will try 'plain'.");
wterm_cr;
-@.Sorry, I can't find...@>;
+@.Sorry, I can't find...@>
update_terminal();
/* now pull out all the stops: try for the system \.{plain} file */
xfree (mp->mem_name);
@@ -21877,7 +21846,7 @@ boolean mp_open_mem_file (MP mp) {
wake_up_terminal();
wterm_ln ("I can't find the 'plain' preload file!\n");
@.I can't find PLAIN...@>
-@.plain@>;
+@.plain@>
return false;
}
@@ -21889,7 +21858,7 @@ ideally be changed to deduce the full name of file~|f|, which is the file
most recently opened, if it is possible to do this.
@^system dependencies@>
-@ @c
+@c
static mp_string mp_make_name_string (MP mp) {
int k; /* index into |name_of_file| */
int name_length = (int) strlen (mp->name_of_file);
@@ -22010,7 +21979,7 @@ if (opt->noninteractive) {
}
mp->log_opened = false;
-@ Cannot do this earlier because at the |<Allocate or ...>|, the string
+@ Cannot do this earlier because at the |@<Allocate or ...@>| block, the string
pool is not yet initialized.
@<Fix up |mp->internal[mp_job_name]|@>=
@@ -22077,10 +22046,10 @@ void mp_prompt_file_name (MP mp, const char *s, const char *e) {
mp_show_context (mp);
mp_print_nl (mp, "Please type another ");
mp_print (mp, s);
-@.Please type...@>;
+@.Please type...@>
if (mp->noninteractive || mp->interaction < mp_scroll_mode)
mp_fatal_error (mp, "*** (job aborted, file error in nonstop mode)");
-@.job aborted, file error...@>;
+@.job aborted, file error...@>
saved_cur_name = xstrdup (mp->cur_name);
clear_terminal();
prompt_input (": ");
@@ -22132,9 +22101,8 @@ void mp_open_log_file (MP mp) {
@<Fix up |mp->internal[mp_job_name]|@>;
}
mp_pack_job_name (mp, ".log");
- while (!mp_open_out (mp, &mp->log_file, mp_filetype_log)) {
- @<Try to get a different log file name@>;
- }
+ while (!mp_open_out (mp, &mp->log_file, mp_filetype_log))
+ @<Try to get a different log file name@>@;
mp->log_name = xstrdup (mp->name_of_file);
mp->selector = log_only;
mp->log_opened = true;
@@ -22143,7 +22111,7 @@ void mp_open_log_file (MP mp) {
/* make sure bottom level is in memory */
if (!mp->noninteractive) {
mp_print_nl (mp, "**");
-@.**@>;
+@.**@>
l = mp->input_stack[0].limit_field - 1; /* last position of first line */
for (k = 0; k <= l; k++)
mp_print_char (mp, mp->buffer[k]);
@@ -22269,7 +22237,7 @@ than just a copy of its argument and the full file name is needed for opening
@<Flush |name| and replace it with |cur_name| if it won't be needed@>=
mp_flush_string (mp, name);
name = mp_rts (mp, mp->cur_name);
-xfree (mp->cur_name)
+xfree (mp->cur_name)@;
@ If the file is empty, it is considered to contain a single blank line,
@@ -22296,7 +22264,7 @@ if (token_state) {
"Please delete the tokens and insert the name again.",
NULL };
mp_error (mp, "File names can't appear within macros", hlp, true);
-@.File names can't...@>;
+@.File names can't...@>
}
if (file_state) {
mp_scan_file_name (mp);
@@ -22347,7 +22315,7 @@ available to perform the function of \.{DVItoMP}.)
@^system dependencies@>
@ @<Exported types@>=
-typedef int (*mp_makempx_cmd) (MP mp, char *origname, char *mtxname);
+typedef int @[@] (*mp_makempx_cmd) (MP mp, char *origname, char *mtxname);
@ @<Option variables@>=
mp_makempx_cmd run_make_mpx;
@@ -22494,7 +22462,7 @@ recovery.
cur_exp_node() = NULL;
cur_exp_str() = NULL;
cur_exp_knot() = NULL;
- } while (0)
+ } while (0)@;
@d set_cur_exp_value_boolean(A) do {
if (cur_exp_str()) {
delete_str_ref(cur_exp_str());
@@ -22503,7 +22471,7 @@ recovery.
cur_exp_node() = NULL;
cur_exp_str() = NULL;
cur_exp_knot() = NULL;
- } while (0)
+ } while (0)@;
@d set_cur_exp_value_number(A) do {
if (cur_exp_str()) {
delete_str_ref(cur_exp_str());
@@ -22512,7 +22480,7 @@ recovery.
cur_exp_node() = NULL;
cur_exp_str() = NULL;
cur_exp_knot() = NULL;
- } while (0)
+ } while (0)@;
@d set_cur_exp_node(A) do {
if (cur_exp_str()) {
delete_str_ref(cur_exp_str());
@@ -22521,7 +22489,7 @@ recovery.
cur_exp_str() = NULL;
cur_exp_knot() = NULL;
set_number_to_zero (mp->cur_exp.data.n);
- } while (0)
+ } while (0)@;
@d set_cur_exp_str(A) do {
if (cur_exp_str()) {
delete_str_ref(cur_exp_str());
@@ -22531,7 +22499,7 @@ recovery.
cur_exp_node() = NULL;
cur_exp_knot() = NULL;
set_number_to_zero (mp->cur_exp.data.n);
- } while (0)
+ } while (0)@;
@d set_cur_exp_knot(A) do {
if (cur_exp_str()) {
delete_str_ref(cur_exp_str());
@@ -22540,7 +22508,7 @@ recovery.
cur_exp_node() = NULL;
cur_exp_str() = NULL;
set_number_to_zero (mp->cur_exp.data.n);
- } while (0)
+ } while (0)@;
@ @<Glob...@>=
@@ -23025,7 +22993,7 @@ if (verbosity <= 1) {
mp_print_type (mp, t);
mp_print (mp, " (see the transcript file)");
mp->selector = term_and_log;
- };
+ }
switch (t) {
case mp_pen_type:
mp_print_pen (mp, value_knot (p), "", false);
@@ -23065,7 +23033,7 @@ the ring consists entirely of capsules.
while ((mp_name_type (v) == mp_capsule) && (v != p))
v = value_node (v);
mp_print_variable_name (mp, v);
- };
+ }
}
@@ -23081,7 +23049,7 @@ void mp_disp_err (MP mp, mp_node p) {
if (mp->interaction == mp_error_stop_mode)
wake_up_terminal();
mp_print_nl (mp, ">> ");
-@.>>@>;
+@.>>@>
mp_print_exp (mp, p, 1); /* ``medium verbose'' printing of the expression */
}
@@ -23092,7 +23060,7 @@ to |known| and stores a given value in |cur_exp|. We can think of |cur_type|
and |cur_exp| as either alive or dormant after this has been done,
because |cur_exp| will not contain a pointer value.
-@ @c
+@c
void mp_flush_cur_exp (MP mp, mp_value v) {
if (is_number(mp->cur_exp.data.n)) {
free_number(mp->cur_exp.data.n);
@@ -23984,7 +23952,7 @@ static void mp_bad_exp (MP mp, const char *s) {
"delete this zero and insert something else;",
"see Chapter 27 of The METAFONTbook for an example.",
NULL };
-@:METAFONTbook}{\sl The {\logos METAFONT\/}book@>;
+@:METAFONTbook}{\sl The {\logos METAFONT\/}book@>
{
mp_string cm;
int old_selector = mp->selector;
@@ -24064,7 +24032,7 @@ relation |tt=mp_type(q)| will always hold. If |tt=undefined|, the routine
doesn't bother to update its information about type. And if
|undefined<tt<mp_unsuffixed_macro|, the precise value of |tt| isn't critical.
-@ @<Scan a variable primary...@>=
+@<Scan a variable primary...@>=
{
mp_node p, q; /* for list manipulation */
mp_node t; /* a token */
@@ -24248,7 +24216,7 @@ static void mp_bad_subscript (MP mp) {
new_number(new_expr.data.n);
mp_disp_err(mp, NULL);
mp_error (mp, "Improper subscript has been replaced by zero", hlp, true);
-@.Improper subscript...@>;
+@.Improper subscript...@>
mp_flush_cur_exp (mp, new_expr);
}
@@ -24280,7 +24248,7 @@ static char *mp_obliterated (MP mp, mp_node q) {
sname = mp_make_string(mp);
mp->selector = old_setting;
mp_snprintf(msg, 256, "Variable %s has been obliterated", mp_str(mp, sname));
-@.Variable...obliterated@>;
+@.Variable...obliterated@>
delete_str_ref(sname);
return xstrdup(msg);
}
@@ -24407,7 +24375,7 @@ RESTART:
break;
default:
mp_confusion (mp, "copy");
-@:this can't happen copy}{\quad copy@>;
+@:this can't happen copy}{\quad copy@>
break;
}
}
@@ -24523,7 +24491,7 @@ RESTART:
if ((cur_cmd() < mp_min_primary_command) ||
(cur_cmd() > mp_max_primary_command))
mp_bad_exp (mp, "A secondary");
-@.A secondary expression...@>;
+@.A secondary expression...@>
mp_scan_primary (mp);
CONTINUE:
if (cur_cmd() <= mp_max_secondary_command &&
@@ -24579,7 +24547,7 @@ RESTART:
if ((cur_cmd() < mp_min_primary_command) ||
(cur_cmd() > mp_max_primary_command))
mp_bad_exp (mp, "A tertiary");
-@.A tertiary expression...@>;
+@.A tertiary expression...@>
mp_scan_secondary (mp);
CONTINUE:
if (cur_cmd() <= mp_max_tertiary_command) {
@@ -24623,7 +24591,7 @@ RESTART:
if ((cur_cmd() < mp_min_primary_command) ||
(cur_cmd() > mp_max_primary_command))
mp_bad_exp (mp, "An");
-@.An expression...@>;
+@.An expression...@>
mp_scan_tertiary (mp);
CONTINUE:
if (cur_cmd() <= mp_max_expression_command) {
@@ -24803,7 +24771,7 @@ CONTINUE_PATH:
set_number_to_unity(y);
mp_back_input (mp); /* default tension */
goto DONE;
- };
+ }
if (cur_cmd() != mp_path_join) {
const char *hlp[] = { "A path join command should end with two dots.", NULL};
mp_back_error (mp, "Missing `..' has been inserted", hlp, true);
@@ -24877,7 +24845,7 @@ CONTINUE_PATH:
"So I'm going to pretend that you said `p..q' instead.",
NULL };
mp_back_error (mp, "Paths don't touch; `&' will be changed to `..'", hlp, true);
-@.Paths don't touch@>;
+@.Paths don't touch@>
mp_get_x_next (mp);
d = mp_path_join;
set_number_to_unity (path_q->right_tension);
@@ -24925,7 +24893,7 @@ CONTINUE_PATH:
if (t != mp_open) {
number_clone (pp->left_x, x);
mp_left_type (pp) = (unsigned short) t;
- };
+ }
}
path_q = qq;
@@ -25169,7 +25137,7 @@ supposed to be either |true_code| or |false_code|.
if (mp->cur_exp.type != mp_boolean_type) {
do_boolean_error(mp);
}
-} while (0)
+} while (0)@;
@<Declare the basic parsing subroutines@>=
static void do_boolean_error (MP mp) {
@@ -25211,218 +25179,218 @@ operation it performs is a |primary_binary| or |secondary_binary|, etc.
@<Put each...@>=
mp_primitive (mp, "true", mp_nullary, mp_true_code);
-@:true_}{\&{true} primitive@>;
+@:true_}{\&{true} primitive@>
mp_primitive (mp, "false", mp_nullary, mp_false_code);
-@:false_}{\&{false} primitive@>;
+@:false_}{\&{false} primitive@>
mp_primitive (mp, "nullpicture", mp_nullary, mp_null_picture_code);
-@:null_picture_}{\&{nullpicture} primitive@>;
+@:null_picture_}{\&{nullpicture} primitive@>
mp_primitive (mp, "nullpen", mp_nullary, mp_null_pen_code);
-@:null_pen_}{\&{nullpen} primitive@>;
+@:null_pen_}{\&{nullpen} primitive@>
mp_primitive (mp, "readstring", mp_nullary, mp_read_string_op);
-@:read_string_}{\&{readstring} primitive@>;
+@:read_string_}{\&{readstring} primitive@>
mp_primitive (mp, "pencircle", mp_nullary, mp_pen_circle);
-@:pen_circle_}{\&{pencircle} primitive@>;
+@:pen_circle_}{\&{pencircle} primitive@>
mp_primitive (mp, "normaldeviate", mp_nullary, mp_normal_deviate);
-@:normal_deviate_}{\&{normaldeviate} primitive@>;
+@:normal_deviate_}{\&{normaldeviate} primitive@>
mp_primitive (mp, "readfrom", mp_unary, mp_read_from_op);
-@:read_from_}{\&{readfrom} primitive@>;
+@:read_from_}{\&{readfrom} primitive@>
mp_primitive (mp, "closefrom", mp_unary, mp_close_from_op);
-@:close_from_}{\&{closefrom} primitive@>;
+@:close_from_}{\&{closefrom} primitive@>
mp_primitive (mp, "odd", mp_unary, mp_odd_op);
-@:odd_}{\&{odd} primitive@>;
+@:odd_}{\&{odd} primitive@>
mp_primitive (mp, "known", mp_unary, mp_known_op);
-@:known_}{\&{known} primitive@>;
+@:known_}{\&{known} primitive@>
mp_primitive (mp, "unknown", mp_unary, mp_unknown_op);
-@:unknown_}{\&{unknown} primitive@>;
+@:unknown_}{\&{unknown} primitive@>
mp_primitive (mp, "not", mp_unary, mp_not_op);
-@:not_}{\&{not} primitive@>;
+@:not_}{\&{not} primitive@>
mp_primitive (mp, "decimal", mp_unary, mp_decimal);
-@:decimal_}{\&{decimal} primitive@>;
+@:decimal_}{\&{decimal} primitive@>
mp_primitive (mp, "reverse", mp_unary, mp_reverse);
-@:reverse_}{\&{reverse} primitive@>;
+@:reverse_}{\&{reverse} primitive@>
mp_primitive (mp, "makepath", mp_unary, mp_make_path_op);
-@:make_path_}{\&{makepath} primitive@>;
+@:make_path_}{\&{makepath} primitive@>
mp_primitive (mp, "makepen", mp_unary, mp_make_pen_op);
-@:make_pen_}{\&{makepen} primitive@>;
+@:make_pen_}{\&{makepen} primitive@>
mp_primitive (mp, "oct", mp_unary, mp_oct_op);
-@:oct_}{\&{oct} primitive@>;
+@:oct_}{\&{oct} primitive@>
mp_primitive (mp, "hex", mp_unary, mp_hex_op);
-@:hex_}{\&{hex} primitive@>;
+@:hex_}{\&{hex} primitive@>
mp_primitive (mp, "ASCII", mp_unary, mp_ASCII_op);
-@:ASCII_}{\&{ASCII} primitive@>;
+@:ASCII_}{\&{ASCII} primitive@>
mp_primitive (mp, "char", mp_unary, mp_char_op);
-@:char_}{\&{char} primitive@>;
+@:char_}{\&{char} primitive@>
mp_primitive (mp, "length", mp_unary, mp_length_op);
-@:length_}{\&{length} primitive@>;
+@:length_}{\&{length} primitive@>
mp_primitive (mp, "turningnumber", mp_unary, mp_turning_op);
-@:turning_number_}{\&{turningnumber} primitive@>;
+@:turning_number_}{\&{turningnumber} primitive@>
mp_primitive (mp, "xpart", mp_unary, mp_x_part);
-@:x_part_}{\&{xpart} primitive@>;
+@:x_part_}{\&{xpart} primitive@>
mp_primitive (mp, "ypart", mp_unary, mp_y_part);
-@:y_part_}{\&{ypart} primitive@>;
+@:y_part_}{\&{ypart} primitive@>
mp_primitive (mp, "xxpart", mp_unary, mp_xx_part);
-@:xx_part_}{\&{xxpart} primitive@>;
+@:xx_part_}{\&{xxpart} primitive@>
mp_primitive (mp, "xypart", mp_unary, mp_xy_part);
-@:xy_part_}{\&{xypart} primitive@>;
+@:xy_part_}{\&{xypart} primitive@>
mp_primitive (mp, "yxpart", mp_unary, mp_yx_part);
-@:yx_part_}{\&{yxpart} primitive@>;
+@:yx_part_}{\&{yxpart} primitive@>
mp_primitive (mp, "yypart", mp_unary, mp_yy_part);
-@:yy_part_}{\&{yypart} primitive@>;
+@:yy_part_}{\&{yypart} primitive@>
mp_primitive (mp, "redpart", mp_unary, mp_red_part);
-@:red_part_}{\&{redpart} primitive@>;
+@:red_part_}{\&{redpart} primitive@>
mp_primitive (mp, "greenpart", mp_unary, mp_green_part);
-@:green_part_}{\&{greenpart} primitive@>;
+@:green_part_}{\&{greenpart} primitive@>
mp_primitive (mp, "bluepart", mp_unary, mp_blue_part);
-@:blue_part_}{\&{bluepart} primitive@>;
+@:blue_part_}{\&{bluepart} primitive@>
mp_primitive (mp, "cyanpart", mp_unary, mp_cyan_part);
-@:cyan_part_}{\&{cyanpart} primitive@>;
+@:cyan_part_}{\&{cyanpart} primitive@>
mp_primitive (mp, "magentapart", mp_unary, mp_magenta_part);
-@:magenta_part_}{\&{magentapart} primitive@>;
+@:magenta_part_}{\&{magentapart} primitive@>
mp_primitive (mp, "yellowpart", mp_unary, mp_yellow_part);
-@:yellow_part_}{\&{yellowpart} primitive@>;
+@:yellow_part_}{\&{yellowpart} primitive@>
mp_primitive (mp, "blackpart", mp_unary, mp_black_part);
-@:black_part_}{\&{blackpart} primitive@>;
+@:black_part_}{\&{blackpart} primitive@>
mp_primitive (mp, "greypart", mp_unary, mp_grey_part);
-@:grey_part_}{\&{greypart} primitive@>;
+@:grey_part_}{\&{greypart} primitive@>
mp_primitive (mp, "colormodel", mp_unary, mp_color_model_part);
-@:color_model_part_}{\&{colormodel} primitive@>;
+@:color_model_part_}{\&{colormodel} primitive@>
mp_primitive (mp, "fontpart", mp_unary, mp_font_part);
-@:font_part_}{\&{fontpart} primitive@>;
+@:font_part_}{\&{fontpart} primitive@>
mp_primitive (mp, "textpart", mp_unary, mp_text_part);
-@:text_part_}{\&{textpart} primitive@>;
+@:text_part_}{\&{textpart} primitive@>
mp_primitive (mp, "prescriptpart", mp_unary, mp_prescript_part);
-@:prescript_part_}{\&{prescriptpart} primitive@>;
+@:prescript_part_}{\&{prescriptpart} primitive@>
mp_primitive (mp, "postscriptpart", mp_unary, mp_postscript_part);
-@:postscript_part_}{\&{postscriptpart} primitive@>;
+@:postscript_part_}{\&{postscriptpart} primitive@>
mp_primitive (mp, "pathpart", mp_unary, mp_path_part);
-@:path_part_}{\&{pathpart} primitive@>;
+@:path_part_}{\&{pathpart} primitive@>
mp_primitive (mp, "penpart", mp_unary, mp_pen_part);
-@:pen_part_}{\&{penpart} primitive@>;
+@:pen_part_}{\&{penpart} primitive@>
mp_primitive (mp, "dashpart", mp_unary, mp_dash_part);
-@:dash_part_}{\&{dashpart} primitive@>;
+@:dash_part_}{\&{dashpart} primitive@>
mp_primitive (mp, "sqrt", mp_unary, mp_sqrt_op);
-@:sqrt_}{\&{sqrt} primitive@>;
+@:sqrt_}{\&{sqrt} primitive@>
mp_primitive (mp, "mexp", mp_unary, mp_m_exp_op);
-@:m_exp_}{\&{mexp} primitive@>;
+@:m_exp_}{\&{mexp} primitive@>
mp_primitive (mp, "mlog", mp_unary, mp_m_log_op);
-@:m_log_}{\&{mlog} primitive@>;
+@:m_log_}{\&{mlog} primitive@>
mp_primitive (mp, "sind", mp_unary, mp_sin_d_op);
-@:sin_d_}{\&{sind} primitive@>;
+@:sin_d_}{\&{sind} primitive@>
mp_primitive (mp, "cosd", mp_unary, mp_cos_d_op);
-@:cos_d_}{\&{cosd} primitive@>;
+@:cos_d_}{\&{cosd} primitive@>
mp_primitive (mp, "floor", mp_unary, mp_floor_op);
-@:floor_}{\&{floor} primitive@>;
+@:floor_}{\&{floor} primitive@>
mp_primitive (mp, "uniformdeviate", mp_unary, mp_uniform_deviate);
-@:uniform_deviate_}{\&{uniformdeviate} primitive@>;
+@:uniform_deviate_}{\&{uniformdeviate} primitive@>
mp_primitive (mp, "charexists", mp_unary, mp_char_exists_op);
-@:char_exists_}{\&{charexists} primitive@>;
+@:char_exists_}{\&{charexists} primitive@>
mp_primitive (mp, "fontsize", mp_unary, mp_font_size);
-@:font_size_}{\&{fontsize} primitive@>;
+@:font_size_}{\&{fontsize} primitive@>
mp_primitive (mp, "llcorner", mp_unary, mp_ll_corner_op);
-@:ll_corner_}{\&{llcorner} primitive@>;
+@:ll_corner_}{\&{llcorner} primitive@>
mp_primitive (mp, "lrcorner", mp_unary, mp_lr_corner_op);
-@:lr_corner_}{\&{lrcorner} primitive@>;
+@:lr_corner_}{\&{lrcorner} primitive@>
mp_primitive (mp, "ulcorner", mp_unary, mp_ul_corner_op);
-@:ul_corner_}{\&{ulcorner} primitive@>;
+@:ul_corner_}{\&{ulcorner} primitive@>
mp_primitive (mp, "urcorner", mp_unary, mp_ur_corner_op);
-@:ur_corner_}{\&{urcorner} primitive@>;
+@:ur_corner_}{\&{urcorner} primitive@>
mp_primitive (mp, "arclength", mp_unary, mp_arc_length);
-@:arc_length_}{\&{arclength} primitive@>;
+@:arc_length_}{\&{arclength} primitive@>
mp_primitive (mp, "angle", mp_unary, mp_angle_op);
-@:angle_}{\&{angle} primitive@>;
+@:angle_}{\&{angle} primitive@>
mp_primitive (mp, "cycle", mp_cycle, mp_cycle_op);
-@:cycle_}{\&{cycle} primitive@>;
+@:cycle_}{\&{cycle} primitive@>
mp_primitive (mp, "stroked", mp_unary, mp_stroked_op);
-@:stroked_}{\&{stroked} primitive@>;
+@:stroked_}{\&{stroked} primitive@>
mp_primitive (mp, "filled", mp_unary, mp_filled_op);
-@:filled_}{\&{filled} primitive@>;
+@:filled_}{\&{filled} primitive@>
mp_primitive (mp, "textual", mp_unary, mp_textual_op);
-@:textual_}{\&{textual} primitive@>;
+@:textual_}{\&{textual} primitive@>
mp_primitive (mp, "clipped", mp_unary, mp_clipped_op);
-@:clipped_}{\&{clipped} primitive@>;
+@:clipped_}{\&{clipped} primitive@>
mp_primitive (mp, "bounded", mp_unary, mp_bounded_op);
-@:bounded_}{\&{bounded} primitive@>;
+@:bounded_}{\&{bounded} primitive@>
mp_primitive (mp, "+", mp_plus_or_minus, mp_plus);
-@:+ }{\.{+} primitive@>;
+@:+ }{\.{+} primitive@>
mp_primitive (mp, "-", mp_plus_or_minus, mp_minus);
-@:- }{\.{-} primitive@>;
+@:- }{\.{-} primitive@>
mp_primitive (mp, "*", mp_secondary_binary, mp_times);
-@:* }{\.{*} primitive@>;
+@:* }{\.{*} primitive@>
mp_primitive (mp, "/", mp_slash, mp_over);
mp->frozen_slash = mp_frozen_primitive (mp, "/", mp_slash, mp_over);
-@:/ }{\.{/} primitive@>;
+@:/ }{\.{/} primitive@>
mp_primitive (mp, "++", mp_tertiary_binary, mp_pythag_add);
-@:++_}{\.{++} primitive@>;
+@:++_}{\.{++} primitive@>
mp_primitive (mp, "+-+", mp_tertiary_binary, mp_pythag_sub);
-@:+-+_}{\.{+-+} primitive@>;
+@:+-+_}{\.{+-+} primitive@>
mp_primitive (mp, "or", mp_tertiary_binary, mp_or_op);
-@:or_}{\&{or} primitive@>;
+@:or_}{\&{or} primitive@>
mp_primitive (mp, "and", mp_and_command, mp_and_op);
-@:and_}{\&{and} primitive@>;
+@:and_}{\&{and} primitive@>
mp_primitive (mp, "<", mp_expression_binary, mp_less_than);
-@:< }{\.{<} primitive@>;
+@:< }{\.{<} primitive@>
mp_primitive (mp, "<=", mp_expression_binary, mp_less_or_equal);
-@:<=_}{\.{<=} primitive@>;
+@:<=_}{\.{<=} primitive@>
mp_primitive (mp, ">", mp_expression_binary, mp_greater_than);
-@:> }{\.{>} primitive@>;
+@:> }{\.{>} primitive@>
mp_primitive (mp, ">=", mp_expression_binary, mp_greater_or_equal);
-@:>=_}{\.{>=} primitive@>;
+@:>=_}{\.{>=} primitive@>
mp_primitive (mp, "=", mp_equals, mp_equal_to);
-@:= }{\.{=} primitive@>;
+@:= }{\.{=} primitive@>
mp_primitive (mp, "<>", mp_expression_binary, mp_unequal_to);
-@:<>_}{\.{<>} primitive@>;
+@:<>_}{\.{<>} primitive@>
mp_primitive (mp, "substring", mp_primary_binary, mp_substring_of);
-@:substring_}{\&{substring} primitive@>;
+@:substring_}{\&{substring} primitive@>
mp_primitive (mp, "subpath", mp_primary_binary, mp_subpath_of);
-@:subpath_}{\&{subpath} primitive@>;
+@:subpath_}{\&{subpath} primitive@>
mp_primitive (mp, "directiontime", mp_primary_binary, mp_direction_time_of);
-@:direction_time_}{\&{directiontime} primitive@>;
+@:direction_time_}{\&{directiontime} primitive@>
mp_primitive (mp, "point", mp_primary_binary, mp_point_of);
-@:point_}{\&{point} primitive@>;
+@:point_}{\&{point} primitive@>
mp_primitive (mp, "precontrol", mp_primary_binary, mp_precontrol_of);
-@:precontrol_}{\&{precontrol} primitive@>;
+@:precontrol_}{\&{precontrol} primitive@>
mp_primitive (mp, "postcontrol", mp_primary_binary, mp_postcontrol_of);
-@:postcontrol_}{\&{postcontrol} primitive@>;
+@:postcontrol_}{\&{postcontrol} primitive@>
mp_primitive (mp, "penoffset", mp_primary_binary, mp_pen_offset_of);
-@:pen_offset_}{\&{penoffset} primitive@>;
+@:pen_offset_}{\&{penoffset} primitive@>
mp_primitive (mp, "arctime", mp_primary_binary, mp_arc_time_of);
-@:arc_time_of_}{\&{arctime} primitive@>;
+@:arc_time_of_}{\&{arctime} primitive@>
mp_primitive (mp, "mpversion", mp_nullary, mp_version);
-@:mp_verison_}{\&{mpversion} primitive@>;
+@:mp_verison_}{\&{mpversion} primitive@>
mp_primitive (mp, "&", mp_ampersand, mp_concatenate);
-@:!!!}{\.{\&} primitive@>;
+@:!!!}{\.{\&} primitive@>
mp_primitive (mp, "rotated", mp_secondary_binary, mp_rotated_by);
-@:rotated_}{\&{rotated} primitive@>;
+@:rotated_}{\&{rotated} primitive@>
mp_primitive (mp, "slanted", mp_secondary_binary, mp_slanted_by);
-@:slanted_}{\&{slanted} primitive@>;
+@:slanted_}{\&{slanted} primitive@>
mp_primitive (mp, "scaled", mp_secondary_binary, mp_scaled_by);
-@:scaled_}{\&{scaled} primitive@>;
+@:scaled_}{\&{scaled} primitive@>
mp_primitive (mp, "shifted", mp_secondary_binary, mp_shifted_by);
-@:shifted_}{\&{shifted} primitive@>;
+@:shifted_}{\&{shifted} primitive@>
mp_primitive (mp, "transformed", mp_secondary_binary, mp_transformed_by);
-@:transformed_}{\&{transformed} primitive@>;
+@:transformed_}{\&{transformed} primitive@>
mp_primitive (mp, "xscaled", mp_secondary_binary, mp_x_scaled);
-@:x_scaled_}{\&{xscaled} primitive@>;
+@:x_scaled_}{\&{xscaled} primitive@>
mp_primitive (mp, "yscaled", mp_secondary_binary, mp_y_scaled);
-@:y_scaled_}{\&{yscaled} primitive@>;
+@:y_scaled_}{\&{yscaled} primitive@>
mp_primitive (mp, "zscaled", mp_secondary_binary, mp_z_scaled);
-@:z_scaled_}{\&{zscaled} primitive@>;
+@:z_scaled_}{\&{zscaled} primitive@>
mp_primitive (mp, "infont", mp_secondary_binary, mp_in_font);
-@:in_font_}{\&{infont} primitive@>;
+@:in_font_}{\&{infont} primitive@>
mp_primitive (mp, "intersectiontimes", mp_tertiary_binary, mp_intersect);
-@:intersection_times_}{\&{intersectiontimes} primitive@>;
+@:intersection_times_}{\&{intersectiontimes} primitive@>
mp_primitive (mp, "envelope", mp_primary_binary, mp_envelope_of);
-@:envelope_}{\&{envelope} primitive@>;
+@:envelope_}{\&{envelope} primitive@>
mp_primitive (mp, "boundingpath", mp_primary_binary, mp_boundingpath_of);
-@:boundingpath_}{\&{boundingpath} primitive@>;
+@:boundingpath_}{\&{boundingpath} primitive@>
mp_primitive (mp, "glyph", mp_primary_binary, mp_glyph_infont);
-@:glyph_infont_}{\&{glyph} primitive@>;
+@:glyph_infont_}{\&{glyph} primitive@>
mp_primitive (mp, "interval_get_left_endpoint", mp_unary, mp_m_get_left_endpoint_op); /* math interval new primitives */
-@:m_get_left_endpoint_}{\&{mget_left_endpoint} primitive@>;
+@:m_get_left_endpoint_}{\&{mget\_left\_endpoint} primitive@>
mp_primitive (mp, "interval_get_right_endpoint", mp_unary, mp_m_get_right_endpoint_op); /* math interval new primitives */
-@:m_get_right_endpoint_}{\&{mget_right_endpoint} primitive@>;
+@:m_get_right_endpoint_}{\&{mget\_right\_endpoint} primitive@>
mp_primitive (mp, "interval_set", mp_unary, mp_interval_set_op); /* math interval new primitives */
-@:interval_set}{\&{interval_set} primitive@>;
+@:interval_set}{\&{interval\_set} primitive@>
@ @<Cases of |print_cmd...@>=
@@ -25522,11 +25490,11 @@ for backward compatibility) .
@d cur_pic_item mp_link(edge_list(cur_exp_node()))
@d pict_color_type(A) ((cur_pic_item!=NULL) &&
((!has_color(cur_pic_item))
- ||
+ || @|
(((mp_color_model(cur_pic_item)==A)
- ||
- ((mp_color_model(cur_pic_item)==mp_uninitialized_model) &&
- (number_to_scaled (internal_value(mp_default_color_model))/number_to_scaled (unity_t))==(A))))))
+ || @|
+ ((mp_color_model(cur_pic_item)==mp_uninitialized_model) && @|
+ (number_to_scaled (internal_value(mp_default_color_model))/ @| number_to_scaled (unity_t))==(A))))))
@d boolean_reset(A) if ( (A) ) set_cur_exp_value_boolean(mp_true_code); else set_cur_exp_value_boolean(mp_false_code)
@@ -26172,7 +26140,7 @@ static void mp_bad_unary (MP mp, quarterword c) {
delete_str_ref(sname);
mp_disp_err(mp, NULL);
mp_back_error (mp, msg, hlp, true);
-@.Not implemented...@>;
+@.Not implemented...@>
mp_get_x_next (mp);
}
@@ -26294,7 +26262,7 @@ static void mp_bad_color_part (MP mp, quarterword c) {
char msg[256];
int old_setting;
mp_string sname;
- const char *hlp[] = {
+ const char *hlp[] = {@|
"You can only ask for the redpart, greenpart, bluepart of a rgb object,",
"the cyanpart, magentapart, yellowpart or blackpart of a cmyk object, ",
"or the greypart of a grey object. No mixing and matching, please.",
@@ -26308,7 +26276,7 @@ static void mp_bad_color_part (MP mp, quarterword c) {
mp_print_op (mp, c);
sname = mp_make_string(mp);
mp->selector = old_setting;
-@.Wrong picture color model...@>;
+@.Wrong picture color model...@>
if (mp_color_model (p) == mp_grey_model)
mp_snprintf (msg, 256, "Wrong picture color model: %s of grey object", mp_str(mp, sname));
else if (mp_color_model (p) == mp_cmyk_model)
@@ -26516,7 +26484,7 @@ static void mp_take_pict_part (MP mp, quarterword c) {
add_str_ref (new_expr.data.str);
mp_flush_cur_exp (mp, new_expr);
mp->cur_exp.type = mp_string_type;
- };
+ }
break;
case mp_prescript_part:
if (!has_color (p)) {
@@ -26530,7 +26498,7 @@ static void mp_take_pict_part (MP mp, quarterword c) {
}
mp_flush_cur_exp (mp, new_expr);
mp->cur_exp.type = mp_string_type;
- };
+ }
break;
case mp_postscript_part:
if (!has_color (p)) {
@@ -26544,7 +26512,7 @@ static void mp_take_pict_part (MP mp, quarterword c) {
}
mp_flush_cur_exp (mp, new_expr);
mp->cur_exp.type = mp_string_type;
- };
+ }
break;
case mp_font_part:
if (mp_type (p) != mp_text_node_type)
@@ -26554,7 +26522,7 @@ static void mp_take_pict_part (MP mp, quarterword c) {
add_str_ref (new_expr.data.str);
mp_flush_cur_exp (mp, new_expr);
mp->cur_exp.type = mp_string_type;
- };
+ }
break;
case mp_path_part:
if (mp_type (p) == mp_text_node_type) {
@@ -26630,7 +26598,7 @@ static void mp_take_pict_part (MP mp, quarterword c) {
break;
} /* all cases have been enumerated */
return;
- };
+ }
NOT_FOUND:
/* Convert the current expression to a NULL value appropriate for |c| */
switch (c) {
@@ -26704,11 +26672,11 @@ static void mp_str_to_num (MP mp, quarterword c) { /* converts a string to a nu
else {
bad_char = true;
m = 0;
- };
+ }
if ((int) m >= b) {
bad_char = true;
m = 0;
- };
+ }
if (n < 32768 / b)
n = n * b + m;
else
@@ -26724,7 +26692,7 @@ static void mp_str_to_num (MP mp, quarterword c) { /* converts a string to a nu
mp_back_error (mp, "String contains illegal digits", hlp, true);
mp_get_x_next (mp);
}
- if ((n > 4095)) { /* todo, this is scaled specific */
+ if ((n > 4095)) { /* TODO: this is scaled specific */
if (number_positive (internal_value (mp_warning_check))) {
char msg[256];
const char *hlp[] = {
@@ -26855,7 +26823,7 @@ static void mp_bezier_slope (MP mp, mp_number *ret, mp_number AX, mp_number AY,
}
mp_an_angle (mp, &xo, deltax, deltay);
a = (bx - ax) * (cy - by) - (cx - bx) * (by - ay); /* a = (bp-ap)x(cp-bp); */
- b = (bx - ax) * (dy - cy) - (by - ay) * (dx - cx);; /* b = (bp-ap)x(dp-cp); */
+ b = (bx - ax) * (dy - cy) - (by - ay) * (dx - cx); /* b = (bp-ap)x(dp-cp); */
c = (cx - bx) * (dy - cy) - (dx - cx) * (cy - by); /* c = (cp-bp)x(dp-cp); */
if ((a == 0) && (c == 0)) {
res = (b == 0 ? 0 : (mp_out (number_to_double(xo)) - mp_out (number_to_double(xi))));
@@ -27566,7 +27534,7 @@ static void mp_do_binary (MP mp, mp_node p, integer c) {
mp_take_part (mp, part_type);
break;
default:
- assert (0); /* todo: |mp->cur_exp.type>mp_transform_node_type| ? */
+ assert (0); /* TODO: |mp->cur_exp.type>mp_transform_node_type| ? */
break;
}
@@ -27596,7 +27564,7 @@ static void mp_do_binary (MP mp, mp_node p, integer c) {
new_number(new_expr.data.n);
set_number_from_boolean (new_expr.data.n, mp_false_code);
mp_back_error (mp,"Unknown relation will be considered false", hlp, true);
- @.Unknown relation...@>;
+ @.Unknown relation...@>
mp_get_x_next (mp);
mp_flush_cur_exp (mp, new_expr);
} else {
@@ -27619,7 +27587,7 @@ static void mp_do_binary (MP mp, mp_node p, integer c) {
case mp_unequal_to:
boolean_reset (number_nonzero(cur_exp_value_number ()));
break;
- }; /* there are no other cases */
+ } /* there are no other cases */
}
mp->cur_exp.type = mp_boolean_type;
DONE:
@@ -27926,7 +27894,7 @@ static void mp_bad_binary (MP mp, mp_node p, quarterword c) {
sname = mp_make_string(mp);
mp->selector = old_setting;
mp_snprintf (msg, 256, "Not implemented: %s", mp_str(mp, sname));
-@.Not implemented...@>;
+@.Not implemented...@>
delete_str_ref(sname);
mp_disp_err (mp, p);
mp_disp_err (mp, NULL);
@@ -27942,7 +27910,7 @@ static void mp_bad_envelope_pen (MP mp) {
mp_disp_err (mp, NULL);
mp_disp_err (mp, NULL);
mp_back_error (mp, "Not implemented: envelope(elliptical pen)of(path)", hlp, true);
-@.Not implemented...@>;
+@.Not implemented...@>
mp_get_x_next (mp);
}
@@ -28231,9 +28199,8 @@ static void mp_frac_mult (MP mp, mp_number n, mp_number d) {
mp_node old_exp; /* a capsule to recycle */
mp_number v; /* |n/d| */
new_fraction (v);
- if (number_greater (internal_value (mp_tracing_commands), two_t)) {
- @<Trace the fraction multiplication@>;
- }
+ if (number_greater (internal_value (mp_tracing_commands), two_t))
+ @<Trace the fraction multiplication@>@;
switch (mp->cur_exp.type) {
case mp_transform_type:
case mp_color_type:
@@ -28435,7 +28402,7 @@ static void mp_set_up_trans (MP mp, quarterword c) {
@<For each of the eight cases, change the relevant fields of |cur_exp|
and |goto done|;
but do nothing if capsule |p| doesn't have the appropriate type@>;
- }; /* there are no other cases */
+ } /* there are no other cases */
mp_disp_err (mp, p);
mp_back_error (mp, "Improper transformation argument", hlp, true);
mp_get_x_next (mp);
@@ -28750,9 +28717,8 @@ if (number_nonzero(mp->txy) || number_nonzero(mp->tyx) ||
} else {
mp_number abs_tyy, ret;
new_number (abs_tyy);
- if (number_negative(mp->txx)) {
- @<Reverse the dash list of |h|@>;
- }
+ if (number_negative(mp->txx))
+ @<Reverse the dash list of |h|@>@;
@<Scale the dash list by |txx| and shift it by |tx|@>;
number_clone(abs_tyy, mp->tyy);
number_abs (abs_tyy);
@@ -28795,16 +28761,15 @@ r = dash_list (h);
@ @<Make the bounding box of |h| unknown if it can't be updated properly...@>=
-if (number_zero(mp->txx) && number_zero(mp->tyy)) {
- @<Swap the $x$ and $y$ parameters in the bounding box of |h|@>;
-} else if (number_nonzero(mp->txy) || number_nonzero(mp->tyx)) {
+if (number_zero(mp->txx) && number_zero(mp->tyy))
+ @<Swap the $x$ and $y$ parameters in the bounding box of |h|@>@;
+else if (number_nonzero(mp->txy) || number_nonzero(mp->tyx)) {
mp_init_bbox (mp, h);
goto DONE1;
}
-if (number_lessequal (h->minx, h->maxx)) {
+if (number_lessequal (h->minx, h->maxx))
@<Scale the bounding box by |txx+txy| and |tyx+tyy|; then shift by
- |(tx,ty)|@>;
-}
+ |(tx,ty)|@>@;
DONE1:
@@ -28925,7 +28890,7 @@ set_number_to_zero(mp->ty);
mp_number_trans (mp, &((mp_text_node)q)->txx, &((mp_text_node)q)->tyx);
mp_number_trans (mp, &((mp_text_node)q)->txy, &((mp_text_node)q)->tyy);
number_clone(mp->tx, sx);
-number_clone(mp->ty, sy)
+number_clone(mp->ty, sy)@;
@ The hard cases of transformation occur when big nodes are involved,
and when some of their components are unknown.
@@ -29041,9 +29006,9 @@ static void mp_bilin1 (MP mp, mp_node p, mp_number t, mp_node q,
@ @<Transform a known big node@>=
mp_set_up_trans (mp, c);
-if (mp->cur_exp.type == mp_known) {
- @<Transform known by known@>;
-} else {
+if (mp->cur_exp.type == mp_known)
+ @<Transform known by known@>@;
+else {
pp = mp_stash_cur_exp (mp);
qq = value_node (pp);
mp_make_exp_copy (mp, p);
@@ -29440,9 +29405,11 @@ static void mp_set_up_boundingpath (MP mp, mp_node p) {
-@ This is pretty straightfoward. The one silly thing is that
+@ This is pretty straightforward. The one silly thing is that
the output of |mp_ps_do_font_charstring| has to be un-exported.
+@s mp_ps_font int
+
@<Declare binary action...@>=
static void mp_set_up_glyph_infont (MP mp, mp_node p) {
mp_edge_object *h = NULL;
@@ -29994,8 +29961,7 @@ a pointer to a capsule that is to be equated to the current expression.
@<Declare the procedure called |make_eq|@>=
static void mp_make_eq (MP mp, mp_node lhs);
-@
-@c
+@ @c
static void announce_bad_equation (MP mp, mp_node lhs) {
char msg[256];
const char *hlp[] = {
@@ -30167,8 +30133,7 @@ but to equate the two operands.
@<Declarations@>=
static void mp_try_eq (MP mp, mp_node l, mp_node r);
-@
-@d equation_threshold_k ((math_data *)mp->math)->equation_threshold_t
+@ @d equation_threshold_k ((math_data *)mp->math)->equation_threshold_t
@c
static void deal_with_redundant_or_inconsistent_equation(MP mp, mp_value_node p, mp_node r) {
@@ -30365,25 +30330,25 @@ mp_node mp_scan_declared_variable (MP mp) {
@<Put each...@>=
mp_primitive (mp, "numeric", mp_type_name, mp_numeric_type);
-@:numeric_}{\&{numeric} primitive@>;
+@:numeric_}{\&{numeric} primitive@>
mp_primitive (mp, "string", mp_type_name, mp_string_type);
-@:string_}{\&{string} primitive@>;
+@:string_}{\&{string} primitive@>
mp_primitive (mp, "boolean", mp_type_name, mp_boolean_type);
-@:boolean_}{\&{boolean} primitive@>;
+@:boolean_}{\&{boolean} primitive@>
mp_primitive (mp, "path", mp_type_name, mp_path_type);
-@:path_}{\&{path} primitive@>;
+@:path_}{\&{path} primitive@>
mp_primitive (mp, "pen", mp_type_name, mp_pen_type);
-@:pen_}{\&{pen} primitive@>;
+@:pen_}{\&{pen} primitive@>
mp_primitive (mp, "picture", mp_type_name, mp_picture_type);
-@:picture_}{\&{picture} primitive@>;
+@:picture_}{\&{picture} primitive@>
mp_primitive (mp, "transform", mp_type_name, mp_transform_type);
-@:transform_}{\&{transform} primitive@>;
+@:transform_}{\&{transform} primitive@>
mp_primitive (mp, "color", mp_type_name, mp_color_type);
-@:color_}{\&{color} primitive@>;
+@:color_}{\&{color} primitive@>
mp_primitive (mp, "rgbcolor", mp_type_name, mp_color_type);
-@:color_}{\&{rgbcolor} primitive@>;
+@:color_}{\&{rgbcolor} primitive@>
mp_primitive (mp, "cmykcolor", mp_type_name, mp_cmykcolor_type);
-@:color_}{\&{cmykcolor} primitive@>;
+@:color_}{\&{cmykcolor} primitive@>
mp_primitive (mp, "pair", mp_type_name, mp_pair_type);
@:pair_}{\&{pair} primitive@>
@@ -30415,7 +30380,7 @@ void mp_do_type_declaration (MP mp) {
q = mp_find_variable (mp, p);
if (q != NULL) {
mp_type (q) = t;
- set_value_number (q, zero_t); /* todo: this was |null| */
+ set_value_number (q, zero_t); /* TODO: this was |NULL| */
} else {
const char *hlp[] = {
"You can't use, e.g., `numeric foo[]' after `vardef foo'.",
@@ -30432,8 +30397,7 @@ void mp_do_type_declaration (MP mp) {
}
-@
-@c
+@ @c
static void flush_spurious_symbols_after_declared_variable (MP mp)
{
const char *hlp[] = {
@@ -30645,7 +30609,7 @@ static void mplib_shipout_backend (MP mp, void *h);
if (!ff->f) {
ff->f = xmalloc(1,1);
(a).fptr = ff->f;
- } } while (0)
+ } } while (0)@;
@c
static void *mplib_open_file (MP mp, const char *fname, const char *fmode,
@@ -30899,9 +30863,11 @@ mp_free_stream (&(mp->run_data.error_out));
mp_free_stream (&(mp->run_data.ship_out));
@ @<Finish non-interactive use@>=
-xfree (mp->term_out);
-xfree (mp->term_in);
-xfree (mp->err_out);
+{
+ xfree (mp->term_out);
+ xfree (mp->term_in);
+ xfree (mp->err_out);
+}
@ @<Start non-interactive work@>=
@<Initialize the output routines@>;
@@ -31048,7 +31014,7 @@ char *mp_metapost_version (void);void mp_show_library_versions (void);
@ @<Put each...@>=
mp_primitive (mp, "end", mp_stop, 0);
-@:end_}{\&{end} primitive@>;
+@:end_}{\&{end} primitive@>
mp_primitive (mp, "dump", mp_stop, 1);
mp->frozen_dump = mp_frozen_primitive (mp, "dump", mp_stop, 1);
@:dump_}{\&{dump} primitive@>
@@ -31070,8 +31036,9 @@ then we'll tackle the tougher commands.
Here's one of the simplest:
-@ @<Declare action procedures for use by |do_statement|@>=
+@<Declare action procedures for use by |do_statement|@>=
static void mp_do_random_seed (MP mp);
+
@ @c
void mp_do_random_seed (MP mp) {
mp_value new_expr;
@@ -31081,8 +31048,8 @@ void mp_do_random_seed (MP mp) {
if (cur_cmd() != mp_assignment) {
const char *hlp[] = { "Always say `randomseed:=<numeric expression>'.", NULL };
mp_back_error (mp, "Missing `:=' has been inserted", hlp, true);
-@.Missing `:='@>;
- };
+@.Missing `:='@>
+ }
mp_get_x_next (mp);
mp_scan_expression (mp);
if (mp->cur_exp.type != mp_known) {
@@ -31092,12 +31059,11 @@ void mp_do_random_seed (MP mp) {
NULL };
mp_disp_err(mp, NULL);
mp_back_error (mp, "Unknown value will be ignored", hlp, true);
-@.Unknown value...ignored@>;
+@.Unknown value...ignored@>
mp_get_x_next (mp);
mp_flush_cur_exp (mp, new_expr);
- } else {
- @<Initialize the random seed to |cur_exp|@>;
- }
+ } else
+ @<Initialize the random seed to |cur_exp|@>@;
}
@@ -31116,15 +31082,13 @@ void mp_do_random_seed (MP mp) {
}
-@ And here's another simple one (somewhat different in flavor):
-
@ @<Put each...@>=
mp_primitive (mp, "batchmode", mp_mode_command, mp_batch_mode);
-@:mp_batch_mode_}{\&{batchmode} primitive@>;
+@:mp_batch_mode_}{\&{batchmode} primitive@>
mp_primitive (mp, "nonstopmode", mp_mode_command, mp_nonstop_mode);
-@:mp_nonstop_mode_}{\&{nonstopmode} primitive@>;
+@:mp_nonstop_mode_}{\&{nonstopmode} primitive@>
mp_primitive (mp, "scrollmode", mp_mode_command, mp_scroll_mode);
-@:mp_scroll_mode_}{\&{scrollmode} primitive@>;
+@:mp_scroll_mode_}{\&{scrollmode} primitive@>
mp_primitive (mp, "errorstopmode", mp_mode_command, mp_error_stop_mode);
@:mp_error_stop_mode_}{\&{errorstopmode} primitive@>
@@ -31149,9 +31113,9 @@ break;
@ The `\&{inner}' and `\&{outer}' commands are only slightly harder.
-@ @<Put each...@>=
+@<Put each...@>=
mp_primitive (mp, "inner", mp_protection_command, 0);
-@:inner_}{\&{inner} primitive@>;
+@:inner_}{\&{inner} primitive@>
mp_primitive (mp, "outer", mp_protection_command, 1);
@:outer_}{\&{outer} primitive@>
@@ -31164,7 +31128,9 @@ else
mp_print (mp, "outer");
break;
-@ @<Declare action procedures for use by |do_statement|@>=
+@ And here's another simple one (somewhat different in flavor):
+
+@<Declare action procedures for use by |do_statement|@>=
static void mp_do_protection (MP mp);
@ @c
@@ -31192,7 +31158,7 @@ declaration assigns the command code |left_delimiter| to `\.{(}' and
|right_delimiter| to `\.{)}'; the |equiv| of each delimiter is the
hash address of its mate.
-@ @<Declare action procedures for use by |do_statement|@>=
+@<Declare action procedures for use by |do_statement|@>=
static void mp_def_delims (MP mp);
@ @c
@@ -31228,7 +31194,7 @@ void mp_check_delimiter (MP mp, mp_sym l_delim, mp_sym r_delim) {
"put one in, behind the scenes; this may fix the problem.",
NULL };
mp_snprintf(msg, 256, "Missing `%s' has been inserted", mp_str (mp, text (r_delim)));
-@.Missing `)'@>;
+@.Missing `)'@>
mp_back_error (mp, msg, hlp, true);
} else {
char msg[256];
@@ -31238,15 +31204,15 @@ void mp_check_delimiter (MP mp, mp_sym l_delim, mp_sym r_delim) {
"but watch out, I'll probably miss it later.",
NULL };
mp_snprintf(msg, 256, "The token `%s' is no longer a right delimiter", mp_str(mp, text (r_delim)));
-@.The token...delimiter@>;
+@.The token...delimiter@>
mp_error (mp, msg, hlp, true);
}
}
-@ The next four commands save or change the values associated with tokens.
+@ The next two commands save or change the values associated with tokens.
-@ @<Declare action procedures for use by |do_statement|@>=
+@<Declare action procedures for use by |do_statement|@>=
static void mp_do_statement (MP mp);
static void mp_do_interim (MP mp);
@@ -31260,7 +31226,7 @@ void mp_do_interim (MP mp) {
NULL };
mp_snprintf(msg, 256, "The token `%s' isn't an internal quantity",
(cur_sym() == NULL ? "(%CAPSULE)" : mp_str(mp, text (cur_sym()))));
-@.The token...quantity@>;
+@.The token...quantity@>
mp_back_error (mp, msg, hlp, true);
} else {
mp_save_internal (mp, cur_mod());
@@ -31289,7 +31255,7 @@ void mp_do_let (MP mp) {
"was present. The next token I read will be `something'.",
NULL };
mp_back_error (mp, "Missing `=' has been inserted", hlp, true);
-@.Missing `='@>;
+@.Missing `='@>
}
mp_get_symbol (mp);
switch (cur_cmd()) {
@@ -31305,7 +31271,7 @@ void mp_do_let (MP mp) {
mp_clear_symbol (mp, l, false);
set_eq_type (l, cur_cmd());
if (cur_cmd() == mp_tag_token)
- set_equiv (l, 0); /* todo: this was |null| */
+ set_equiv (l, 0); /* TODO: this was |NULL| */
else if (cur_cmd() == mp_defined_macro ||
cur_cmd() == mp_secondary_primary_macro ||
cur_cmd() == mp_tertiary_secondary_macro ||
@@ -31393,18 +31359,18 @@ in the usual way.
@d show_token_code 0 /* show the meaning of a single token */
@d show_stats_code 1 /* show current memory and string usage */
@d show_code 2 /* show a list of expressions */
-@d show_var_code 3 /* show a variable and its descendents */
+@d show_var_code 3 /* show a variable and its descendants */
@d show_dependencies_code 4 /* show dependent variables in terms of independents */
@<Put each...@>=
mp_primitive (mp, "showtoken", mp_show_command, show_token_code);
-@:show_token_}{\&{showtoken} primitive@>;
+@:show_token_}{\&{showtoken} primitive@>
mp_primitive (mp, "showstats", mp_show_command, show_stats_code);
-@:show_stats_}{\&{showstats} primitive@>;
+@:show_stats_}{\&{showstats} primitive@>
mp_primitive (mp, "show", mp_show_command, show_code);
-@:show_}{\&{show} primitive@>;
+@:show_}{\&{show} primitive@>
mp_primitive (mp, "showvariable", mp_show_command, show_var_code);
-@:show_var_}{\&{showvariable} primitive@>;
+@:show_var_}{\&{showvariable} primitive@>
mp_primitive (mp, "showdependencies", mp_show_command, show_dependencies_code);
@:show_dependencies_}{\&{showdependencies} primitive@>
@@ -31446,7 +31412,7 @@ void mp_do_show (MP mp) {
mp_get_x_next (mp);
mp_scan_expression (mp);
mp_print_nl (mp, ">> ");
-@.>>@>;
+@.>>@>
mp_print_exp (mp, NULL, 2);
mp_flush_cur_exp (mp, new_expr);
} while (cur_cmd() == mp_comma);
@@ -31459,10 +31425,10 @@ static void mp_disp_token (MP mp);
@ @c
void mp_disp_token (MP mp) {
mp_print_nl (mp, "> ");
-@.>\relax@>;
- if (cur_sym() == NULL) {
- @<Show a numeric or string or capsule token@>;
- } else {
+@.>\relax@>
+ if (cur_sym() == NULL)
+ @<Show a numeric or string or capsule token@>@;
+ else {
mp_print_text (cur_sym());
mp_print_char (mp, xord ('='));
if (eq_type (cur_sym()) >= mp_outer_tag)
@@ -31511,7 +31477,7 @@ mp_print (mp, " delimiter");
#endif
break;
case mp_tag_token:
-if (m == 0) /* todo: this was |null| */
+if (m == 0) /* TODO: this was |NULL| */
mp_print (mp, "tag");
else
mp_print (mp, "variable");
@@ -31554,7 +31520,7 @@ static void mp_do_show_stats (MP mp);
@ @c
void mp_do_show_stats (MP mp) {
mp_print_nl (mp, "Memory usage ");
-@.Memory usage...@>;
+@.Memory usage...@>
mp_print_int (mp, (integer) mp->var_used);
mp_print_ln (mp);
mp_print_nl (mp, "String usage ");
@@ -31576,11 +31542,11 @@ static void mp_disp_var (MP mp, mp_node p);
void mp_disp_var (MP mp, mp_node p) {
mp_node q; /* traverses attributes and subscripts */
int n; /* amount of macro text to show */
- if (mp_type (p) == mp_structured) {
- @<Descend the structure@>;
- } else if (mp_type (p) >= mp_unsuffixed_macro) {
- @<Display a variable macro@>;
- } else if (mp_type (p) != mp_undefined) {
+ if (mp_type (p) == mp_structured)
+ @<Descend the structure@>@;
+ else if (mp_type (p) >= mp_unsuffixed_macro)
+ @<Display a variable macro@>@;
+ else if (mp_type (p) != mp_undefined) {
mp_print_nl (mp, "");
mp_print_variable_name (mp, p);
mp_print_char (mp, xord ('='));
@@ -31707,7 +31673,7 @@ void mp_do_show_whatever (MP mp) {
mp_back_error (mp, "OK", hlp, true);
mp_get_x_next (mp);
}
-@.OK@>;
+@.OK@>
}
}
@@ -31718,35 +31684,35 @@ void mp_do_show_whatever (MP mp) {
@d contour_code 1 /* command modifier for `\&{contour}' */
@d also_code 2 /* command modifier for `\&{also}' */
-@ Pre and postscripts need two new identifiers:
+@ Pre- and postscripts need two new identifiers:
@d with_mp_pre_script 11
@d with_mp_post_script 13
@<Put each...@>=
mp_primitive (mp, "doublepath", mp_thing_to_add, double_path_code);
-@:double_path_}{\&{doublepath} primitive@>;
+@:double_path_}{\&{doublepath} primitive@>
mp_primitive (mp, "contour", mp_thing_to_add, contour_code);
-@:contour_}{\&{contour} primitive@>;
+@:contour_}{\&{contour} primitive@>
mp_primitive (mp, "also", mp_thing_to_add, also_code);
-@:also_}{\&{also} primitive@>;
+@:also_}{\&{also} primitive@>
mp_primitive (mp, "withpen", mp_with_option, mp_pen_type);
-@:with_pen_}{\&{withpen} primitive@>;
+@:with_pen_}{\&{withpen} primitive@>
mp_primitive (mp, "dashed", mp_with_option, mp_picture_type);
-@:dashed_}{\&{dashed} primitive@>;
+@:dashed_}{\&{dashed} primitive@>
mp_primitive (mp, "withprescript", mp_with_option, with_mp_pre_script);
-@:with_mp_pre_script_}{\&{withprescript} primitive@>;
+@:with_mp_pre_script_}{\&{withprescript} primitive@>
mp_primitive (mp, "withpostscript", mp_with_option, with_mp_post_script);
-@:with_mp_post_script_}{\&{withpostscript} primitive@>;
+@:with_mp_post_script_}{\&{withpostscript} primitive@>
mp_primitive (mp, "withoutcolor", mp_with_option, mp_no_model);
-@:with_color_}{\&{withoutcolor} primitive@>;
+@:with_color_}{\&{withoutcolor} primitive@>
mp_primitive (mp, "withgreyscale", mp_with_option, mp_grey_model);
-@:with_color_}{\&{withgreyscale} primitive@>;
+@:with_color_}{\&{withgreyscale} primitive@>
mp_primitive (mp, "withcolor", mp_with_option, mp_uninitialized_model);
@:with_color_}{\&{withcolor} primitive@>
/* \&{withrgbcolor} is an alias for \&{withcolor} */
mp_primitive (mp, "withrgbcolor", mp_with_option, mp_rgb_model);
-@:with_color_}{\&{withrgbcolor} primitive@>;
+@:with_color_}{\&{withrgbcolor} primitive@>
mp_primitive (mp, "withcmykcolor", mp_with_option, mp_cmyk_model);
@:with_color_}{\&{withcmykcolor} primitive@>
@@ -31799,7 +31765,7 @@ picture will ever contain a color outside the legal range for \ps\ graphics.
break;
cp = mp_link (cp);
}
-} while (0)
+} while (0)@;
@d clear_color(A) do {
set_number_to_zero(((mp_stroked_node)(A))->cyan);
@@ -31807,7 +31773,7 @@ picture will ever contain a color outside the legal range for \ps\ graphics.
set_number_to_zero(((mp_stroked_node)(A))->yellow);
set_number_to_zero(((mp_stroked_node)(A))->black);
mp_color_model ((A)) = mp_uninitialized_model;
-} while (0)
+} while (0)@;
@d set_color_val(A,B) do {
number_clone(A, (B));
@@ -31815,23 +31781,27 @@ picture will ever contain a color outside the legal range for \ps\ graphics.
set_number_to_zero(A);
if (number_greater(A,unity_t))
set_number_to_unity(A);
-} while (0)
+} while (0)@;
@c
static int is_invalid_with_list (MP mp, mp_variable_type t) {
- return ((t == with_mp_pre_script) && (mp->cur_exp.type != mp_string_type)) ||
- ((t == with_mp_post_script) && (mp->cur_exp.type != mp_string_type)) ||
- ((t == (mp_variable_type) mp_uninitialized_model) &&
- ((mp->cur_exp.type != mp_cmykcolor_type)
- && (mp->cur_exp.type != mp_color_type)
- && (mp->cur_exp.type != mp_known)
- && (mp->cur_exp.type != mp_boolean_type))) || ((t == (mp_variable_type) mp_cmyk_model)
- && (mp->cur_exp.type !=
- mp_cmykcolor_type))
- || ((t == (mp_variable_type) mp_rgb_model) && (mp->cur_exp.type != mp_color_type))
- || ((t == (mp_variable_type) mp_grey_model) && (mp->cur_exp.type != mp_known))
- || ((t == (mp_variable_type) mp_pen_type) && (mp->cur_exp.type != t))
- || ((t == (mp_variable_type) mp_picture_type) && (mp->cur_exp.type != t));
+ return ((t == with_mp_pre_script) && (mp->cur_exp.type != mp_string_type)) || @|
+ ((t == with_mp_post_script) && (mp->cur_exp.type != mp_string_type)) || @|
+ ((t == (mp_variable_type) mp_uninitialized_model) && @|
+ ((mp->cur_exp.type != mp_cmykcolor_type) @|
+ && (mp->cur_exp.type != mp_color_type) @|
+ && (mp->cur_exp.type != mp_known) @|
+ && (mp->cur_exp.type != mp_boolean_type))) || @|
+ ((t == (mp_variable_type) mp_cmyk_model) @|
+ && (mp->cur_exp.type != mp_cmykcolor_type)) || @|
+ ((t == (mp_variable_type) mp_rgb_model) @|
+ && (mp->cur_exp.type != mp_color_type)) || @|
+ ((t == (mp_variable_type) mp_grey_model) @|
+ && (mp->cur_exp.type != mp_known)) || @|
+ ((t == (mp_variable_type) mp_pen_type) @|
+ && (mp->cur_exp.type != t)) || @|
+ ((t == (mp_variable_type) mp_picture_type) @|
+ && (mp->cur_exp.type != t));
}
static void complain_invalid_with_list (MP mp, mp_variable_type t) {
/* Complain about improper type */
@@ -31856,7 +31826,7 @@ static void complain_invalid_with_list (MP mp, mp_variable_type t) {
else if (t == (mp_variable_type) mp_cmyk_model)
hlp[0] = "Next time say `withcmykcolor <known cmykcolor expression>';";
else if (t == (mp_variable_type) mp_grey_model)
- hlp[0] = "Next time say `withgreyscale <known numeric expression>';";;
+ hlp[0] = "Next time say `withgreyscale <known numeric expression>';";
mp_back_error (mp, "Improper type", hlp, true);
mp_get_x_next (mp);
mp_flush_cur_exp (mp, new_expr);
@@ -31873,7 +31843,7 @@ void mp_scan_with_list (MP mp, mp_node p) {
ap = MP_VOID;
bp = MP_VOID;
while (cur_cmd() == mp_with_option) {
- /* todo this is not very nice: the color models have their own enumeration */
+ /* TODO: this is not very nice: the color models have their own enumeration */
t = (mp_variable_type) cur_mod();
mp_get_x_next (mp);
if (t != (mp_variable_type) mp_no_model)
@@ -32192,7 +32162,7 @@ mp_edge_header_node mp_find_edges_var (MP mp, mp_node t) {
mp->selector = old_setting;
mp_snprintf (msg, 256, "Variable %s is the wrong type(%s)",
mp_str(mp, sname), mp_type_string(mp_type (p)));
-@.Variable x is the wrong type@>;
+@.Variable x is the wrong type@>
delete_str_ref(sname);
mp_back_error (mp, msg, hlp, true);
mp_get_x_next (mp);
@@ -32207,7 +32177,7 @@ mp_edge_header_node mp_find_edges_var (MP mp, mp_node t) {
@ @<Put each...@>=
mp_primitive (mp, "clip", mp_bounds_command, mp_start_clip_node_type);
-@:clip_}{\&{clip} primitive@>;
+@:clip_}{\&{clip} primitive@>
mp_primitive (mp, "setbounds", mp_bounds_command, mp_start_bounds_node_type);
@:set_bounds_}{\&{setbounds} primitive@>
@@ -32269,7 +32239,7 @@ mp_node mp_start_draw_cmd (MP mp, quarterword sep) {
return lhv;
}
-@ Here is an example of how to use |start_draw_cmd|.
+@ Here is an example of how to use |mp_start_draw_cmd|.
@<Declare action procedures for use by |do_statement|@>=
static void mp_do_bounds (MP mp);
@@ -32485,8 +32455,7 @@ void mp_do_ship_out (MP mp) {
@ The \&{everyjob} command simply assigns a nonzero value to the global variable
|start_sym|.
-
-@ @<Glob...@>=
+@<Glob...@>=
mp_sym start_sym; /* a symbolic token to insert at beginning of job */
@ @<Set init...@>=
@@ -32508,19 +32477,19 @@ mp->start_sym = NULL;
while ( f>g ) {
mp_print_char(mp, xord('0'));
decr(f);
- };
+ }
mp_print_int(mp, (A));
- };
+ }
f = 0;
- } while (0)
+ } while (0)@;
@<Put each...@>=
mp_primitive (mp, "message", mp_message_command, message_code);
-@:message_}{\&{message} primitive@>;
+@:message_}{\&{message} primitive@>
mp_primitive (mp, "errmessage", mp_message_command, err_message_code);
-@:err_message_}{\&{errmessage} primitive@>;
+@:err_message_}{\&{errmessage} primitive@>
mp_primitive (mp, "errhelp", mp_message_command, err_help_code);
-@:err_help_}{\&{errhelp} primitive@>;
+@:err_help_}{\&{errhelp} primitive@>
mp_primitive (mp, "filenametemplate", mp_message_command, filename_template_code);
@:filename_template_}{\&{filenametemplate} primitive@>
@@ -32541,8 +32510,7 @@ break;
@<Declare a procedure called |no_string_err|@>;
static void mp_do_message (MP mp);
-@
-@c
+@ @c
void mp_do_message (MP mp) {
int m; /* the type of message */
mp_value new_expr;
@@ -32592,7 +32560,7 @@ static void mp_no_string_err (MP mp, const char *s) {
const char *hlp[] = {s, NULL};
mp_disp_err(mp, NULL);
mp_back_error (mp, "Not a string", hlp, true);
-@.Not a string@>;
+@.Not a string@>
mp_get_x_next (mp);
}
@@ -32681,7 +32649,7 @@ void mp_do_write (MP mp) {
else {
@<Write |t| to the file named by |cur_exp|@>;
}
- /* |delete_str_ref(t);| *//* todo: is this right? */
+ /* |delete_str_ref(t);| *//* TODO: is this right? */
}
set_number_to_zero (new_expr.data.n);
mp_flush_cur_exp (mp, new_expr);
@@ -32692,9 +32660,9 @@ void mp_do_write (MP mp) {
{
@<Find |n| where |wr_fname[n]=cur_exp| and call |open_write_file| if
|cur_exp| must be inserted@>;
- if (mp_str_vs_str (mp, t, mp->eof_line) == 0) {
- @<Record the end of file on |wr_file[n]|@>;
- } else {
+ if (mp_str_vs_str (mp, t, mp->eof_line) == 0)
+ @<Record the end of file on |wr_file[n]|@>@;
+ else {
old_setting = mp->selector;
mp->selector = n + write_file;
mp_print_str (mp, t);
@@ -33136,7 +33104,7 @@ static mp_node mp_tfm_check (MP mp, quarterword m) {
@.Enormous chardp...@>
@.Enormous charht...@>
@.Enormous charic...@>
-@.Enormous designsize...@>;
+@.Enormous designsize...@>
mp_back_error (mp, msg, hlp, true);
mp_get_x_next (mp);
if (number_positive (internal_value (m))) {
@@ -33167,13 +33135,14 @@ mp->tfm_height[c] = mp_tfm_check (mp, mp_char_ht);
mp_free_value_node (mp, mp->tfm_depth[c]);
mp->tfm_depth[c] = mp_tfm_check (mp, mp_char_dp);
mp_free_value_node (mp, mp->tfm_ital_corr[c]);
-mp->tfm_ital_corr[c] = mp_tfm_check (mp, mp_char_ic)
+mp->tfm_ital_corr[c] = mp_tfm_check (mp, mp_char_ic)@;
@ Now let's consider \MP's special \.{TFM}-oriented commands.
-@ @d char_list_code 0
+@
+@d char_list_code 0
@d lig_table_code 1
@d extensible_code 2
@d header_byte_code 3
@@ -33181,13 +33150,13 @@ mp->tfm_ital_corr[c] = mp_tfm_check (mp, mp_char_ic)
@<Put each...@>=
mp_primitive (mp, "charlist", mp_tfm_command, char_list_code);
-@:char_list_}{\&{charlist} primitive@>;
+@:char_list_}{\&{charlist} primitive@>
mp_primitive (mp, "ligtable", mp_tfm_command, lig_table_code);
-@:lig_table_}{\&{ligtable} primitive@>;
+@:lig_table_}{\&{ligtable} primitive@>
mp_primitive (mp, "extensible", mp_tfm_command, extensible_code);
-@:extensible_}{\&{extensible} primitive@>;
+@:extensible_}{\&{extensible} primitive@>
mp_primitive (mp, "headerbyte", mp_tfm_command, header_byte_code);
-@:header_byte_}{\&{headerbyte} primitive@>;
+@:header_byte_}{\&{headerbyte} primitive@>
mp_primitive (mp, "fontdimen", mp_tfm_command, font_dimen_code);
@:font_dimen_}{\&{fontdimen} primitive@>
@@ -33242,7 +33211,7 @@ eight_bits mp_get_code (MP mp) { /* scans a charac
mp_disp_err(mp, NULL);
set_number_to_zero (new_expr.data.n);
mp_back_error (mp, "Invalid code has been replaced by 0", hlp, true);
-@.Invalid code...@>;
+@.Invalid code...@>
mp_get_x_next (mp);
mp_flush_cur_exp (mp, new_expr);
c = 0;
@@ -33263,9 +33232,8 @@ void mp_set_tag (MP mp, halfword c, quarterword t, halfword r) {
mp->label_loc[mp->label_ptr] = (short) r;
mp->label_char[mp->label_ptr] = (eight_bits) c;
}
- } else {
- @<Complain about a character tag conflict@>;
- }
+ } else
+ @<Complain about a character tag conflict@>@;
}
@@ -33290,7 +33258,7 @@ void mp_set_tag (MP mp, halfword c, quarterword t, halfword r) {
} else {
mp_snprintf(msg, 256, "Character code %d is already %s", c, xtra);
}
-@.Character c is already...@>;
+@.Character c is already...@>
mp_back_error (mp, msg, hlp, true);
mp_get_x_next (mp);
}
@@ -33315,7 +33283,7 @@ void mp_do_tfm_command (MP mp) {
cc = mp_get_code (mp);
mp_set_tag (mp, c, list_tag, cc);
c = cc;
- };
+ }
break;
case lig_table_code:
if (mp->lig_kern == NULL)
@@ -33343,7 +33311,7 @@ void mp_do_tfm_command (MP mp) {
NULL };
mp_disp_err(mp, NULL);
mp_back_error (mp, "Improper location", hlp, true);
-@.Improper location@>;
+@.Improper location@>
mp_get_x_next (mp);
} else {
j = round_unscaled (cur_exp_value_number ());
@@ -33352,11 +33320,11 @@ void mp_do_tfm_command (MP mp) {
"A colon should follow a headerbyte or fontinfo location.",
NULL };
mp_back_error (mp, "Missing `:' has been inserted", hlp, true);
-@.Missing `:'@>;
+@.Missing `:'@>
}
- if (c == header_byte_code) {
- @<Store a list of header bytes@>;
- } else {
+ if (c == header_byte_code)
+ @<Store a list of header bytes@>@;
+ else {
if (mp->param == NULL) {
int i;
mp->param = xmalloc ((max_tfm_int + 1), sizeof (mp_number));
@@ -33384,16 +33352,15 @@ CONTINUE:
} else {
mp_back_input (mp);
c = mp_get_code (mp);
- };
- if ((cur_cmd() == mp_colon) || (cur_cmd() == mp_double_colon)) {
- @<Record a label in a lig/kern subprogram and |goto continue|@>;
}
- if (cur_cmd() == mp_lig_kern_token) {
- @<Compile a ligature/kern command@>;
- } else {
+ if ((cur_cmd() == mp_colon) || (cur_cmd() == mp_double_colon))
+ @<Record a label in a lig/kern subprogram and |goto continue|@>@;
+ if (cur_cmd() == mp_lig_kern_token)
+ @<Compile a ligature/kern command@>@;
+ else {
const char *hlp[] = { "I was looking for `=:' or `kern' here.", NULL };
mp_back_error (mp, "Illegal ligtable step", hlp, true);
-@.Illegal ligtable step@>;
+@.Illegal ligtable step@>
next_char (mp->nl) = qi (0);
op_byte (mp->nl) = qi (0);
rem_byte (mp->nl) = qi (0);
@@ -33411,21 +33378,21 @@ DONE:
@ @<Put each...@>=
mp_primitive (mp, "=:", mp_lig_kern_token, 0);
-@:=:_}{\.{=:} primitive@>;
+@:=:_}{\.{=:} primitive@>
mp_primitive (mp, "=:|", mp_lig_kern_token, 1);
-@:=:/_}{\.{=:\char'174} primitive@>;
+@:=:/_}{\.{=:\char'174} primitive@>
mp_primitive (mp, "=:|>", mp_lig_kern_token, 5);
-@:=:/>_}{\.{=:\char'174>} primitive@>;
+@:=:/>_}{\.{=:\char'174>} primitive@>
mp_primitive (mp, "|=:", mp_lig_kern_token, 2);
-@:=:/_}{\.{\char'174=:} primitive@>;
+@:=:/_}{\.{\char'174=:} primitive@>
mp_primitive (mp, "|=:>", mp_lig_kern_token, 6);
-@:=:/>_}{\.{\char'174=:>} primitive@>;
+@:=:/>_}{\.{\char'174=:>} primitive@>
mp_primitive (mp, "|=:|", mp_lig_kern_token, 3);
-@:=:/_}{\.{\char'174=:\char'174} primitive@>;
+@:=:/_}{\.{\char'174=:\char'174} primitive@>
mp_primitive (mp, "|=:|>", mp_lig_kern_token, 7);
-@:=:/>_}{\.{\char'174=:\char'174>} primitive@>;
+@:=:/>_}{\.{\char'174=:\char'174>} primitive@>
mp_primitive (mp, "|=:|>>", mp_lig_kern_token, 11);
-@:=:/>_}{\.{\char'174=:\char'174>>} primitive@>;
+@:=:/>_}{\.{\char'174=:\char'174>>} primitive@>
mp_primitive (mp, "kern", mp_lig_kern_token, mp_kern_flag);
@:kern_}{\&{kern} primitive@>
@@ -33476,7 +33443,7 @@ We may need to cancel skips that span more than 127 lig/kern steps.
do {
mp->lll=qo(skip_byte(mp->ll));
skip_byte(mp->ll)=stop_flag; mp->ll=(short)(mp->ll-mp->lll);
- } while (mp->lll!=0)
+ } while (mp->lll!=0)@;
@d skip_error(A) {
const char *hlp[] = { "At most 127 lig/kern steps can separate skipto1 from 1::.", NULL};
@@ -33543,7 +33510,7 @@ We may need to cancel skips that span more than 127 lig/kern steps.
mp_disp_err(mp, NULL);
set_number_to_zero (new_expr.data.n);
mp_back_error (mp, "Improper kern", hlp, true);
-@.Improper kern@>;
+@.Improper kern@>
mp_get_x_next (mp);
mp_flush_cur_exp (mp, new_expr);
}
@@ -33575,7 +33542,7 @@ We may need to cancel skips that span more than 127 lig/kern steps.
@<Define an extensible recipe@>=
{
if (mp->ne == 256)
- mp_fatal_error (mp, "too many extensible recipies");
+ mp_fatal_error (mp, "too many extensible recipes");
c = mp_get_code (mp);
mp_set_tag (mp, c, ext_tag, mp->ne);
if (cur_cmd() != mp_colon)
@@ -33600,26 +33567,28 @@ have to sure to update the end of stream marker to reflect the
actual position.
@<Store a list of header bytes@>=
-j--;
-if (mp->header_last<j){
- mp->header_last=j;
-}
-do {
- if (j >= mp->header_size) {
- size_t l = (size_t) (mp->header_size + (mp->header_size / 4));
- char *t = xmalloc (l, 1);
- memset (t, 0, l);
- (void) memcpy (t, mp->header_byte, (size_t) mp->header_size);
- xfree (mp->header_byte);
- mp->header_byte = t;
- mp->header_size = (int) l;
- }
- mp->header_byte[j] = (char) mp_get_code (mp);
+{
+ j--;
if (mp->header_last<j){
- incr (mp->header_last);
+ mp->header_last=j;
}
- incr (j);
-} while (cur_cmd() == mp_comma)
+ do {
+ if (j >= mp->header_size) {
+ size_t l = (size_t) (mp->header_size + (mp->header_size / 4));
+ char *t = xmalloc (l, 1);
+ memset (t, 0, l);
+ (void) memcpy (t, mp->header_byte, (size_t) mp->header_size);
+ xfree (mp->header_byte);
+ mp->header_byte = t;
+ mp->header_size = (int) l;
+ }
+ mp->header_byte[j] = (char) mp_get_code (mp);
+ if (mp->header_last<j){
+ incr (mp->header_last);
+ }
+ incr (j);
+ } while (cur_cmd() == mp_comma);
+}
@ @<Store a list of font dimensions@>=
do {
@@ -33628,7 +33597,7 @@ do {
while (j > mp->np) {
mp->np++;
set_number_to_zero(mp->param[mp->np]);
- };
+ }
mp_get_x_next (mp);
mp_scan_expression (mp);
if (mp->cur_exp.type != mp_known) {
@@ -33636,13 +33605,13 @@ do {
mp_disp_err(mp, NULL);
set_number_to_zero (new_expr.data.n);
mp_back_error (mp, "Improper font parameter", hlp, true);
-@.Improper font parameter@>;
+@.Improper font parameter@>
mp_get_x_next (mp);
mp_flush_cur_exp (mp, new_expr);
}
number_clone (mp->param[j], cur_exp_value_number ());
incr (j);
-} while (cur_cmd() == mp_comma)
+} while (cur_cmd() == mp_comma)@;
@ OK: We've stored all the data that is needed for the \.{TFM} file.
All that remains is to output it in the correct format.
@@ -33810,9 +33779,8 @@ static integer mp_skimp (MP mp, integer m) {
number_clone (l, value_number (p));
set_indep_value (p,m);
set_number_from_addition (l_d, l, d);
- if (number_lessequal (value_number (mp_link (p)), l_d)) {
- @<Replace an interval of values by its midpoint@>;
- }
+ if (number_lessequal (value_number (mp_link (p)), l_d))
+ @<Replace an interval of values by its midpoint@>@;
q = p;
p = mp_link (p);
}
@@ -33863,7 +33831,7 @@ static void mp_tfm_warning (MP mp, quarterword m) {
@.some charwds...@>
@.some chardps...@>
@.some charhts...@>
-@.some charics...@>;
+@.some charics...@>
mp_print (mp, " values had to be adjusted by as much as ");
print_number (mp->perturbation);
mp_print (mp, "pt)");
@@ -33970,7 +33938,7 @@ static void mp_fix_design_size (MP mp) {
if (number_less(d, unity_t) || number_greaterequal(d, fraction_half_t)) {
if (!number_zero (d))
mp_print_nl (mp, "(illegal design size has been changed to 128pt)");
-@.illegal design size...@>;
+@.illegal design size...@>
set_number_from_scaled (d, 040000000);
number_clone (internal_value (mp_design_size), d);
}
@@ -34098,7 +34066,7 @@ Here are some utility routines for this purpose.
@d tfm_out(A) do { /* output one byte to |tfm_file| */
unsigned char s=(unsigned char)(A);
(mp->write_binary_file)(mp,mp->tfm_file,(void *)&s,1);
- } while (0)
+ } while (0)@;
@c
static void mp_tfm_two (MP mp, integer x) { /* output two bytes to |tfm_file| */
@@ -34112,7 +34080,7 @@ static void mp_tfm_four (MP mp, integer x) { /* ou
x = x + 010000000000; /* use two's complement for negative values */
x = x + 010000000000;
tfm_out ((x / three_bytes) + 128);
- };
+ }
x = x % three_bytes;
tfm_out (x / number_to_scaled (unity_t));
x = x % number_to_scaled (unity_t);
@@ -34144,8 +34112,8 @@ if (number_positive (internal_value (mp_tracing_stats)))
mp_print_nl (mp, "Font metrics written on ");
mp_print (mp, mp->metric_file_name);
mp_print_char (mp, xord ('.'));
-@.Font metrics written...@>;
-(mp->close_file) (mp, mp->tfm_file)
+@.Font metrics written...@>
+(mp->close_file) (mp, mp->tfm_file)@;
@ Integer variables |lh|, |k|, and |lk_offset| will be defined when we use
@@ -34187,7 +34155,7 @@ for (k = mp->bc; k <= mp->ec; k++) {
tfm_out ((indep_value (mp->tfm_height[k])) * 16 + indep_value (mp->tfm_depth[k]));
tfm_out ((indep_value (mp->tfm_ital_corr[k])) * 4 + mp->char_tag[k]);
tfm_out (mp->char_remainder[k]);
- };
+ }
}
mp->tfm_changed = 0;
for (k = 1; k <= 4; k++) {
@@ -34256,7 +34224,7 @@ for (k = 0; k <= 255; k++) {
mp_print_nl (mp, "(local label ");
mp_print_int (mp, k);
mp_print (mp, ":: was missing)");
-@.local label l:: was missing@>;
+@.local label l:: was missing@>
cancel_skips (mp->skip_table[k]);
}
}
@@ -34273,7 +34241,7 @@ if (mp->lk_started) { /* |lk_offset=1| for the special |bchar| */
} else {
tfm_out (255);
tfm_out (mp->bchar);
- };
+ }
mp_tfm_two (mp, mp->ll + lk_offset);
do {
mp->label_ptr--;
@@ -34325,7 +34293,7 @@ if (mp->tfm_changed > 0) {
} else {
mp_print_nl (mp, "(");
mp_print_int (mp, mp->tfm_changed);
-@.font metric dimensions...@>;
+@.font metric dimensions...@>
mp_print (mp, " font metric dimensions");
}
mp_print (mp, " had to be decreased)");
@@ -34423,8 +34391,7 @@ xfree (mp->height_base);
xfree (mp->depth_base);
xfree (mp->font_sizes);
-@
-@c
+@ @c
void mp_reallocate_fonts (MP mp, font_number l) {
font_number f;
XREALLOC (mp->font_enc_name, l, char *);
@@ -34491,7 +34458,7 @@ The corresponding words in the width, height, and depth tables are stored as
|scaled| values in units of \ps\ points.
With the macros below, the |char_info| word for character~|c| in font~|f| is
-|char_mp_info(f,c)| and the width is
+|char_mp_info(f,c)| and the width~is
$$\hbox{|char_width(f,char_mp_info(f,c)).sc|.}$$
@d char_mp_info(A,B) mp->font_info[mp->char_base[(A)]+(B)].qqqq
@@ -34567,7 +34534,7 @@ void mp_lost_warning (MP mp, font_number f, int k) {
if (mp->selector == log_only)
incr (mp->selector);
mp_print_nl (mp, "Missing character: There is no ");
-@.Missing character@>;
+@.Missing character@>
mp_print_int (mp, k);
mp_print (mp, " in font ");
mp_print (mp, mp->font_name[f]);
@@ -34605,9 +34572,8 @@ void mp_set_text_box (MP mp, mp_text_node p) {
ec = mp->font_ec[f];
kk = mp_text_p (p)->len;
k = 0;
- while (k < kk) {
- @<Adjust |p|'s bounding box to contain |str_pool[k]|; advance |k|@>;
- }
+ while (k < kk)
+ @<Adjust |p|'s bounding box to contain |str_pool[k]|; advance |k|@>@;
@<Set the height and depth to zero if the bounding box is empty@>;
free_number (h);
free_number (d);
@@ -34659,18 +34625,18 @@ static void mp_do_mapline (MP mp);
static void mp_do_mapfile (MP mp) {
mp_get_x_next (mp);
mp_scan_expression (mp);
- if (mp->cur_exp.type != mp_string_type) {
- @<Complain about improper map operation@>;
- } else {
+ if (mp->cur_exp.type != mp_string_type)
+ @<Complain about improper map operation@>@;
+ else {
mp_map_file (mp, cur_exp_str ());
}
}
static void mp_do_mapline (MP mp) {
mp_get_x_next (mp);
mp_scan_expression (mp);
- if (mp->cur_exp.type != mp_string_type) {
- @<Complain about improper map operation@>;
- } else {
+ if (mp->cur_exp.type != mp_string_type)
+ @<Complain about improper map operation@>@;
+ else {
mp_map_line (mp, cur_exp_str ());
}
}
@@ -34686,7 +34652,7 @@ static void mp_do_mapline (MP mp) {
@ To print |scaled| value to PDF output we need some subroutines to ensure
-accurary.
+accuracy.
@d max_integer 0x7FFFFFFF /* $2^{31}-1$ */
@@ -34712,7 +34678,7 @@ file named according to the current \&{charcode}.
This is the only backend function that remains in the main |mpost.w| file.
There are just too many variable accesses needed for status reporting
-etcetera to make it worthwile to move the code to |psout.w|.
+etcetera to make it worthwhile to move the code to |psout.w|.
@<Internal library declarations@>=
void mp_open_output_file (MP mp);
@@ -34747,7 +34713,7 @@ char *mp_set_output_file_name (MP mp, integer c) {
if (c < 0)
s = xstrdup (".ps");
else
- @<Use |c| to compute the file extension |s|@>;
+ @<Use |c| to compute the file extension |s|@>@;
mp_pack_job_name (mp, s);
free (s);
ss = xstrdup (mp->name_of_file);
@@ -34882,7 +34848,7 @@ char *mp_set_output_file_name (MP mp, integer c) {
if (n->len == 0)
n = mp_make_string (mp);
mp_print_char (mp, *(ftemplate->str + i));
- };
+ }
incr (i);
}
s = mp_make_string (mp);
@@ -34985,13 +34951,13 @@ else if ((mp->term_offset > 0) || (mp->file_offset > 0))
mp_print_char (mp, xord (' '));
mp_print_char (mp, xord ('['));
if (c >= 0)
- mp_print_int (mp, c)
+ mp_print_int (mp, c)@;
@ @<End progress report@>=
mp_print_char (mp, xord (']'));
update_terminal();
-incr (mp->total_shipped)
+incr (mp->total_shipped)@;
@ @<Explain what output files were written@>=
@@ -35043,9 +35009,9 @@ static void mp_do_special (MP mp);
void mp_do_special (MP mp) {
mp_get_x_next (mp);
mp_scan_expression (mp);
- if (mp->cur_exp.type != mp_string_type) {
- @<Complain about improper special operation@>;
- } else {
+ if (mp->cur_exp.type != mp_string_type)
+ @<Complain about improper special operation@>@;
+ else {
mp_link (mp->last_pending) = mp_stash_cur_exp (mp);
mp->last_pending = mp_link (mp->last_pending);
mp_link (mp->last_pending) = NULL;
@@ -35065,9 +35031,9 @@ void mp_do_special (MP mp) {
@ On the export side, we need an extra object type for special strings.
@<Graphical object codes@>=
-mp_special_code = 8,
+mp_special_code = 8,@[@]@;
-@ @<Export pending specials@>=
+@ @s mp_special_object int @<Export pending specials@>=
p = mp_link (mp->spec_head);
while (p != NULL) {
mp_special_object *tp;
@@ -35082,7 +35048,7 @@ while (p != NULL) {
}
mp_flush_token_list (mp, mp_link (mp->spec_head));
mp_link (mp->spec_head) = NULL;
-mp->last_pending = mp->spec_head
+mp->last_pending = mp->spec_head@;
@ We are now ready for the main output procedure. Note that the |selector|
setting is saved in a global variable so that |begin_diagnostic| can access it.
@@ -35092,13 +35058,21 @@ static void mp_ship_out (MP mp, mp_node h);
@ Once again, the |gr_XXXX| macros are defined in |mppsout.h|
+@s mp_edge_object int
+@s mp_graphic_object int
+@s mp_text_object int
+@s mp_fill_object int
+@s mp_stroked_object int
+@s mp_clip_object int
+@s mp_bounds_object int
+
@d export_color(q,p)
if ( mp_color_model(p)==mp_uninitialized_model ) {
- gr_color_model(q) = (unsigned char)(number_to_scaled (internal_value(mp_default_color_model))/65536);
+ gr_color_model(q) = (unsigned char)@|(number_to_scaled (internal_value(mp_default_color_model))/65536);
gr_cyan_val(q) = 0;
gr_magenta_val(q) = 0;
gr_yellow_val(q) = 0;
- gr_black_val(q) = ((gr_color_model(q)==mp_cmyk_model ? number_to_scaled (unity_t) : 0) / 65536.0);
+ gr_black_val(q) = ((gr_color_model(q)==mp_cmyk_model ? @| number_to_scaled (unity_t) : 0) / 65536.0);
} else {
gr_color_model(q) = (unsigned char)mp_color_model(p);
gr_cyan_val(q) = number_to_double(p->cyan);
@@ -35342,8 +35316,7 @@ void mp_ship_out (MP mp, mp_node h) { /* output ed
@ @<Declarations@>=
static void mp_shipout_backend (MP mp, void *h);
-@
-@c
+@ @c
void mp_shipout_backend (MP mp, void *voidh) {
char *s;
mp_edge_object *hh; /* the first graphical object */
@@ -35367,7 +35340,7 @@ void mp_shipout_backend (MP mp, void *voidh) {
@ @<Exported types@>=
-typedef void (*mp_backend_writer) (MP, void *);
+typedef void @[@] (*mp_backend_writer) (MP, void *);
@ @<Option variables@>=
mp_backend_writer shipout_backend;
@@ -35452,7 +35425,7 @@ boolean mp_load_preload_file (MP mp) {
mp->reading_preload = true;
do {
mp_do_statement (mp);
- } while (!(cur_cmd() == mp_stop)); /* "dump" or EOF */
+ } while (!(cur_cmd() == mp_stop)); /* ``dump'' or EOF */
mp->reading_preload = false;
mp_primitive (mp, "dump", mp_relax, 0); /* reset |dump| */
while (mp->input_ptr > 0) {
@@ -35466,10 +35439,10 @@ boolean mp_load_preload_file (MP mp) {
while (mp->open_parens > 0) {
mp_print (mp, " )");
decr (mp->open_parens);
- };
+ }
while (mp->cond_ptr != NULL) {
mp_print_nl (mp, "(dump occurred when ");
-@.dump occurred...@>;
+@.dump occurred...@>
mp_print_cmd_mod (mp, mp_fi_or_else, mp->cur_if);
/* `\.{if}' or `\.{elseif}' or `\.{else}' */
if (mp->if_line != 0) {
@@ -35531,7 +35504,7 @@ void mp_close_files_and_terminate (MP mp) {
mp->selector = mp->selector - 2;
if (mp->selector == term_only) {
mp_print_nl (mp, "Transcript written on ");
-@.Transcript written...@>;
+@.Transcript written...@>
mp_print (mp, mp->log_name);
mp_print_char (mp, xord ('.'));
}
@@ -35606,7 +35579,7 @@ if (mp->log_opened) {
char s[128];
wlog_ln (" ");
wlog_ln ("Here is how much of MetaPost's memory you used:");
-@.Here is how much...@>;
+@.Here is how much...@>
mp_snprintf (s, 128, " %i string%s using %i character%s",
(int) mp->max_strs_used, (mp->max_strs_used != 1 ? "s" : ""),
(int) mp->max_pl_used, (mp->max_pl_used != 1 ? "s" : ""));
@@ -35625,7 +35598,7 @@ if (mp->log_opened) {
wlog_ln (s);
}
-@ It is nice to have have some of the stats available from the API.
+@ It is nice to have some of the stats available from the API.
@<Exported function ...@>=
int mp_memory_usage (MP mp);
@@ -35653,7 +35626,7 @@ been scanned.
@c
void mp_final_cleanup (MP mp) {
- /* -Wunused: integer c; */ /* 0 for \&{end}, 1 for \&{dump} */
+ /* \.{-Wunused}: integer c; */ /* 0 for \&{end}, 1 for \&{dump} */
/* clang: never read: |c = cur_mod();| */
if (mp->job_name == NULL)
mp_open_log_file (mp);
@@ -35668,10 +35641,10 @@ void mp_final_cleanup (MP mp) {
while (mp->open_parens > 0) {
mp_print (mp, " )");
decr (mp->open_parens);
- };
+ }
while (mp->cond_ptr != NULL) {
mp_print_nl (mp, "(end occurred when ");
-@.end occurred...@>;
+@.end occurred...@>
mp_print_cmd_mod (mp, mp_fi_or_else, mp->cur_if);
/* `\.{if}' or `\.{elseif}' or `\.{else}' */
if (mp->if_line != 0) {
@@ -35690,7 +35663,7 @@ void mp_final_cleanup (MP mp) {
mp->selector = term_only;
mp_print_nl (mp,
"(see the transcript file for additional information)");
-@.see the transcript file...@>;
+@.see the transcript file...@>
mp->selector = term_and_log;
}
}
diff --git a/Build/source/texk/web2c/mplibdir/mpmathbinary.w b/Build/source/texk/web2c/mplibdir/mpmathbinary.w
index 159fae019af..78e7c2bcc1c 100644
--- a/Build/source/texk/web2c/mplibdir/mpmathbinary.w
+++ b/Build/source/texk/web2c/mplibdir/mpmathbinary.w
@@ -149,7 +149,7 @@ static double precision_bits_to_digits (mpfr_prec_t i);
@d mpfr_negative_p(a) (mpfr_sgn((a))<0)
@d mpfr_positive_p(a) (mpfr_sgn((a))>0)
-@d checkZero(dec) if (mpfr_zero_p(dec) && mpfr_negative_p(dec)) {
+@d checkZero(dec) if (mpfr_zero_p(dec)) {
mpfr_set_zero(dec,1);
}
@@ -1677,7 +1677,9 @@ void mp_init_randoms (MP mp, int seed) {
@ @c
void mp_binary_number_modulo (mp_number *a, mp_number b) {
- mpfr_remainder (a->data.num, a->data.num, b.data.num, ROUNDING);
+ /* mpfr_remainder (a->data.num, a->data.num, b.data.num, ROUNDING);*/
+ /* This is consistent with scaled mode */
+ mpfr_fmod (a->data.num, a->data.num, b.data.num, ROUNDING);
}
@ To consume a random integer for the uniform generator, the program below will say `|next_unif_random|'.
diff --git a/Build/source/texk/web2c/mplibdir/mpmathdouble.w b/Build/source/texk/web2c/mplibdir/mpmathdouble.w
index cb14969365f..8f51439c26d 100644
--- a/Build/source/texk/web2c/mplibdir/mpmathdouble.w
+++ b/Build/source/texk/web2c/mplibdir/mpmathdouble.w
@@ -1172,6 +1172,11 @@ void mp_double_n_arg (MP mp, mp_number *ret, mp_number x_orig, mp_number y_orig)
@<Handle undefined arg@>;
} else {
ret->type = mp_angle_type;
+ /* Consistency with the other numbersystems */
+ if (x_orig.data.dval == -0.0)
+ x_orig.data.dval = 0.0;
+ if (y_orig.data.dval == -0.0)
+ y_orig.data.dval = 0.0;
ret->data.dval = atan2 (y_orig.data.dval, x_orig.data.dval) * (180.0 / PI) * angle_multiplier;
if (ret->data.dval == -0.0)
ret->data.dval = 0.0;
diff --git a/Build/source/texk/web2c/mplibdir/mpmathinterval.w b/Build/source/texk/web2c/mplibdir/mpmathinterval.w
index 755e4dd328d..4412fd561d1 100644
--- a/Build/source/texk/web2c/mplibdir/mpmathinterval.w
+++ b/Build/source/texk/web2c/mplibdir/mpmathinterval.w
@@ -317,7 +317,9 @@ static int mpfi_remainder_1 (mpfi_t r, mpfi_t x, mpfr_t m) {
mpfr_inits2(precision_bits, d, abs_m, rem_a, rem_b, zero, one, abs_m_1,(mpfr_ptr) 0);
mpfr_sub(d, b, a, MPFR_RNDN);
mpfr_abs(abs_m, m, MPFR_RNDN);
- mpfr_remainder(rem_a, a, m, MPFR_RNDN); mpfr_remainder(rem_b, b, m, MPFR_RNDN);
+ /*mpfr_remainder(rem_a, a, m, MPFR_RNDN); mpfr_remainder(rem_b, b, m, MPFR_RNDN); */
+ /* This is consistent with scaled mode */
+ mpfr_fmod(rem_a, a, m, MPFR_RNDN); mpfr_fmod(rem_b, b, m, MPFR_RNDN);
if (mpfr_less_p(d,abs_m) && mpfr_lessequal_p(rem_a,rem_b)) {
/*return [a % m, b % m] */
ret_val= mpfi_interv_fr(r, rem_a, rem_b);
@@ -1879,8 +1881,8 @@ void mp_interval_n_arg (MP mp, mp_number *ret, mp_number x_orig, mp_number y_ori
ret->type = mp_angle_type;
mpfi_set_si(oneeighty_angle, 180 * angle_multiplier);
mpfi_div(oneeighty_angle, oneeighty_angle, PI_mpfi_t);
- checkZero((mpfi_ptr)y_orig.data.num);
- checkZero((mpfi_ptr)x_orig.data.num);
+ /*checkZero((mpfi_ptr)y_orig.data.num);*/
+ /*checkZero((mpfi_ptr)x_orig.data.num);*/
mpfi_atan2(atan2val, y_orig.data.num, x_orig.data.num);
mpfi_mul(ret->data.num, atan2val, oneeighty_angle);
checkZero((mpfi_ptr)ret->data.num);
diff --git a/Build/source/texk/web2c/omegafonts/Makefile.in b/Build/source/texk/web2c/omegafonts/Makefile.in
index a63ee7d60b2..385af83c86a 100644
--- a/Build/source/texk/web2c/omegafonts/Makefile.in
+++ b/Build/source/texk/web2c/omegafonts/Makefile.in
@@ -108,6 +108,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/web2c-disable.m4 \
$(top_srcdir)/../../m4/kpse-harfbuzz-flags.m4 \
$(top_srcdir)/../../m4/kpse-icu-flags.m4 \
$(top_srcdir)/../../m4/kpse-kpathsea-flags.m4 \
+ $(top_srcdir)/../../m4/kpse-largefile.m4 \
$(top_srcdir)/../../m4/kpse-lex.m4 \
$(top_srcdir)/../../m4/kpse-lib-version.m4 \
$(top_srcdir)/../../m4/kpse-libpng-flags.m4 \
diff --git a/Build/source/texk/web2c/patgen.ch b/Build/source/texk/web2c/patgen.ch
index 3d9054a446d..13775991b18 100644
--- a/Build/source/texk/web2c/patgen.ch
+++ b/Build/source/texk/web2c/patgen.ch
@@ -20,7 +20,7 @@
@d banner=='This is PATGEN, Version 2.4' {printed when the program starts}
@z
-@x Terminal I/O, Need standard input.
+@x [3] Terminal I/O, Need standard input.
@d get_input(#)==read(input,#)
@d get_input_ln(#)==
begin if eoln(input) then read_ln(input);
@@ -34,7 +34,7 @@
@d std_input==stdin
@z
-@x Eliminate the |end_of_PATGEN| label.
+@x [3] Eliminate the |end_of_PATGEN| label.
@d end_of_PATGEN=9999
@y
@z
@@ -43,7 +43,7 @@ label end_of_PATGEN;
@y
@z
-@x Add file opening to initialization
+@x [3] Add file opening to initialization
procedure initialize; {this procedure gets things started properly}
var @<Local variables for initialization@>@/
begin print_ln(banner);@/
@@ -79,7 +79,7 @@ error message about what caused the error.
@d error(#)==begin write_ln(stderr, #); uexit(1); end;
@z
-@x Fix signed char problem
+@x [12] Fix signed char problem
@!text_char=char; {the data type of characters in text files}
@!ASCII_code=0..last_ASCII_code; {internal representation of input characters}
@y
@@ -99,7 +99,7 @@ error message about what caused the error.
%
% If the values here are still too big, you can probably get it to work
% by adding swap or zram; or write a patch to allocate the arrays dynamically.
-@x
+@x [27]
@!trie_size=55000; {space for pattern trie}
@!triec_size=26000; {space for pattern count trie, must be less than
|trie_size| and greater than the number of occurrences of any pattern in
@@ -116,7 +116,7 @@ error message about what caused the error.
@!max_buf_len=3000; {maximum length of input lines, must be at least |max_len|}
@z
-@x Close both input and output files.
+@x [51] Close both input and output files.
@d close_out(#)==close(#) {close an output file}
@d close_in(#)==do_nothing {close an input file}
@y
@@ -124,7 +124,7 @@ error message about what caused the error.
@d close_in(#)==xfclose(#, 'inputfile') {close an input file}
@z
-@x Add f_name declaration, and temporaries for efficiency printing.
+@x [51] Add f_name declaration, and temporaries for efficiency printing.
@!dictionary, @!patterns, @!translate, @!patout, @!pattmp: text_file;
@y
@!dictionary, @!patterns, @!translate, @!patout, @!pattmp: text_file;
@@ -132,20 +132,20 @@ error message about what caused the error.
@!bad_frac, @!denom, @!eff: real;
@z
-@x Get translate filename from command line.
+@x [54] Get translate filename from command line.
reset(translate);
@y
f_name := cmdline (4);
reset (translate, f_name);
@z
-@x Input kludge.
+@x [57] Input kludge.
repeat print('left_hyphen_min, right_hyphen_min: '); get_input(n1,n2);@/
@y
repeat print('left_hyphen_min, right_hyphen_min: '); input_2ints(n1,n2);@/
@z
-@x Floating point output kludge for Web2c.
+@x [67] Floating point output kludge for Web2c.
print_ln(', efficiency = ',
good_count/(good_pat_count+bad_count/bad_eff):1:2)
@y
@@ -156,7 +156,7 @@ begin
end
@z
-@x Get dictionary filename from command line.
+@x [88] Get dictionary filename from command line.
reset(dictionary);@/
@y
f_name := cmdline(1);
@@ -165,7 +165,7 @@ reset (dictionary, f_name);
% Fix file name initialization, since can't assign a constant string
% that we're going to write into.
-@x
+@x [88]
begin filnam:='pattmp. ';
filnam[8]:=xdig[hyph_level];
@y
@@ -173,7 +173,7 @@ reset (dictionary, f_name);
filnam[7]:=xdig[hyph_level];
@z
-@x Work around floating point I/O deficiency; reorder to avoid overflow.
+@x [88] Work around floating point I/O deficiency; reorder to avoid overflow.
if (good_count+miss_count)>0 then
print_ln((100*good_count/(good_count+miss_count)):1:2,' %, ',
(100*bad_count/(good_count+miss_count)):1:2,' %, ',
@@ -189,14 +189,14 @@ reset (dictionary, f_name);
end;
@z
-@x Get pattern filename from command line.
+@x [90] Get pattern filename from command line.
reset(patterns);
@y
f_name := cmdline (2);
reset (patterns, f_name);
@z
-@x Fix reading of multiple variables in the same line
+@x [94] Fix reading of multiple variables in the same line
repeat print('hyph_start, hyph_finish: '); get_input(n1,n2);@/
@y
repeat print('hyph_start, hyph_finish: '); input_2ints(n1,n2);@/
@@ -212,19 +212,19 @@ repeat print('hyph_start, hyph_finish: '); input_2ints(n1,n2);@/
input_3ints(n1,n2,n3);@/
@z
-@x Get output file name from command line.
+@x [94] Get output file name from command line.
rewrite(patout);
@y
f_name := cmdline (3);
rewrite (patout, f_name);
@z
-@x Eliminate the |end_of_PATGEN| label.
+@x [94] Eliminate the |end_of_PATGEN| label.
end_of_PATGEN:
@y
@z
-@x System-dependent changes.
+@x [98] System-dependent changes.
This section should be replaced, if necessary, by changes to the program
that are necessary to make \.{PATGEN} work at a particular installation.
It is usually best to design your change file so that all changes to
diff --git a/Build/source/texk/web2c/pktogf.ch b/Build/source/texk/web2c/pktogf.ch
index edce6bfe7f4..9bbeb8e1481 100644
--- a/Build/source/texk/web2c/pktogf.ch
+++ b/Build/source/texk/web2c/pktogf.ch
@@ -20,7 +20,7 @@
\def\title{PK$\,$\lowercase{to}$\,$GF changes for C}
@z
-@x [1] Define my_name
+@x [2] Define my_name
@d banner=='This is PKtoGF, Version 1.1'
@y
@d my_name=='pktogf'
@@ -444,7 +444,7 @@ final_end :
@y
@z
-@x System-dependent changes.
+@x [74] System-dependent changes.
This section should be replaced, if necessary, by changes to the program
that are necessary to make \.{PKtoGF} work at a particular installation.
Any additional routines should be inserted here.
diff --git a/Build/source/texk/web2c/pktype.ch b/Build/source/texk/web2c/pktype.ch
index c8c0d59108a..54424d84bab 100644
--- a/Build/source/texk/web2c/pktype.ch
+++ b/Build/source/texk/web2c/pktype.ch
@@ -16,7 +16,7 @@
\def\title{PK$\,$\lowercase{type} changes for C}
@z
-@x [1] Define my_name
+@x [2] Define my_name
@d banner=='This is PKtype, Version 2.3' {printed when the program starts}
@y
@d my_name=='pktype'
@@ -97,7 +97,7 @@ end;
@d text_char == char {the data type of characters in text files}
@z
-@x [32] Remove typ_file from globals.
+@x [31] Remove typ_file from globals.
@ @<Glob...@>=
@!pk_file:byte_file; {where the input comes from}
@!typ_file:text_file; {where the final output goes}
@@ -108,7 +108,7 @@ end;
@^system dependencies@>
@z
-@x [33] Redo open_pk_file; scrap open_typ_file.
+@x [32] Redo open_pk_file; scrap open_typ_file.
@ To prepare these files for input and output, we |reset| and |rewrite| them.
An extension of \PASCAL\ is needed, since we want to associate files
with external names that are specified dynamically (i.e., not
@@ -137,7 +137,7 @@ begin
end;
@z
-@x [34] Change pk_loc to cur_loc, and use C strings, not arrays.
+@x [33] Change pk_loc to cur_loc, and use C strings, not arrays.
@!pk_name,@!typ_name:packed array[1..name_length] of char; {name of input
and output files}
@!pk_loc:integer; {how many bytes have we read?}
@@ -227,7 +227,7 @@ else signed_quad:=(((a-256)*256+b)*256+c)*256+d;
end;
@z
-@x [36] Don't need the <Open files> module.
+@x [35] Don't need the <Open files> module.
@ Now we are ready to open the files.
@<Open files@>=
@@ -245,7 +245,7 @@ t_print_ln(' ')
It is not needed when output goes to |stdout|.
@z
-@x [37] Redefine get_16 and get_32.
+@x [36] Redefine get_16 and get_32.
@p function get_16 : integer ;
var a : integer ;
begin a := pk_byte ; get_16 := a * 256 + pk_byte ; end ;
@@ -259,7 +259,7 @@ get_32 := a * 65536 + get_16 ; end ;
@d get_32==signed_quad
@z
-% [53] web2c can't handle the implied serialism in Pascal write
+% [52] web2c can't handle the implied serialism in Pascal write
% statements. (From Martyn.Johnson@cl.cam.ac.uk.)
@x
pk_yyy : t_print_ln((pk_loc-1):1,': Num special: ',get_32:1) ;
@@ -268,7 +268,7 @@ get_32 := a * 65536 + get_16 ; end ;
t_print_ln (': Num special: ',get_32:1) ; end;
@z
-@x [54--55] Eliminate the ``Terminal communication'' chapter.
+@x [53--54] Eliminate the ``Terminal communication'' chapter.
@* Terminal communication.
We must get the file names and determine whether input is to be in
hexadecimal or binary. To do this, we use the standard input path
@@ -309,7 +309,7 @@ end ;
@ So there is no |procedure dialog|.
@z
-@x [56] Restructure the main program.
+@x [55] Restructure the main program.
dialog ;
@<Open files@> ;
@y
@@ -320,7 +320,7 @@ final_end :
@y
@z
-@x System-dependent changes.
+@x [56] System-dependent changes.
This section should be replaced, if necessary, by changes to the program
that are necessary to make \.{PKtype} work at a particular installation.
Any additional routines should be inserted here.
diff --git a/Build/source/texk/web2c/pltotf.ch b/Build/source/texk/web2c/pltotf.ch
index d877353e73f..82e6c1d9a99 100644
--- a/Build/source/texk/web2c/pltotf.ch
+++ b/Build/source/texk/web2c/pltotf.ch
@@ -149,7 +149,7 @@ if verbose then @<Print |c| in octal notation@>;
print_ln(' units.'); end
@z
-% [118] Change the name of the variable `class', since AIX 3.1's <math.h>
+% [117] Change the name of the variable `class', since AIX 3.1's <math.h>
% defines a function by that name.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@x
diff --git a/Build/source/texk/web2c/pmpostdir/ChangeLog b/Build/source/texk/web2c/pmpostdir/ChangeLog
index 9f810f975e2..c1afb4a5364 100644
--- a/Build/source/texk/web2c/pmpostdir/ChangeLog
+++ b/Build/source/texk/web2c/pmpostdir/ChangeLog
@@ -1,3 +1,7 @@
+2024-05-02 Akira Kakuto <kakuto@jcom.zaq.ne.jp>
+
+ * pmp.ch: sync with the new mp.w.
+
2024-03-10 Karl Berry <karl@tug.org>
* TL'24 release.
diff --git a/Build/source/texk/web2c/pmpostdir/pmp.ch b/Build/source/texk/web2c/pmpostdir/pmp.ch
index a3e7e76bb40..07cf3218882 100644
--- a/Build/source/texk/web2c/pmpostdir/pmp.ch
+++ b/Build/source/texk/web2c/pmpostdir/pmp.ch
@@ -13,19 +13,19 @@
%
@x
-@d default_banner "This is MetaPost, Version 2.10" /* printed when \MP\ starts */
+@d default_banner "This is MetaPost, Version 2.11" /* printed when \MP\ starts */
@y
@z
@x
-#define metapost_version "2.10"
+#define metapost_version "2.11"
@y
#ifdef UPMP
#define P_UP "up"
-#define metapost_version "2.10-0.04-u1.30"
+#define metapost_version "2.11-0.04-u1.35"
#else
#define P_UP "p"
-#define metapost_version "2.10-0.04"
+#define metapost_version "2.11-0.04"
#endif
#define default_banner "This is " P_UP "MetaPost, Version " metapost_version /* printed when \MP\ starts */
@z
diff --git a/Build/source/texk/web2c/pooltype.ch b/Build/source/texk/web2c/pooltype.ch
index cbff918acf7..4ef47ad0ce3 100644
--- a/Build/source/texk/web2c/pooltype.ch
+++ b/Build/source/texk/web2c/pooltype.ch
@@ -38,7 +38,7 @@ procedure initialize; {this procedure gets things started properly}
@<Set initial values of key variables@>
@z
-% [??] The text_char type is used as an array index into xord. The
+% [6] The text_char type is used as an array index into xord. The
% default type `char' produces signed integers, which are bad array
% indices in C.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -48,7 +48,7 @@ procedure initialize; {this procedure gets things started properly}
@d text_char == ASCII_code {the data type of characters in text files}
@z
-@x [12] Permissiveness
+@x [10] Permissiveness
for i:=0 to @'37 do xchr[i]:=' ';
for i:=@'177 to @'377 do xchr[i]:=' ';
@y
@@ -56,21 +56,21 @@ for i:=0 to @'37 do xchr[i]:=chr(i);
for i:=@'177 to @'377 do xchr[i]:=chr(i);
@z
-@x Write errors to stderr, avoid nonlocal label.
+@x [15] Write errors to stderr, avoid nonlocal label.
@d abort(#)==begin write_ln(#); goto 9999;
end
@y
@d abort(#)==begin write_ln(stderr, #); uexit(1); end
@z
-@x Remove unused label from end of program; add uexit(0) call
+@x [15] Remove unused label from end of program; add uexit(0) call
9999:end.
@y
uexit(0);
end.
@z
-@x Add pool_name variable.
+@x [18] Add pool_name variable.
@!pool_file:packed file of text_char;
{the string-pool file output by \.{TANGLE}}
@y
@@ -79,7 +79,7 @@ end.
@!pool_name:const_c_string;
@z
-% The name of the pool file is dynamically determined. We open it at the
+% [19] The name of the pool file is dynamically determined. We open it at the
% end of parse_arguments.
@x
reset(pool_file); xsum:=false;
@@ -87,13 +87,13 @@ reset(pool_file); xsum:=false;
xsum:=false;
@z
-@x Change single read into two reads
+@x [20] Change single read into two reads
read(pool_file,m,n); {read two digits of string length}
@y
read(pool_file,m); read(pool_file,n); {read two digits of string length}
@z
-@x System-dependent changes.
+@x [21] System-dependent changes.
This section should be replaced, if necessary, by changes to the program
that are necessary to make \.{POOLtype} work at a particular installation.
It is usually best to design your change file so that all changes to
diff --git a/Build/source/texk/web2c/ptexdir/ChangeLog b/Build/source/texk/web2c/ptexdir/ChangeLog
index 73a3fbe1c2b..2fe03aef772 100644
--- a/Build/source/texk/web2c/ptexdir/ChangeLog
+++ b/Build/source/texk/web2c/ptexdir/ChangeLog
@@ -1,3 +1,9 @@
+2024-05-18 Hironori Kitagawa <h_kitagawa2001@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@t-lab.opal.ne.jp>
* ptriptest.test:
diff --git a/Build/source/texk/web2c/ptexdir/ptex-base.ch b/Build/source/texk/web2c/ptexdir/ptex-base.ch
index 3ed7b821e7b..6b77387d58e 100644
--- a/Build/source/texk/web2c/ptexdir/ptex-base.ch
+++ b/Build/source/texk/web2c/ptexdir/ptex-base.ch
@@ -2582,14 +2582,15 @@ if cur_tok<cs_token_flag then
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");
diff --git a/Build/source/texk/web2c/tangle.ch b/Build/source/texk/web2c/tangle.ch
index c3a9de3f8e9..066a7476581 100644
--- a/Build/source/texk/web2c/tangle.ch
+++ b/Build/source/texk/web2c/tangle.ch
@@ -36,7 +36,7 @@
% 11/30/89 (KB) Version 4.
% (more recent changes in the ChangeLog)
-@x [0] Print only changes.
+@x [0.0] l.43 - Print only changes.
\pageno=\contentspagenumber \advance\pageno by 1
@y
\pageno=\contentspagenumber \advance\pageno by 1
@@ -44,26 +44,26 @@
\def\title{TANGLE changes for C}
@z
-@x [1] Define my_name
+@x [1.1] l.70 - Define my_name
@d banner=='This is TANGLE, Version 4.6'
@y
@d my_name=='tangle'
@d banner=='This is TANGLE, Version 4.6'
@z
-@x [2] Eliminate the |end_of_TANGLE| label.
+@x [1.2] l.79 - Eliminate the |end_of_TANGLE| label.
calls the `|jump_out|' procedure, which goes to the label |end_of_TANGLE|.
@d end_of_TANGLE = 9999 {go here to wrap it up}
@y
calls the `|jump_out|' procedure.
@z
-@x
+@x [1.2] l.85
label end_of_TANGLE; {go here to finish}
@y
@z
-@x [2] Define and call parse_arguments.
+@x [1.2] l.90 - Define and call parse_arguments.
procedure initialize;
var @<Local variables for initialization@>@/
begin @<Set initial values@>@/
@@ -77,12 +77,8 @@ procedure initialize;
@<Set initial values@>@/
@z
-@x [8] Constants: increase id lengths, for TeX--XeT and tex2pdf.
+@x [1.8] l.183 - Constants: increase id lengths, for TeX--XeT and tex2pdf.
@!buf_size=100; {maximum length of input line}
-@y
-@!buf_size=1000; {maximum length of input line}
-@z
-@x
@!max_bytes=45000; {|1/ww| times the number of bytes in identifiers,
strings, and module names; must be less than 65536}
@!max_toks=65000; {|1/zz| times the number of bytes in compressed \PASCAL\ code;
@@ -92,6 +88,7 @@ procedure initialize;
@!max_texts=2000; {number of replacement texts, must be less than 10240}
@!hash_size=353; {should be prime}
@y
+@!buf_size=1000; {maximum length of input line}
@!max_bytes=65535; {|1/ww| times the number of bytes in identifiers,
strings, and module names; must be less than 65536}
@!max_toks=65535; {|1/zz| times the number of bytes in compressed \PASCAL\ code;
@@ -102,7 +99,7 @@ procedure initialize;
@!hash_size=8501; {should be prime}
@z
-@x
+@x [1.8] l.195
@!stack_size=50; {number of simultaneous levels of macro expansion}
@!max_id_length=12; {long identifiers are chopped to this length, which must
not exceed |line_length|}
@@ -119,13 +116,13 @@ procedure initialize;
% default type `char' may produce signed integers, which are bad array
% indices in C.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-@x
+@x [2.12] l.302
@d text_char == char {the data type of characters in text files}
@y
@d text_char == ASCII_code {the data type of characters in text files}
@z
-@x [17] enable maximum character set
+@x [2.17] l.483 - enable maximum character set
for i:=1 to @'37 do xchr[i]:=' ';
for i:=@'200 to @'377 do xchr[i]:=' ';
@y
@@ -133,20 +130,20 @@ for i:=1 to @'37 do xchr[i]:=chr(i);
for i:=@'200 to @'377 do xchr[i]:=chr(i);
@z
-@x [20] terminal output: use standard i/o
+@x [3.20] l.509 - terminal output: use standard i/o
@d print(#)==write(term_out,#) {`|print|' means write on the terminal}
@y
@d term_out==stdout
@d print(#)==write(term_out,#) {`|print|' means write on the terminal}
@z
-@x
+@x [3.20] l.516
@<Globals...@>=
@!term_out:text_file; {the terminal as an output file}
@y
@z
-@x [21] init terminal
+@x [3.21] l.519 - init terminal
@ Different systems have different ways of specifying that the output on a
certain file will appear on the user's terminal. Here is one way to do this
on the \PASCAL\ system that was used in \.{TANGLE}'s initial development:
@@ -163,32 +160,32 @@ certain file will appear on the user's terminal.
{Nothing need be done for C.}
@z
-@x [22] flush terminal buffer
+@x [3.22] l.532 - flush terminal buffer
@d update_terminal == break(term_out) {empty the terminal output buffer}
@y
@d update_terminal == fflush(term_out) {empty the terminal output buffer}
@z
-@x [24] open input files
+@x [3.24] l.548 - open input files
begin reset(web_file); reset(change_file);
@y
begin web_file := kpse_open_file(web_name, kpse_web_format);
if chg_name then change_file := kpse_open_file(chg_name, kpse_web_format);
@z
-@x [26] Open output files (except for the pool file).
+@x [3.26] l.558 - Open output files (except for the pool file).
@ The following code opens |Pascal_file| and |pool|.
@y
@ The following code opens |Pascal_file|. Opening |pool| will be deferred
until section~\&{64}.
@z
-@x
+@x [3.26] l.565
rewrite(Pascal_file); rewrite(pool);
@y
rewrite (Pascal_file, pascal_name);
@z
-@x [28] Fix f^.
+@x [3.28] l.591 - Fix f^.
begin buffer[limit]:=xord[f^]; get(f);
incr(limit);
if buffer[limit-1]<>" " then final_limit:=limit;
@@ -202,13 +199,13 @@ rewrite (Pascal_file, pascal_name);
begin while not eoln(f) do vgetc(f);
@z
-@x [31] Fix typo as in weave.web.
+@x [4.31] l.640 - Fix typo as in weave.web.
procedure error; {prints '\..' and location of error message}
@y
procedure error; {prints `\..' and location of error message}
@z
-@x [34] Fix `jump_out'.
+@x [4.34] l.681 - Fix `jump_out'.
and jumps out of the program. This is the only non-local |goto| statement
in \.{TANGLE}. It is used when no recovery from a particular error has
been provided.
@@ -235,7 +232,7 @@ and jumps out of the program.
end
@z
-@x [38] Provide for a larger `byte_mem' and `tok_mem'. Extra capacity:
+@x [5.38] l.742 - Provide for a larger `byte_mem' and `tok_mem'. Extra capacity:
@d ww=2 {we multiply the byte capacity by approximately this amount}
@d zz=3 {we multiply the token capacity by approximately this amount}
@y
@@ -243,19 +240,19 @@ and jumps out of the program.
@d zz=5 {we multiply the token capacity by approximately this amount}
@z
-@x [38] Provide for larger than 16bit numeric macros.
+@x [5.38] l.753 - Provide for larger than 16bit numeric macros.
@!equiv: array [0..max_names] of sixteen_bits; {info corresponding to names}
@y
@!equiv: array [0..max_names] of integer; {info corresponding to names}
@z
-@x [47] Provide for larger than 16bit numeric macros.
+@x [5.47] l.862 - Provide for larger than 16bit numeric macros.
their |equiv| value contains the corresponding numeric value plus $2^{15}$.
@y
their |equiv| value contains the corresponding numeric value plus $2^{30}$.
@z
-@x [47] Add parametric2 macros (macros that use [] to delimit arguments).
+@x [5.47] l.868 - Add parametric2 macros (macros that use [] to delimit arguments).
\yskip\hang |parametric| identifiers have been defined to be parametric macros;
like simple identifiers, their |equiv| value points to the replacement text.
@y
@@ -263,32 +260,32 @@ like simple identifiers, their |equiv| value points to the replacement text.
be parametric macros; like simple identifiers, their |equiv| value points to
the replacement text.
@z
-@x
+@x [5.47] l.874
@d parametric=3 {parametric macros have |parametric| ilk}
@y
@d parametric=3 {parametric macros have |parametric| ilk}
@d parametric2=4 {second type of parametric macros have this |ilk|}
@z
-@x [50] unambig_length is a variable now
+@x [6.50] l.945 - unambig_length is a variable now
@!chopped_id:array [0..unambig_length] of ASCII_code; {chopped identifier}
@y
@!chopped_id:array [0..max_id_length] of ASCII_code; {chopped identifier}
@z
-@x [53] Add parametric2 macros (macros that use [] to delimit arguments).
+@x [6.53] l.960 - Add parametric2 macros (macros that use [] to delimit arguments).
|numeric|, |simple|, or |parametric|.
@y
|numeric|, |simple|, |parametric|, or |parametric2|.
@z
-@x [53] unambig_length is a variable.
+@x [6.53] l.971 - unambig_length is a variable.
@!s:0..unambig_length; {index into |chopped_id|}
@y
@!s:0..max_id_length; {index into |chopped_id|}
@z
-@x [58] Case smashing options/strict checking.
+@x [6.58] l.1030 - Case smashing options/strict checking.
begin if buffer[i]<>"_" then
begin if buffer[i]>="a" then chopped_id[s]:=buffer[i]-@'40
@y
@@ -300,7 +297,7 @@ the replacement text.
chopped_id[s]:=buffer[i]+@'40
@z
-@x [63] Case smashing options/strict checking.
+@x [6.63] l.1102 - Case smashing options/strict checking.
if c<>"_" then
begin if c>="a" then c:=c-@'40; {merge lowercase with uppercase}
@y
@@ -311,7 +308,7 @@ the replacement text.
c:=c+@'40;
@z
-@x [64] Delayed pool file opening / larger numerics.
+@x [6.64] l.1123 - Delayed pool file opening / larger numerics.
@<Define and output a new string...@>=
begin ilk[p]:=numeric; {strings are like numeric macros}
if l-double_chars=2 then {this string is for a single character}
@@ -330,37 +327,37 @@ else begin
l:=l-double_chars-1;
@z
-@x [85] Add parametric2 macros (macros that use [] to delimit arguments).
+@x [9.85] l.1502 - Add parametric2 macros (macros that use [] to delimit arguments).
begin if ilk[cur_name]=parametric then
@y
begin if (ilk[cur_name]=parametric) or (ilk[cur_name]=parametric2) then
@z
-@x [89] Larger numerics.
+@x [9.89] l.1586 - Larger numerics.
numeric: begin cur_val:=equiv[a]-@'100000; a:=number;
@y
numeric: begin cur_val:=equiv[a]-@'10000000000; a:=number;
@z
-@x [89] Add parametric2 macros (macros that use [] to delimit arguments).
+@x [9.89] l.1590 - Add parametric2 macros (macros that use [] to delimit arguments).
parametric: begin @<Put a parameter on the parameter stack,
@y
parametric,parametric2: begin @<Put a parameter on the parameter stack,
@z
-@x [90] Add parametric2 macros (macros that use [] to delimit arguments).
+@x [9.90] l.1607 - Add parametric2 macros (macros that use [] to delimit arguments).
if (stack_ptr=0)or(tok_mem[zo,cur_byte]<>"(") then
@y
if (stack_ptr=0)or((ilk[a]=parametric)and(tok_mem[zo,cur_byte]<>"("))
or((ilk[a]=parametric2)and(tok_mem[zo,cur_byte]<>"[")) then
@z
-@x [93] Add parametric2 macros (macros that use [] to delimit arguments).
+@x [9.93] l.1654 - Add parametric2 macros (macros that use [] to delimit arguments).
bal:=1; incr(cur_byte); {skip the opening `\.('}
@y
bal:=1; incr(cur_byte); {skip the opening `\.(' or `['}
@z
-@x
+@x [9.93] l.1662
"(": incr(bal);
")": begin decr(bal);
@y
@@ -372,7 +369,7 @@ bal:=1; incr(cur_byte); {skip the opening `\.(' or `['}
"]": if ilk[a]=parametric2 then begin decr(bal);
@z
-@x [105] Accept DIV, div, MOD, and mod
+@x [10.105] l.1937 - Accept DIV, div, MOD, and mod
(((out_contrib[1]="D")and(out_contrib[2]="I")and(out_contrib[3]="V")) or@|
((out_contrib[1]="M")and(out_contrib[2]="O")and(out_contrib[3]="D")) ))or@|
@^uppercase@>
@@ -383,7 +380,7 @@ bal:=1; incr(cur_byte); {skip the opening `\.(' or `['}
((out_contrib[1]="m")and(out_contrib[2]="o")and(out_contrib[3]="d")) ))or@|
@z
-@x [110] lowercase ids
+@x [10.110] l.2005 - lowercase ids
@^uppercase@>
if ((out_buf[out_ptr-3]="D")and(out_buf[out_ptr-2]="I")and
(out_buf[out_ptr-1]="V"))or @/
@@ -400,7 +397,7 @@ bal:=1; incr(cur_byte); {skip the opening `\.(' or `['}
(out_buf[out_ptr-1]="d")) then@/ goto bad_case
@z
-@x [114] lowercase operators (`and', `or', etc.)
+@x [11.114] l.2077 - lowercase operators (`and', `or', etc.)
and_sign: begin out_contrib[1]:="A"; out_contrib[2]:="N"; out_contrib[3]:="D";
@^uppercase@>
send_out(ident,3);
@@ -425,7 +422,7 @@ set_element_sign: begin out_contrib[1]:="i"; out_contrib[2]:="n";
or_sign: begin out_contrib[1]:="o"; out_contrib[2]:="r"; send_out(ident,2);
@z
-@x [116] Case smashing options.
+@x [11.116] l.2120 - Case smashing options.
@ Single-character identifiers represent themselves, while longer ones
appear in |byte_mem|. All must be converted to uppercase,
with underlines removed. Extremely long identifiers must be chopped.
@@ -484,36 +481,36 @@ identifier: begin k:=0; j:=byte_start[cur_val]; w:=cur_val mod ww;
end;
@z
-@x [119] Stretch limits of constants to match what we set for expressions.
+@x [11.119] l.2199 - Stretch limits of constants to match what we set for expressions.
if n>=@'2000000000 then err_print('! Constant too big')
@y
if n>=@'10000000000 then err_print('! Constant too big')
@z
-@x
+@x [11.119] l.2208
if n>=@"8000000 then err_print('! Constant too big')
@y
if n>=@"40000000 then err_print('! Constant too big')
@z
-@x [157] Larger numerics.
+@x [14.157] l.2862 - Larger numerics.
if abs(accumulator)>=@'100000 then
@y
if abs(accumulator)>=@'10000000000 then
@z
-@x [157] Larger numerics.
+@x [14.157] l.2866 - Larger numerics.
equiv[p]:=accumulator+@'100000; {name |p| now is defined to equal |accumulator|}
@y
equiv[p]:=accumulator+@'10000000000; {name |p| now is defined to equal |accumulator|}
@z
-@x [158] Larger numerics.
+@x [14.158] l.2889 - Larger numerics.
add_in(equiv[q]-@'100000);
@y
add_in(equiv[q]-@'10000000000);
@z
-@x [165] Add parametric2 macros (macros that use [] to delimit arguments).
+@x [15.165] l.2964 - Add parametric2 macros (macros that use [] to delimit arguments).
"(": incr(bal);
")": if bal=0 then err_print('! Extra )')
@.Extra )@>
@@ -533,7 +530,7 @@ equiv[p]:=accumulator+@'10000000000; {name |p| now is defined to equal |accumula
"#": if (t=parametric)or(t=parametric2) then a:=param;
@z
-@x [166] Add parametric2 macros (macros that use [] to delimit arguments).
+@x [15.166] l.2988 - Add parametric2 macros (macros that use [] to delimit arguments).
begin if bal=1 then err_print('! Missing )')
else err_print('! Missing ',bal:1,' )''s');
@.Missing n )@>
@@ -560,7 +557,7 @@ equiv[p]:=accumulator+@'10000000000; {name |p| now is defined to equal |accumula
end
@z
-@x [173] Add parametric2 macros (macros that use [] to delimit arguments).
+@x [16.173] l.3107 - Add parametric2 macros (macros that use [] to delimit arguments).
else @<If the next text is `\.{(\#)==}', call |define_macro|
and |goto continue|@>;
@y
@@ -568,7 +565,7 @@ equiv[p]:=accumulator+@'10000000000; {name |p| now is defined to equal |accumula
and |goto continue|@>;
@z
-@x [174] Add parametric2 macros (macros that use [] to delimit arguments).
+@x [16.174] l.3114 - Add parametric2 macros (macros that use [] to delimit arguments).
@ @<If the next text is `\.{(\#)==}'...@>=
if next_control="(" then
begin next_control:=get_next;
@@ -625,7 +622,7 @@ else if next_control="[" then
end
@z
-@x [179] make term_in = input
+@x [17.179] l.3190 - make term_in = input
any error stop will set |debug_cycle| to zero.
@y
any error stop will set |debug_cycle| to zero.
@@ -633,29 +630,29 @@ any error stop will set |debug_cycle| to zero.
@d term_in==stdin
@z
-@x
+@x [17.179] l.3198
@!term_in:text_file; {the user's terminal as an input file}
@y
@z
-@x [180] remove term_in reset
+@x [17.180] l.3206 - remove term_in reset
reset(term_in,'TTY:','/I'); {open |term_in| as the terminal, don't do a |get|}
@y
@z
-@x [182] write newline just before exit; use value of |history|
+@x [18.182] l.3248 - write newline just before exit; use value of |history|
print_ln(banner); {print a ``banner line''}
@y
print (banner); {print a ``banner line''}
print_ln (version_string);
@z
-@x Eliminate the |end_of_TANGLE| label.
+@x [18.182] l.3252 - Eliminate the |end_of_TANGLE| label.
end_of_TANGLE:
@y
@z
-@x
+@x [18.182] l.3256
@<Print the job |history|@>;
@y
@<Print the job |history|@>;
@@ -665,7 +662,7 @@ then uexit (1)
else uexit (0);
@z
-@x [188] System-dependent changes.
+@x [19.188] l.3308 - System-dependent changes.
This module should be replaced, if necessary, by changes to the program
that are necessary to make \.{TANGLE} work at a particular installation.
It is usually best to design your change file so that all changes to
diff --git a/Build/source/texk/web2c/tests/fix-changefile-lines.py b/Build/source/texk/web2c/tests/fix-changefile-lines.py
new file mode 100755
index 00000000000..647cbbf54cf
--- /dev/null
+++ b/Build/source/texk/web2c/tests/fix-changefile-lines.py
@@ -0,0 +1,218 @@
+#!/usr/bin/env python3
+# $Id$
+# Applied to tex.ch and mf.ch on 2024-06-03, following the request at:
+# https://tug.org/pipermail/tex-k/2024-June/004064.html
+"""
+Reads a WEB file and a change file and writes a change file to stdout with
+potentially corrected part, section and line numbers.
+Written by Tyge Tiessen, 2024. Public domain.
+"""
+import re
+import sys
+
+USAGE = f"{sys.argv[0]} <web file> <change file>"
+
+
+def main():
+ if len(sys.argv) != 3:
+ print(USAGE)
+ sys.exit(1)
+
+ # Read WEB file
+ web_reader = WebReader(sys.argv[1])
+
+ # Read change file
+ ch_reader = ChangeReader(sys.argv[2])
+
+ # Run through the two files in parallel
+ ch_reader.traverse(web_reader)
+
+ for line in ch_reader.get_lines():
+ print(line)
+
+
+class WebReader:
+ """An iterator that produces the lines of a WEB file while keeping track
+ of the current part and section number.
+ """
+
+ def __init__(self, web_file):
+ self._pos = 0
+ self.part_cnt = 0
+ self.section_cnt = 0
+ try:
+ self._web_file = open(web_file, "r")
+ except OSError:
+ eprint(f"Could not open {web_file}")
+ print(USAGE)
+ sys.exit(1)
+ with self._web_file:
+ self._web_lines = [line.rstrip() for line in self._web_file]
+
+ def next_line(self):
+ """Returns the triple of current part, section and line numbers, as
+ well as the next line. Updates part and section numbers.
+ """
+ if self._pos >= len(self._web_lines):
+ return None
+ line = self._web_lines[self._pos]
+ self._pos += 1
+
+ part = self.part_cnt
+ section = self.section_cnt
+ line_number = self._pos
+
+ # Look for starred section == part
+ if line.startswith("@*"):
+ self.part_cnt += 1
+ self.section_cnt += 1
+
+ # Look for unstarred section
+ if line.startswith("@ ") or line == "@":
+ self.section_cnt += 1
+
+ # Look for '@i'nclude line
+ result = re.match("^@i \"?(\\w+(\\.\\w+)?)\"?", line)
+ if result:
+ inc_reader = WebReader(result[1])
+ while inc_reader.next_line():
+ pass
+ self.part_cnt += inc_reader.part_cnt
+ self.section_cnt += inc_reader.section_cnt
+ # Ignore line count in include file; we're only one step beyond
+
+ return (part, section, line_number), line
+
+
+class ChangeReader:
+ """Reads the lines of a change file while updating the tags with
+ information from the corresponding WEB file.
+ """
+
+ def __init__(self, change_file):
+ self._pos = 0
+ self._chunk_start = None
+ self._match_lines = None
+ try:
+ self._change_file = open(change_file, "r")
+ except OSError:
+ eprint(f"Could not open {change_file}")
+ print(USAGE)
+ sys.exit(1)
+ with self._change_file:
+ self._lines = [line.rstrip() for line in self._change_file]
+
+ def advance_to_next_chunk(self):
+ """Find the next change chunk. Store where it starts and
+ the lines to be matched.
+ """
+
+ while self._pos < len(self._lines):
+ line = self._lines[self._pos]
+ if line.startswith("@x"):
+ self._chunk_start = self._pos
+ while True:
+ self._pos += 1
+ if self._pos >= len(self._lines):
+ eprint(
+ f"ERROR: Missing @y for @x on l.{self._chunk_start + 1} in change file"
+ )
+ sys.exit(1)
+ line = self._lines[self._pos]
+ if line.startswith("@y"):
+ self._match_lines = self._lines[
+ self._chunk_start + 1 : self._pos
+ ]
+ return True
+ self._pos += 1
+ return False
+
+ def find_match_in_web(self, web_reader):
+ """Find the match for the current change chunk in the WEB file.
+ Returns the part number and section number just before the first match line,
+ as well as the line number of the first match line in the WEB file.
+ """
+ while True:
+ (part, section, line_number), tex_line = web_reader.next_line()
+ if tex_line is None:
+ eprint("ERROR: Could not find match for line:")
+ eprint(f" {self._match_lines[0]}")
+ sys.exit(1)
+ if tex_line == self._match_lines[0]:
+ for i in range(1, len(self._match_lines)):
+ _, tex_line = web_reader.next_line()
+ if tex_line is None or tex_line != self._match_lines[i]:
+ eprint("ERROR: Could not match all lines following match line:")
+ eprint(f" {self._match_lines[0]}")
+ sys.exit(1)
+
+ return part, section, line_number
+
+ def traverse(self, web_reader):
+ """Go through all individual change chunks while updating their tags."""
+ while self.advance_to_next_chunk():
+ part, section, line_number = self.find_match_in_web(web_reader)
+
+ # Attempt to catch the case where something is inserted just before
+ # the start of a section.
+ match_start = self._match_lines[0].strip()[:2]
+ for repl_index in range(self._pos + 1, len(self._lines)):
+ repl_start = self._lines[repl_index].strip()[:2]
+ # CWEB @qcomments@> are ignored; see ctwill-w2c.ch
+ if repl_start != "@q":
+ break
+ if match_start == "@ ":
+ if repl_start in ["@ ", "@*"]:
+ section += 1
+ elif match_start == "@*":
+ if repl_start == "@*":
+ part += 1
+ section += 1
+ elif repl_start == "@ ":
+ section += 1
+
+ # Remove leading @x.
+ text = self._lines[self._chunk_start][2:].strip()
+
+ # Remove potentially leading [part.section] tag.
+ pattern = "\\[\\d+(\\.\\d+)?\\]"
+ if re.match(pattern, text):
+ text = re.sub(pattern, "", text).strip()
+
+ # Remove potentially line number information.
+ pattern = "l\\.\\d+"
+ if re.match(pattern, text):
+ text = re.sub(pattern, "", text)
+
+ # Remove potentially text comment separator.
+ pattern = " -+ "
+ if re.match(pattern, text):
+ text = re.sub(pattern, "", text, 1).strip()
+
+ # Create line with standard tag.
+ new_line = f"@x [{part}.{section}] l.{line_number}"
+
+ if text:
+ new_line += f" - {text}"
+
+ ch_line = self._lines[self._chunk_start]
+ if new_line[:10] != ch_line[:10]:
+ print("Old:")
+ print(f" {ch_line}")
+ print("New:")
+ print(f" {new_line}")
+ print()
+
+ self._lines[self._chunk_start] = new_line
+
+ def get_lines(self):
+ return self._lines
+
+
+def eprint(*args, **kwargs):
+ """Print to stderr."""
+ print(*args, file=sys.stderr, **kwargs)
+
+
+if __name__ == "__main__":
+ main()
diff --git a/Build/source/texk/web2c/tex.ch b/Build/source/texk/web2c/tex.ch
index 3243105730a..e57d494170a 100644
--- a/Build/source/texk/web2c/tex.ch
+++ b/Build/source/texk/web2c/tex.ch
@@ -51,16 +51,16 @@
% of March, 1995 (published as Donald E. Knuth, TeX: The Program,
% Volume B of Computers & Typesetting).
-@x [0.0] l.83 - WEAVE: print changes only.
+@x [0.0] l.88 - WEAVE: print changes only.
\def\?##1]{\hbox to 1in{\hfil##1.\ }}
}
-@y 83
+@y
\def\?##1]{\hbox{Changes to ##1.\ }}
}
\let\maybe=\iffalse
@z
-@x [1.2] l.185 - MLTeX: add comment about banner line change
+@x [1.2] l.191 - MLTeX: add comment about banner line change
November 1984].
@y
November 1984].
@@ -72,7 +72,7 @@ a modified \TeX{} version.
@z
-@x [1.2] l.188
+@x [1.2] l.193
@d banner=='This is TeX, Version 3.141592653' {printed when \TeX\ starts}
@y
@d TeX_banner_k=='This is TeXk, Version 3.141592653' {printed when \TeX\ starts}
@@ -82,7 +82,7 @@ a modified \TeX{} version.
@d banner_k==TeX_banner_k
@z
-@x [1.4] l.233 - program header
+@x [1.4] l.244 - program header
Actually the heading shown here is not quite normal: The |program| line
does not mention any |output| file, because \ph\ would ask the \TeX\ user
to specify a file name if |output| were specified here.
@@ -91,14 +91,14 @@ to specify a file name if |output| were specified here.
@y
@z
-@x [1.4] l.243 - labels in outer block not needed
+@x [1.4] l.255 - labels in outer block not needed
program TEX; {all file names are defined dynamically}
label @<Labels in the outer block@>@/
@y
program TEX; {all file names are defined dynamically}
@z
-@x [1.6] l.267 - labels in outer block not needed
+@x [1.6] l.279 - labels in outer block not needed
@ Three labels must be declared in the main program, so we give them
symbolic names.
@@ -119,14 +119,14 @@ we still have to declare the symbolic names.
% Here we change these WEB symbols, which are used much as #ifdef's
% are in C, into something which will get translated into actual #ifdef's.
-@x [1.7] l.292 - debug..gubed, stat..tats
+@x [1.7] l.304 - debug..gubed, stat..tats
@d debug==@{ {change this to `$\\{debug}\equiv\null$' when debugging}
@d gubed==@t@>@} {change this to `$\\{gubed}\equiv\null$' when debugging}
@y
@d debug==ifdef('TEXMF_DEBUG')
@d gubed==endif('TEXMF_DEBUG')
@z
-@x [1.7] l.297 - debug..gubed, stat..tats
+@x [1.7] l.309 - debug..gubed, stat..tats
@d stat==@{ {change this to `$\\{stat}\equiv\null$' when gathering
usage statistics}
@d tats==@t@>@} {change this to `$\\{tats}\equiv\null$' when gathering
@@ -136,12 +136,12 @@ we still have to declare the symbolic names.
@d tats==endif('STAT')
@z
-@x [1.8] Somewhat different for `init...tini'.. 310 m.8
+@x [1.8] l.322 - Somewhat different for `init...tini'.. 310 m.8
the codewords `$|init|\ldots|tini|$'.
@d init== {change this to `$\\{init}\equiv\.{@@\{}$' in the production version}
@d tini== {change this to `$\\{tini}\equiv\.{@@\}}$' in the production version}
-@y 314
+@y
the codewords `$|init|\ldots|tini|$' for declarations and by the codewords
`$|Init|\ldots|Tini|$' for executable code. This distinction is helpful for
implementations where a run-time switch differentiates between the two
@@ -155,13 +155,13 @@ versions of the program.
@f Tini==end
@z
-@x [1.8] l.319 - init...tini is dynamic
+@x [1.8] l.331 - init...tini is dynamic
@!init @<Initialize table entries (done by \.{INITEX} only)@>@;@+tini
-@y 318
+@y
@!Init @<Initialize table entries (done by \.{INITEX} only)@>@;@+Tini
@z
-@x [1.11] l.375 - Compile-time constants: most removed for dynamic allocation.
+@x [1.11] l.389 - Compile-time constants: most removed for dynamic allocation.
@<Constants...@>=
@!mem_max=30000; {greatest index in \TeX's internal |mem| array;
must be strictly less than |max_halfword|;
@@ -291,7 +291,7 @@ versions of the program.
@!sup_expand_depth = 10000000;
@z
-@x [1.12] l.427 - Constants that are WEB numeric macros.
+@x [1.12] l.441 - Constants that are WEB numeric macros.
@d mem_bot=0 {smallest index in the |mem| array dumped by \.{INITEX};
must not be less than |mem_min|}
@d mem_top==30000 {largest index in the |mem| array dumped by \.{INITEX};
@@ -311,7 +311,7 @@ versions of the program.
if you change this, you should also change |iinf_hyphen_size|.}
@z
-@x [1.16] l.498 - Use C macros for `incr' and `decr'.
+@x [1.16] l.512 - Use C macros for `incr' and `decr'.
@d incr(#) == #:=#+1 {increase a variable by unity}
@d decr(#) == #:=#-1 {decrease a variable by unity}
@y
@@ -320,13 +320,13 @@ versions of the program.
% The text_char type is used as an array index into xord. The
% default type `char' produces signed integers, which are bad array
% indices in C.
-@x [2.19] l.565 - data type text_char is 8-bit ASCII_code
+@x [2.19] l.579 - data type text_char is 8-bit ASCII_code
@d text_char == char {the data type of characters in text files}
@y
@d text_char == ASCII_code {the data type of characters in text files}
@z
-@x [2.20] l.579 - printable characters
+@x [2.20] l.593 - printable characters
@!xchr: array [ASCII_code] of text_char;
{specifies conversion of output characters}
@y
@@ -336,7 +336,7 @@ xprn: array [ASCII_code] of ASCII_code;
{ non zero iff character is printable }
@z
-@x [2.23] l.723 - Translate characters if desired, otherwise allow them all.
+@x [2.23] l.737 - Translate characters if desired, otherwise allow them all.
for i:=0 to @'37 do xchr[i]:=' ';
for i:=@'177 to @'377 do xchr[i]:=' ';
@y
@@ -345,7 +345,7 @@ for i:=0 to @'37 do xchr[i]:=i;
for i:=@'177 to @'377 do xchr[i]:=i;
@z
-@x [2.24] l.733 - Don't reinitialize xord.
+@x [2.24] l.749 - Don't reinitialize xord.
for i:=0 to @'176 do xord[xchr[i]]:=i;
@y
for i:=0 to @'176 do xord[xchr[i]]:=i;
@@ -371,14 +371,14 @@ if translate_filename then read_tcx_file;
% When echoed to the screen and in the log, character codes
% above '177 in file names are shown wrongly (typically as ^@).
%
-@x [3.26] l.789 - name_of_file is no longer an array
+@x [3.26] l.803 - name_of_file is no longer an array
@!name_of_file:packed array[1..file_name_size] of char;@;@/
{on some systems this may be a \&{record} variable}
@y
@!name_of_file:^text_char;
@z
-@x [3.27] l.794 - Do file opening in C.
+@x [3.27] l.808 - Do file opening in C.
@ The \ph\ compiler with which the present version of \TeX\ was prepared has
extended the rules of \PASCAL\ in a very convenient way. To open file~|f|,
we can write
@@ -438,7 +438,7 @@ end;
@ All of the file opening functions are defined in C.
@z
-@x [3.28] l.850 - Do file closing in C.
+@x [3.28] l.864 - Do file closing in C.
@ Files can be closed with the \ph\ routine `|close(f)|', which
@:PASCAL H}{\ph@>
@^system dependencies@>
@@ -465,13 +465,13 @@ end;
@ And all the file closing routines as well.
@z
-@x [3.30] l.888 - Array size of input buffer is determined at runtime.
+@x [3.30] l.903 - Array size of input buffer is determined at runtime.
@!buffer:array[0..buf_size] of ASCII_code; {lines of characters being read}
@y
@!buffer:^ASCII_code; {lines of characters being read}
@z
-@x [3.31] l.933 - Do `input_ln' in C.
+@x [3.31] l.948 - Do `input_ln' in C.
@p function input_ln(var f:alpha_file;@!bypass_eoln:boolean):boolean;
{inputs the next line or returns |false|}
var last_nonblank:0..buf_size; {|last| with trailing blanks removed}
@@ -502,7 +502,7 @@ We define |input_ln| in C, for efficiency. Nevertheless we quote the module
% [3.32] `term_in' and `term_out' are standard input and output.
% Declare the variables that used to be constants.
-@x [3.32] l.961 - `term_in' and `term_out' are standard input and output.
+@x [3.32] l.975 - `term_in' and `term_out' are standard input and output.
@<Glob...@>=
@!term_in:alpha_file; {the terminal as an input file}
@!term_out:alpha_file; {the terminal as an output file}
@@ -589,7 +589,7 @@ tini@/
@!insert_src_special_every_display : boolean;
@z
-@x [3.33] l.964 - We don't need to open terminal files.
+@x [3.33] l.979 - We don't need to open terminal files.
@ Here is how to open the terminal files
in \ph. The `\.{/I}' switch suppresses the first |get|.
@:PASCAL H}{\ph@>
@@ -605,7 +605,7 @@ any command line arguments the user has provided. It's defined in C.
@d t_open_out == {output already open for text output}
@z
-@x [3.34] l.982 - Flushing output to terminal files.
+@x [3.34] l.998 - Flushing output to terminal files.
these operations can be specified in \ph:
@:PASCAL H}{\ph@>
@^system dependencies@>
@@ -622,7 +622,7 @@ to do nothing, since the user should control the terminal.
@d clear_terminal == do_nothing
@z
-@x [3.35] l.1017 - needed for e-TeX, but differently
+@x [3.35] l.1034 - needed for e-TeX, but differently
@<Report overflow of the input buffer, and abort@>=
if format_ident=0 then
begin write_ln(term_out,'Buffer size exceeded!'); goto final_end;
@@ -636,7 +636,7 @@ Routine is implemented in C; part of module is, however, needed for e-TeX.
begin cur_input.loc_field:=first; cur_input.limit_field:=last-1;
@z
-@x [3.37] l.1055 - |init_terminal|, reading the command line.
+@x [3.37] l.1072 - |init_terminal|, reading the command line.
@ The following program does the required initialization
without retrieving a possible command line.
It should be clear how to modify this routine to deal with command lines,
@@ -664,13 +664,13 @@ if last > first then
end;
@z
-@x [3.37] l.1068 - |init_terminal|, output missing newline.
+@x [3.37] l.1085 - |init_terminal|, output missing newline.
write(term_out,'! End of file on the terminal... why?');
@y
write_ln(term_out,'! End of file on the terminal... why?');
@z
-@x [4.38] l.1126 - Array size for string pool is determined at runtime.
+@x [4.38] l.1144 - Array size for string pool is determined at runtime.
@!pool_pointer = 0..pool_size; {for variables that point into |str_pool|}
@!str_number = 0..max_strings; {for variables that point into |str_start|}
@y
@@ -678,7 +678,7 @@ if last > first then
@!str_number = 0..ssup_max_strings; {for variables that point into |str_start|}
@z
-@x [4.39] l.1131 - Dynamically size pool arrays.
+@x [4.39] l.1149 - Dynamically size pool arrays.
@!str_pool:packed array[pool_pointer] of packed_ASCII_code; {the characters}
@!str_start : array[str_number] of pool_pointer; {the starting pointers}
@y
@@ -686,7 +686,7 @@ if last > first then
@!str_start : ^pool_pointer; {the starting pointers}
@z
-@x [4.47] l.1237 - string recycling
+@x [4.47] l.1255 - string recycling
@p @!init function get_strings_started:boolean; {initializes the string pool,
@y
@p @t\4@>@<Declare additional routines for string recycling@>@/
@@ -694,7 +694,7 @@ if last > first then
@!init function get_strings_started:boolean; {initializes the string pool,
@z
-@x [4.49] l.1272 -- Change documentation (probably needed in more places)
+@x [4.49] l.1290 - Change documentation (probably needed in more places)
would like string @'32 to be the single character @'32 instead of the
@y
would like string @'32 to be printed as the single character @'32
@@ -705,7 +705,7 @@ instead of the
% assignments directly. (`strcpy' and `strlen' work here because
% `pool_name' is a constant string, and thus ends in a null and doesn't
% start with a space.)
-@x [4.51] l.1314 - Open the pool file.
+@x [4.51] l.1332 - Open the pool file.
name_of_file:=pool_name; {we needn't set |name_length|}
if a_open_in(pool_file) then
@y
@@ -715,12 +715,12 @@ strcpy (stringcast(name_of_file+1), pool_name); {copy the string}
if a_open_in (pool_file, kpse_texpool_format) then
@z
-@x [4.51] l.1322 - Make `TEX.POOL' lowercase, and change how it's read.
+@x [4.51] l.1340 - Make `TEX.POOL' lowercase, and change how it's read.
else bad_pool('! I can''t read TEX.POOL.')
@y
else bad_pool('! I can''t read ', pool_name, '; bad path?')
@z
-@x [4.52] l.1326 - Make `TEX.POOL' lowercase, and change how it's read.
+@x [4.52] l.1344 - Make `TEX.POOL' lowercase, and change how it's read.
begin if eof(pool_file) then bad_pool('! TEX.POOL has no check sum.');
@.TEX.POOL has no check sum@>
read(pool_file,m,n); {read two digits of string length}
@@ -729,30 +729,30 @@ begin if eof(pool_file) then bad_pool('! ', pool_name, ' has no check sum.');
@.TEX.POOL has no check sum@>
read(pool_file,m); read(pool_file,n); {read two digits of string length}
@z
-@x [4.52] l.1332 - Make `TEX.POOL' lowercase, and change how it's read.
+@x [4.52] l.1350 - Make `TEX.POOL' lowercase, and change how it's read.
bad_pool('! TEX.POOL line doesn''t begin with two digits.');
@y
bad_pool('! ', pool_name, ' line doesn''t begin with two digits.');
@z
-@x [4.53] l.1354 - Make `TEX.POOL' lowercase, and change how it's read.
+@x [4.53] l.1372 - Make `TEX.POOL' lowercase, and change how it's read.
bad_pool('! TEX.POOL check sum doesn''t have nine digits.');
@y
bad_pool('! ', pool_name, ' check sum doesn''t have nine digits.');
@z
-@x [4.53] l.1360 - Make `TEX.POOL' lowercase, and change how it's read.
+@x [4.53] l.1378 - Make `TEX.POOL' lowercase, and change how it's read.
done: if a<>@$ then bad_pool('! TEX.POOL doesn''t match; TANGLE me again.');
@y
done: if a<>@$ then
bad_pool('! ', pool_name, ' doesn''t match; tangle me again (or fix the path).');
@z
-@x [5.54] l.1422 - error_line
+@x [5.54] l.1440 - error_line
@!trick_buf:array[0..error_line] of ASCII_code; {circular buffer for
@y
@!trick_buf:array[0..ssup_error_line] of ASCII_code; {circular buffer for
@z
-@x l.1536 -- If the ``src-specials'' feature is active, change the banner.
+@x [5.61] l.1574 - If the ``src-specials'' feature is active, change the banner.
wterm(banner);
@y
if src_specials_p or file_line_error_style_p or parse_first_line_p then
@@ -761,7 +761,7 @@ else
wterm(banner);
@z
-@x [5.61] l.1556 - Print rest of banner.
+@x [5.61] l.1575 - Print rest of banner.
if format_ident=0 then wterm_ln(' (no format preloaded)')
else begin slow_print(format_ident); print_ln;
end;
@@ -787,21 +787,21 @@ if translate_filename then begin
end;
@z
-@x [5.71] term_input: set limit when fatal_error
+@x [5.71] l.1713 - term_input: set limit when fatal_error
if not input_ln(term_in,true) then fatal_error("End of file on the terminal!");
@y
if not input_ln(term_in,true) then begin
limit:=0; fatal_error("End of file on the terminal!"); end;
@z
-@x [6.73] l.1732 - Add unspecified_mode.
+@x [6.73] l.1750 - Add unspecified_mode.
@d error_stop_mode=3 {stops at every opportunity to interact}
@y
@d error_stop_mode=3 {stops at every opportunity to interact}
@d unspecified_mode=4 {extra value for command-line switch}
@z
-@x [6.73] l.1734 - file:line:error style error messages.
+@x [6.73] l.1752 - file:line:error style error messages.
print_nl("! "); print(#);
@y
if file_line_error_style_p then print_file_line
@@ -810,14 +810,14 @@ if not input_ln(term_in,true) then begin
@z
-@x [6.73] l.1738 - Add interaction_option.
+@x [6.73] l.1756 - Add interaction_option.
@!interaction:batch_mode..error_stop_mode; {current level of interaction}
@y
@!interaction:batch_mode..error_stop_mode; {current level of interaction}
@!interaction_option:batch_mode..unspecified_mode; {set from command line}
@z
-@x [6.74] l.1740 - Allow override by command line switch.
+@x [6.74] l.1758 - Allow override by command line switch.
@ @<Set init...@>=interaction:=error_stop_mode;
@y
@ @<Set init...@>=if interaction_option=unspecified_mode then
@@ -830,7 +830,7 @@ else
% Plus, it's nicer just to do an exit with the appropriate status code
% under Unix. We call it `uexit' because there's a WEB symbol called
% `exit' already. We use a C macro to change `uexit' back to `exit'.
-@x [6.81] l.1852 - Eliminate nonlocal goto, since C doesn't have them.
+@x [6.81] l.1860 - Eliminate nonlocal goto, since C doesn't have them.
@ The |jump_out| procedure just cuts across all active procedure levels and
goes to |end_of_TEX|. This is the only nontrivial |@!goto| statement in the
whole program. It is used when there is no recovery from a particular error.
@@ -871,7 +871,7 @@ do_final_end;
end;
@z
-@x [6.82] l.1866 - halt on error?
+@x [6.82] l.1884 - halt on error?
print_char("."); show_context;
@y
print_char("."); show_context;
@@ -885,7 +885,7 @@ if (halt_on_error_p) then begin
end;
@z
-@x [6.84] l.1904 - Implement the switch-to-editor option.
+@x [6.84] l.1908 - Implement the switch-to-editor option.
line ready to be edited. But such an extension requires some system
wizardry, so the present implementation simply types out the name of the
file that should be
@@ -910,7 +910,7 @@ been commented~out.
@d edit_file==input_stack[base_ptr]
@z
-@x [6.84] l.1903 - Implement the switch-to-editor option.
+@x [6.84] l.1923 - Implement the switch-to-editor option.
"E": if base_ptr>0 then if input_stack[base_ptr].name_field>=256 then
begin print_nl("You want to edit file ");
@.You want to edit file x@>
@@ -926,19 +926,19 @@ been commented~out.
jump_out;
@z
-@x [6.93] l.2056 - Declare fatal_error as noreturn.
+@x [6.93] l.2062 - Declare fatal_error as noreturn.
procedure fatal_error(@!s:str_number); {prints |s|, and that's it}
@y
noreturn procedure fatal_error(@!s:str_number); {prints |s|, and that's it}
@z
-@x [6.94] l.2065 - Declare overflow as noreturn.
+@x [6.94] l.2071 - Declare overflow as noreturn.
procedure overflow(@!s:str_number;@!n:integer); {stop due to finiteness}
@y
noreturn procedure overflow(@!s:str_number;@!n:integer); {stop due to finiteness}
@z
-@x [6.95] l.2084 - Declare confusion as noreturn.
+@x [6.95] l.2090 - Declare confusion as noreturn.
procedure confusion(@!s:str_number);
@y
noreturn procedure confusion(@!s:str_number);
@@ -946,7 +946,7 @@ noreturn procedure confusion(@!s:str_number);
% [7.104] `remainder' is a library routine on some systems, so change
% its name to avoid conflicts.
-@x [7.104] l.2227 - avoid name conflicts with lib routine remainder()
+@x [7.104] l.2248 - avoid name conflicts with lib routine remainder()
|remainder|, holds the remainder after a division.
@<Glob...@>=
@@ -958,22 +958,22 @@ noreturn procedure confusion(@!s:str_number);
@<Glob...@>=
@z
-@x [7.109] l.2352 - Define glue_ratio in C.
+@x [7.109] l.2373 - Define glue_ratio in C.
@!glue_ratio=real; {one-word representation of a glue expansion factor}
@y
@z
% [8.110] Make it easy to change constants. Do not increase
% max_quarterword without changing the memoryword structure in `texmfmem.h'.
-@x [8.110] l.2422 - increase |max_halfword|
+@x [8.110] l.2428 - increase |max_halfword|
@d min_halfword==0 {smallest allowable value in a |halfword|}
@d max_halfword==65535 {largest allowable value in a |halfword|}
-@y 2424
+@y
@d min_halfword==-@"FFFFFFF {smallest allowable value in a |halfword|}
@d max_halfword==@"FFFFFFF {largest allowable value in a |halfword|}
@z
-@x [8.111] l.2435 - min_halfword and max_halfword
+@x [8.111] l.2441 - min_halfword and max_halfword
if (mem_min<min_halfword)or(mem_max>=max_halfword)or@|
(mem_bot-mem_min>max_halfword+1) then bad:=14;
@y
@@ -981,7 +981,7 @@ if (mem_bot-sup_main_memory<min_halfword)or@|
(mem_top+sup_main_memory>=max_halfword) then bad:=14;
@z
-@x [8.111] l.2437 - max_font_max
+@x [8.111] l.2443 - max_font_max
if (font_base<min_quarterword)or(font_max>max_quarterword) then bad:=15;
if font_max>font_base+256 then bad:=16;
@y
@@ -989,7 +989,7 @@ if (max_font_max<min_halfword)or(max_font_max>max_halfword) then bad:=15;
if font_max>font_base+max_font_max then bad:=16;
@z
-@x [8.112] l.2450 - Efficiency.
+@x [8.112] l.2456 - Efficiency.
macros are simplified in the obvious way when |min_quarterword=0|.
@^inner loop@>@^system dependencies@>
@@ -1019,7 +1019,7 @@ sufficiently large.
% [8.113] We've put the memory structure into the include file
% `texmf.h', since it's too hard to translate automatically.
-@x [8.113] l.2453 - data structures for main memory
+@x [8.113] l.2474 - data structures for main memory
@!quarterword = min_quarterword..max_quarterword; {1/4 of a word}
@!halfword=min_halfword..max_halfword; {1/2 of a word}
@!two_choices = 1..2; {used when there are two variants in a record}
@@ -1053,14 +1053,14 @@ sufficiently large.
% [9.116] Change `mem' to `zmem', so we can define mem to be a register
% pointer to the memory array for speed.
-@x [9.116] l.2545 - definition of main memory array
+@x [9.116] l.2566 - definition of main memory array
@!mem : array[mem_min..mem_max] of memory_word; {the big dynamic storage area}
@y
@!yzmem : ^memory_word; {the big dynamic storage area}
@!zmem : ^memory_word; {the big dynamic storage area}
@z
-@x [10.144] l.3006 - font numbers can be >255 now.
+@x [10.144] l.3027 - font numbers can be >255 now.
@p function new_ligature(@!f,@!c:quarterword; @!q:pointer):pointer;
@y
@p function new_ligature(@!f:internal_font_number; @!c:quarterword;
@@ -1069,7 +1069,7 @@ sufficiently large.
% [11.165] Fix the word `free' so that it doesn't conflict with the
% standard C library routine of the same name.
-@x [11.165] l.3364 - avoid conflict with lib function free()
+@x [11.165] l.3385 - avoid conflict with lib function free()
are debugging.)
@y
are debugging.)
@@ -1077,7 +1077,7 @@ are debugging.)
@d free==free_arr
@z
-@x [11.165] l.3367 - dummy |free| and |was_free| arrays
+@x [11.165] l.3388 - dummy |free| and |was_free| arrays
@!debug @!free: packed array [mem_min..mem_max] of boolean; {free cells}
@t\hskip10pt@>@!was_free: packed array [mem_min..mem_max] of boolean;
@y
@@ -1086,13 +1086,13 @@ are debugging.)
@t\hskip10pt@>@!was_free: packed array [0..9] of boolean;
@z
-@x [12.174] l.3526 - Eliminate unsigned comparisons to zero.
+@x [12.174] l.3547 - Eliminate unsigned comparisons to zero.
begin if (font(p)<font_base)or(font(p)>font_max) then
@y
begin if (font(p)>font_max) then
@z
-@x [12.176] l.3563 - Eliminate unsigned comparisons to zero.
+@x [12.176] l.3584 - Eliminate unsigned comparisons to zero.
@p procedure print_font_and_char(@!p:integer); {prints |char_node| data}
begin if p>mem_end then print_esc("CLOBBERED.")
else begin if (font(p)<font_base)or(font(p)>font_max) then print_char("*")
@@ -1102,10 +1102,10 @@ begin if p>mem_end then print_esc("CLOBBERED.")
else begin if (font(p)>font_max) then print_char("*")
@z
-@x [12.186] l.3747 - Don't worry about strange floating point values.
+@x [12.186] l.3768 - Don't worry about strange floating point values.
if abs(mem[p+glue_offset].int)<@'4000000 then print("?.?")
else if abs(g)>float_constant(20000) then
-@y 3747
+@y
{ The Unix |pc| folks removed this restriction with a remark that
invalid bit patterns were vanishingly improbable, so we follow
their example without really understanding it.
@@ -1115,7 +1115,7 @@ else begin if (font(p)>font_max) then print_char("*")
@z
-@x [15.209] l.4165 - MLTeX: \charsubdef primitive
+@x [15.209] l.4186 - MLTeX: \charsubdef primitive
@d shorthand_def=95 {code definition ( \.{\\chardef}, \.{\\countdef}, etc.~)}
@y
@d shorthand_def=95 {code definition ( \.{\\chardef}, \.{\\countdef}, etc.~)}
@@ -1126,7 +1126,7 @@ else begin if (font(p)>font_max) then print_char("*")
% can not be translated. For example, messages printed by |print_mode|
% from [16.211] use different word order and [46.1049] use different
% word order and words are declined.
-@x [16.211] l.4256
+@x [16.211] l.4259
begin if m>0 then
case m div (max_command+1) of
0:print("vertical");
@@ -1172,13 +1172,13 @@ else case (-m) div (max_command+1) of
end;
@z
-@x [16.213] l.4321 - texarray
+@x [16.213] l.4342 - texarray
@!nest:array[0..nest_size] of list_state_record;
@y
@!nest:^list_state_record;
@z
-@x [16.215] l.4344 - remove mem[] reference from initialize.
+@x [16.215] l.4365 - reference from initialize.
prev_graf:=0; shown_mode:=0;
@<Start a new current page@>;
@y
@@ -1189,7 +1189,7 @@ last_glue:=max_halfword; last_penalty:=0; last_kern:=0;
page_depth:=0; page_max_depth:=0;
@z
-@x [16.219] l.4409 - i18n fix
+@x [16.219] l.4430 - i18n fix
print_int(nest[p].pg_field); print(" line");
if nest[p].pg_field<>1 then print_char("s");
@y
@@ -1198,7 +1198,7 @@ page_depth:=0; page_max_depth:=0;
else print(" line");
@z
-@x [17.220] l.4448 - MLTeX: char_sub_code_base
+@x [17.220] l.4469 - MLTeX: char_sub_code_base
paragraph shape.
@y
paragraph shape.
@@ -1206,7 +1206,7 @@ Additionally region~4 contains the table with ML\TeX's character
substitution definitions.
@z
-@x [17.222] l.4523 - frozen_special, for source specials.
+@x [17.222] l.4543 - frozen_special, for source specials.
@d frozen_null_font=frozen_control_sequence+10
@y
@d frozen_special=frozen_control_sequence+10
@@ -1214,13 +1214,13 @@ substitution definitions.
@d frozen_null_font=frozen_control_sequence+11
@z
-@x [17.222] l.4526 - max_font_max
+@x [17.222] l.4547 - max_font_max
@d undefined_control_sequence=frozen_null_font+257 {dummy location}
@y
@d undefined_control_sequence=frozen_null_font+max_font_max+1 {dummy location}
@z
-@x [17.222] l.4533 - hash_extra
+@x [17.222] l.4554 - hash_extra
for k:=active_base to undefined_control_sequence-1 do
eqtb[k]:=eqtb[undefined_control_sequence];
@y
@@ -1228,14 +1228,14 @@ for k:=active_base to eqtb_top do
eqtb[k]:=eqtb[undefined_control_sequence];
@z
-@x [17.230] l.4731 - MLTeX: char_sub_code_base
+@x [17.230] l.4752 - MLTeX: char_sub_code_base
@d int_base=math_code_base+256 {beginning of region 5}
@y
@d char_sub_code_base=math_code_base+256 {table of character substitutions}
@d int_base=char_sub_code_base+256 {beginning of region 5}
@z
-@x [17.230] l.4752 - MLTeX: char_sub_code_base
+@x [17.230] l.4773 - MLTeX: char_sub_code_base
{Note: |math_code(c)| is the true math code plus |min_halfword|}
@y
{Note: |math_code(c)| is the true math code plus |min_halfword|}
@@ -1244,7 +1244,7 @@ for k:=active_base to eqtb_top do
@z
% MLTeX: \charsubdefmax and \tracingcharsubdef
-@x [17.236] l.4954
+@x [17.236] l.4975
@d int_pars=55 {total number of integer parameters}
@y
@d tex_int_pars=55 {total number of \TeX's integer parameters}
@@ -1259,7 +1259,7 @@ for k:=active_base to eqtb_top do
@z
% MLTeX: \charsubdefmax and \tracingcharsubdef
-@x [17.236] l.5016
+@x [17.236] l.5037
@d error_context_lines==int_par(error_context_lines_code)
@y
@d error_context_lines==int_par(error_context_lines_code)
@@ -1270,7 +1270,7 @@ for k:=active_base to eqtb_top do
@z
% MLTeX: \charsubdefmax and \tracingcharsubdef
-@x [17.237] l.5080
+@x [17.237] l.5101
error_context_lines_code:print_esc("errorcontextlines");
@y
error_context_lines_code:print_esc("errorcontextlines");
@@ -1280,7 +1280,7 @@ tracing_char_sub_def_code:print_esc("tracingcharsubdef");
@z
% MLTeX: \charsubdefmax and \tracingcharsubdef
-@x [17.238] l.5200
+@x [17.238] l.5221
@!@:error_context_lines_}{\.{\\errorcontextlines} primitive@>
@y
@!@:error_context_lines_}{\.{\\errorcontextlines} primitive@>
@@ -1296,7 +1296,7 @@ if mltex_p then
end;
@z
-@x [17.240] l.5213 - MLTeX: \charsubdefmax and \tracingcharsubdef
+@x [17.240] l.5234 - MLTeX: \charsubdefmax and \tracingcharsubdef
for k:=int_base to del_code_base-1 do eqtb[k].int:=0;
@y
for k:=int_base to del_code_base-1 do eqtb[k].int:=0;
@@ -1305,7 +1305,7 @@ char_sub_def_min:=256; char_sub_def_max:=-1;
{|tracing_char_sub_def:=0| is already done}@/
@z
-@x [17.241] l.5219 - Do `fix_date_and_time' in C.
+@x [17.241] l.5240 - Do `fix_date_and_time' in C.
@ The following procedure, which is called just before \TeX\ initializes its
input and output, establishes the initial values of the date and time.
@^system dependencies@>
@@ -1335,20 +1335,20 @@ output on the first line of the log file. (New in 2021.)
begin date_and_time(sys_time,sys_day,sys_month,sys_year);
@z
-@x [17.252] l.5420 - hash_extra
+@x [17.252] l.5447 - hash_extra
else if n<glue_base then @<Show equivalent |n|, in region 1 or 2@>
@y
else if (n<glue_base) or ((n>eqtb_size)and(n<=eqtb_top)) then
@<Show equivalent |n|, in region 1 or 2@>
@z
-@x [17.253] l.5435 - Change eqtb to zeqtb.
+@x [17.253] l.5462 - Change eqtb to zeqtb.
@!eqtb:array[active_base..eqtb_size] of memory_word;
@y
@!zeqtb:^memory_word;
@z
-@x [18.256] l.5483 - hash_extra
+@x [18.256] l.5510 - hash_extra
@!hash: array[hash_base..undefined_control_sequence-1] of two_halves;
{the hash table}
@!hash_used:pointer; {allocation pointer for |hash|}
@@ -1362,20 +1362,20 @@ else if (n<glue_base) or ((n>eqtb_size)and(n<=eqtb_top)) then
@!hash_high:pointer; {pointer to next high hash location}
@z
-@x [18.257] l.5491 - hash_extra
+@x [18.257] l.5518 - hash_extra
next(hash_base):=0; text(hash_base):=0;
for k:=hash_base+1 to undefined_control_sequence-1 do hash[k]:=hash[hash_base];
@y
@z
-@x [18.258] l.5495 - hash_extra
+@x [18.258] l.5522 - hash_extra
hash_used:=frozen_control_sequence; {nothing is used}
@y
hash_used:=frozen_control_sequence; {nothing is used}
hash_high:=0;
@z
-@x [18.260] l.5531 - hash_extra
+@x [18.260] l.5558 - hash_extra
@ @<Insert a new control...@>=
begin if text(p)>0 then
begin repeat if hash_is_full then overflow("hash size",hash_size);
@@ -1401,45 +1401,45 @@ begin if text(p)>0 then
end;
@z
-@x [18.262] l.5583 - hash_extra
+@x [18.262] l.5610 - hash_extra
else if p>=undefined_control_sequence then print_esc("IMPOSSIBLE.")
@y
else if ((p>=undefined_control_sequence)and(p<=eqtb_size))or(p>eqtb_top) then
print_esc("IMPOSSIBLE.")
@z
-@x [18.262] l.5584 - Remove more unsigned comparisons to zero.
+@x [18.262] l.5611 - Remove more unsigned comparisons to zero.
else if (text(p)<0)or(text(p)>=str_ptr) then print_esc("NONEXISTENT.")
@y
else if (text(p)>=str_ptr) then print_esc("NONEXISTENT.")
@z
-@x [19.271] l.5872 - texarray
+@x [19.271] l.5899 - texarray
@!save_stack : array[0..save_size] of memory_word;
@y
@!save_stack : ^memory_word;
@z
-@x [19.283] l.6050 - hash_extra
+@x [19.283] l.6077 - hash_extra
if p<int_base then
@y
if (p<int_base)or(p>eqtb_size) then
@z
-@x [20.290] l.6158 - hash_extra
+@x [20.290] l.6185 - hash_extra
if cs_token_flag+undefined_control_sequence>max_halfword then bad:=21;
@y
if cs_token_flag+eqtb_size+hash_extra>max_halfword then bad:=21;
if (hash_offset<0)or(hash_offset>hash_base) then bad:=42;
@z
-@x [22.301] l.6432 - texarray
+@x [22.301] l.6459 - texarray
@!input_stack : array[0..stack_size] of in_state_record;
@y
@!input_stack : ^in_state_record;
@z
-@x [22.304] l.6536 - texarray; additions for file:line:error style.
+@x [22.304] l.6563 - texarray; additions for file:line:error style.
@!input_file : array[1..max_in_open] of alpha_file;
@!line : integer; {current line number in the current source file}
@!line_stack : array[1..max_in_open] of integer;
@@ -1451,7 +1451,7 @@ if (hash_offset<0)or(hash_offset>hash_base) then bad:=42;
@!full_source_filename_stack : ^str_number;
@z
-@x [22.306] l.6855 - i18n fix
+@x [22.306] l.6615 - i18n fix
begin print_nl("Runaway ");
@.Runaway...@>
case scanner_status of
@@ -1479,7 +1479,7 @@ if (hash_offset<0)or(hash_offset>hash_base) then bad:=42;
end; {there are no other cases}
@z
-@x [22.308] l.6701 - texarray
+@x [22.308] l.6728 - texarray
@!param_stack:array [0..param_size] of pointer;
{token list pointers for parameters}
@y
@@ -1487,26 +1487,34 @@ if (hash_offset<0)or(hash_offset>hash_base) then bad:=42;
{token list pointers for parameters}
@z
-@x [23.328] l.7043 - keep top of source_filename_stack initialized
+@x [23.328] l.7064 - keep top of source_filename_stack initialized
incr(in_open); push_input; index:=in_open;
@y
incr(in_open); push_input; index:=in_open;
source_filename_stack[index]:=0;full_source_filename_stack[index]:=0;
@z
-@x [23.331] l.7071 - init source file name stacks
+@x [23.331] l.7092 - init source file name stacks
begin input_ptr:=0; max_in_stack:=0;
@y
begin input_ptr:=0; max_in_stack:=0;
source_filename_stack[0]:=0;full_source_filename_stack[0]:=0;
@z
-@x [24.338] l.7164 - i18n fix
+% Original report: https://tug.org/pipermail/tex-k/2024-March/004021.html
+% TeX bug entry: https://tug.org/texmfbug/newbug.html#B142outer
+@x [24.336] l.7152 - allow interactive deletion of \outer token
+begin if scanner_status<>normal then
+@y
+begin if OK_to_interrupt and(scanner_status<>normal) then
+@z
+
+@x [24.338] l.7191 - i18n fix
print(" while scanning ");
@y
@z
-@x [24.339] l.7185 - i18n fix
+@x [24.339] l.7213 - i18n fix
defining:begin print("definition"); info(p):=right_brace_token+"}";
end;
matching:begin print("use"); info(p):=par_token; long_state:=outer_call;
@@ -1561,7 +1569,7 @@ else begin
end
@z
-@x [28.501] l.9747 - \eof18
+@x [28.501] l.9765 - \eof18
if_eof_code: begin scan_four_bit_int; b:=(read_open[cur_val]=closed);
end;
@y
@@ -1571,7 +1579,7 @@ if_eof_code: begin scan_four_bit_int_or_18;
end;
@z
-@x [29.513] l.9951 - Area and extension rules for filenames.
+@x [29.513] l.9983 - Area and extension rules for filenames.
@ The file names we shall deal with for illustrative purposes have the
following structure: If the name contains `\.>' or `\.:', the file area
consists of all characters up to and including the final such character;
@@ -1588,7 +1596,7 @@ otherwise the file area is null. If the remaining file name contains
`\..' to the end, otherwise the file extension is null.
@z
-@x [29.513] l.9963 - Area and extension rules for filenames.
+@x [29.513] l.9995 - Area and extension rules for filenames.
@!area_delimiter:pool_pointer; {the most recent `\.>' or `\.:', if any}
@!ext_delimiter:pool_pointer; {the relevant `\..', if any}
@y
@@ -1596,7 +1604,7 @@ otherwise the file area is null. If the remaining file name contains
@!ext_delimiter:pool_pointer; {the most recent `\..', if any}
@z
-@x [29.514] l.9973 - TeX area directories.
+@x [29.514] l.10005 - TeX area directories.
@d TEX_area=="TeXinputs:"
@.TeXinputs@>
@d TEX_font_area=="TeXfonts:"
@@ -1605,13 +1613,13 @@ otherwise the file area is null. If the remaining file name contains
In C, the default paths are specified separately.
@z
-@x [29.515] l.9995 - filenames: quoted
+@x [29.515] l.10014 - filenames: quoted
begin area_delimiter:=0; ext_delimiter:=0;
@y
begin area_delimiter:=0; ext_delimiter:=0; quoted_filename:=false;
@z
-@x [29.516] l.9992 - filenames: more_name
+@x [29.516] l.10024 - filenames: more_name
begin if c=" " then more_name:=false
@y
begin if (c=" ") and stop_at_space and (not quoted_filename) then
@@ -1622,19 +1630,19 @@ else if c="""" then begin
end
@z
-@x [29.516] l.9994 - filenames: more_name
+@x [29.516] l.10026 - filenames: more_name
if (c=">")or(c=":") then
@y
if IS_DIR_SEP(c) then
@z
-@x [29.516] l.9997 - filenames: more_name
+@x [29.516] l.10029 - filenames: more_name
else if (c=".")and(ext_delimiter=0) then ext_delimiter:=cur_length;
@y
else if c="." then ext_delimiter:=cur_length;
@z
-@x [29.517] l.10002 - end_name: string recycling
+@x [29.517] l.10034 - end_name: string recycling
@ The third.
@^system dependencies@>
@@ -1654,7 +1662,7 @@ var temp_str: str_number; {result of file name cache lookups}
@!must_quote:boolean; {whether we need to quote a string}
@z
-@x [29.517] l.10022 - end_name: spaces in filenames
+@x [29.517] l.10040 - end_name: spaces in filenames
@:TeX capacity exceeded number of strings}{\quad number of strings@>
@y
@:TeX capacity exceeded number of strings}{\quad number of strings@>
@@ -1713,7 +1721,7 @@ if ext_delimiter<>0 then begin
end;
@z
-@x [29.517] l.10011 - end_name: string recycling
+@x [29.517] l.10044 - end_name: string recycling
end;
if ext_delimiter=0 then
begin cur_ext:=""; cur_name:=make_string;
@@ -1732,7 +1740,7 @@ if ext_delimiter=0 then
begin cur_ext:=""; cur_name:=slow_make_string;
@z
-@x [29.517] l.10016 - end_name: string recycling
+@x [29.517] l.10050 - end_name: string recycling
incr(str_ptr); cur_ext:=make_string;
@y
incr(str_ptr); cur_ext:=make_string;
@@ -1749,7 +1757,7 @@ if ext_delimiter=0 then
cur_ext:=slow_make_string; {remake extension string}
@z
-@x [29.518] l.10042 - print_file_name: quote if spaces in names.
+@x [29.518] l.10056 - print_file_name: quote if spaces in names.
some operating systems put the file area last instead of first.)
@^system dependencies@>
@y
@@ -1771,7 +1779,7 @@ if #<>0 then
print(so(str_pool[j]))
@z
-@x [29.518] l.10042 - print_file_name: quote if spaces in names.
+@x [29.518] l.10061 - print_file_name: quote if spaces in names.
begin slow_print(a); slow_print(n); slow_print(e);
@y
var must_quote: boolean; {whether to quote the filename}
@@ -1790,7 +1798,7 @@ print_quoted(a); print_quoted(n); print_quoted(e);
if must_quote then print_char("""");
@z
-@x [29.519] l.10051 - have append_to_name skip quotes.
+@x [29.519] l.10070 - have append_to_name skip quotes.
@d append_to_name(#)==begin c:=#; incr(k);
if k<=file_name_size then name_of_file[k]:=xchr[c];
end
@@ -1802,7 +1810,7 @@ if must_quote then print_char("""");
% [29.519] In pack_file_name, leave room for the extra null we append at
% the end of a filename.
-@x [29.519] l.10047 - pack_file_name, leave room for the extra null
+@x [29.519] l.10078 - pack_file_name, leave room for the extra null
begin k:=0;
@y
begin k:=0;
@@ -1810,13 +1818,13 @@ if name_of_file then libc_free (name_of_file);
name_of_file:= xmalloc_array (ASCII_code, length(a)+length(n)+length(e)+1);
@z
-@x [29.519] l.10051 - pack_file_name, append the extra null
+@x [29.519] l.10083 - pack_file_name, append the extra null
for k:=name_length+1 to file_name_size do name_of_file[k]:=' ';
@y
name_of_file[name_length+1]:=0;
@z
-@x [29.520] l.10060 - filenames: default format.
+@x [29.520] l.10092 - filenames: default format.
@d format_default_length=20 {length of the |TEX_format_default| string}
@d format_area_length=11 {length of its area part}
@d format_ext_length=4 {length of its `\.{.fmt}' part}
@@ -1829,7 +1837,7 @@ length will be set in the main program.
@d format_ext_length=4 {length of its `\.{.fmt}' part}
@z
-@x [29.521] l.10066 - filenames: default format, where `plain.fmt' is.
+@x [29.520] l.10098 - filenames: default format, where `plain.fmt' is.
@!TEX_format_default:packed array[1..format_default_length] of char;
@ @<Set init...@>=
@@ -1843,7 +1851,7 @@ in C, instead of Pascal, since we want them to depend on the name of the
program.
@z
-@x [29.523] l.10095 - Change to pack_buffered_name as with pack_file_name.
+@x [29.523] l.10127 - Change to pack_buffered_name as with pack_file_name.
for j:=1 to n do append_to_name(xord[TEX_format_default[j]]);
for j:=a to b do append_to_name(buffer[j]);
for j:=format_default_length-format_ext_length+1 to format_default_length do
@@ -1861,7 +1869,7 @@ if k<=file_name_size then name_length:=k@+else name_length:=file_name_size;
name_of_file[name_length+1]:=0;
@z
-@x [29.524] l.10118 - Format file opening: only try once, with path searching.
+@x [29.524] l.10150 - Format file opening: only try once, with path searching.
pack_buffered_name(0,loc,j-1); {try first without the system file area}
if w_open_in(fmt_file) then goto found;
pack_buffered_name(format_area_length,loc,j-1);
@@ -1872,7 +1880,7 @@ name_of_file[name_length+1]:=0;
if w_open_in(fmt_file) then goto found;
@z
-@x [29.524] l.10124 - replace `PLAIN' in error messages with `default'.
+@x [29.524] l.10156 - replace `PLAIN' in error messages with `default'.
wterm_ln('Sorry, I can''t find that format;',' will try PLAIN.');
@y
wterm ('Sorry, I can''t find the format `');
@@ -1882,7 +1890,7 @@ name_of_file[name_length+1]:=0;
wterm_ln ('''.');
@z
-@x [29.524] l.10132 - replace `PLAIN' in error messages with `default'.
+@x [29.524] l.10164 - replace `PLAIN' in error messages with `default'.
wterm_ln('I can''t find the PLAIN format file!');
@.I can't find PLAIN...@>
@y
@@ -1892,7 +1900,7 @@ name_of_file[name_length+1]:=0;
@.I can't find the format...@>
@z
-@x [29.525] l.10170 - make_name_string
+@x [29.525] l.10184 - make_name_string
begin if (pool_ptr+name_length>pool_size)or(str_ptr=max_strings)or
@y
save_area_delimiter, save_ext_delimiter: pool_pointer;
@@ -1900,7 +1908,7 @@ save_name_in_progress, save_stop_at_space: boolean;
begin if (pool_ptr+name_length>pool_size)or(str_ptr=max_strings)or
@z
-@x [29.525] l.10174 - make_name_string
+@x [29.525] l.10188 - make_name_string
make_name_string:=make_string;
@y
make_name_string:=make_string;
@@ -1920,7 +1928,7 @@ begin if (pool_ptr+name_length>pool_size)or(str_ptr=max_strings)or
area_delimiter:=save_area_delimiter; ext_delimiter:=save_ext_delimiter;
@z
-@x [29.526] l.10193 - look for a left_brace when scanning a file name
+@x [29.526] l.10206 - look for a left_brace when scanning a file name
@p procedure scan_file_name;
label done;
@y
@@ -1941,7 +1949,7 @@ begin
else
@z
-@x [29.526] l.10194 - stop scanning file name if we're at end-of-line.
+@x [29.526] l.10213 - stop scanning file name if we're at end-of-line.
if not more_name(cur_chr) then goto done;
@y
{If |cur_chr| is a space and we're not scanning a token list, check
@@ -1951,7 +1959,7 @@ begin
if not more_name(cur_chr) then goto done;
@z
-@x [29.526] l.10203 - scan a bgroup/egroup-delimited file name
+@x [29.526] l.10216 - scan a bgroup/egroup-delimited file name
done: end_name; name_in_progress:=false;
end;
@y
@@ -1961,7 +1969,7 @@ warning_index := save_warning_index; {restore |warning_index|}
end;
@z
-@x [29.530] l.10245 - prompt_file_name: prevent empty filenames.
+@x [29.530] l.10264 - prompt_file_name: prevent empty filenames.
var k:0..buf_size; {index into |buffer|}
@y
var k:0..buf_size; {index into |buffer|}
@@ -1970,7 +1978,7 @@ var k:0..buf_size; {index into |buffer|}
@!saved_cur_area:str_number; {to catch empty terminal input}
@z
-@x [29.530] l.10252 - prompt_file_name: No default extension is TeX input file.
+@x [29.530] l.10271 - prompt_file_name: No default extension is TeX input file.
if e=".tex" then show_context;
@y
if (e=".tex") or (e="") then show_context;
@@ -1982,7 +1990,7 @@ if (e<>"") then
print(")"); print_ln;
@z
-@x [29.530] l.10258 - prompt_file_name: prevent empty filenames.
+@x [29.530] l.10277 - prompt_file_name: prevent empty filenames.
clear_terminal; prompt_input(": "); @<Scan file name in the buffer@>;
if cur_ext="" then cur_ext:=e;
@y
@@ -2000,20 +2008,20 @@ else
if cur_ext="" then cur_ext:=e;
@z
-@x [29.532] l.10263 - avoid conflict, `logname' in <unistd.h> on some systems.
+@x [29.532] l.10295 - avoid conflict, `logname' in <unistd.h> on some systems.
@d ensure_dvi_open==if output_file_name=0 then
@y
@d log_name == texmf_log_name
@d ensure_dvi_open==if output_file_name=0 then
@z
-@x [29.534] l.10285 - Adjust for C string conventions.
+@x [29.534] l.10317 - Adjust for C string conventions.
@!months:packed array [1..36] of char; {abbreviations of month names}
@y
@!months:const_cstring;
@z
-@x [29.534] l.10300 - Filename change for the recorder.
+@x [29.534] l.10319 - Filename change for the recorder.
if job_name=0 then job_name:="texput";
@.texput@>
@y
@@ -2023,7 +2031,7 @@ pack_job_name(".fls");
recorder_change_filename(stringcast(name_of_file+1));
@z
-@x [29.534] l.10293 - MLTeX: add MLTeX banner after loading fmt file
+@x [29.534] l.10325 - MLTeX: add MLTeX banner after loading fmt file
@<Print the banner line, including the date and time@>;
@y
@<Print the banner line, including the date and time@>;
@@ -2032,7 +2040,7 @@ if mltex_enabled_p then
end;
@z
-@x
+@x [29.536] l.10356
begin wlog(banner);
@y
begin
@@ -2043,14 +2051,14 @@ else
wlog(banner);
@z
-@x [29.536] l.10324 - Print rest of banner.
+@x [29.536] l.10357 - Print rest of banner.
slow_print(format_ident); print(" ");
@y
wlog(version_string);
slow_print(format_ident); print(" ");
@z
-@x [29.536] l.10327 - Adjust for C string conventions.
+@x [29.536] l.10359 - Adjust for C string conventions.
months:='JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC';
@y
months := ' JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC';
@@ -2058,7 +2066,7 @@ months := ' JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC';
% Print whether we're using src-specials and other such features.
% Print TCX name if one's given.
-@x [29.536] l.10331
+@x [29.536] l.10363
end
@y
if shellenabledp then begin
@@ -2094,7 +2102,7 @@ end
% to open the file with and without the `.tex' extension, regardless of
% whether the file already has an extension. This allows filenames like
% `foo' and `foo.bar.tex', as well as `foo.tex' and `foo.bar'.
-@x [29.537] l.10338 - start_input
+@x [29.537] l.10373 - start_input
begin scan_file_name; {set |cur_name| to desired file name}
if cur_ext="" then cur_ext:=".tex";
pack_cur_name;
@@ -2117,13 +2125,13 @@ loop@+begin
goto done;
@z
-@x [29.537] l.10348 - start_input: don't force ".tex" extension.
+@x [29.537] l.10383 - start_input: don't force ".tex" extension.
prompt_file_name("input file name",".tex");
@y
prompt_file_name("input file name","");
@z
-@x [29.537] l.10350 - start_input: string recycling
+@x [29.537] l.10385 - start_input: string recycling
done: name:=a_make_name_string(cur_file);
@y
done: name:=a_make_name_string(cur_file);
@@ -2137,13 +2145,13 @@ if name=str_ptr-1 then {we can try to conserve string pool space now}
end;
@z
-@x [29.537] l.10352 - start_input: was job_name given on the command line?
+@x [29.537] l.10387 - start_input: was job_name given on the command line?
begin job_name:=cur_name; open_log_file;
@y
begin job_name:=get_job_name(cur_name); open_log_file;
@z
-@x [29.537] l.10356 -
+@x [29.537] l.10390
if term_offset+length(name)>max_print_line-2 then print_ln
else if (term_offset>0)or(file_offset>0) then print_char(" ");
print_char("("); incr(open_parens); slow_print(name); update_terminal;
@@ -2155,14 +2163,14 @@ print_char("("); incr(open_parens);
slow_print(full_source_filename_stack[in_open]); update_terminal;
@z
-@x [29.537] l.10360 - start_input: don't return filename to string pool.
+@x [29.537] l.10394 - start_input: don't return filename to string pool.
if name=str_ptr-1 then {conserve string pool space (but see note above)}
begin flush_string; name:=cur_name;
end;
@y
@z
-@x [30.548] l.10673 - texarray
+@x [30.548] l.10708 - texarray
@!internal_font_number=font_base..font_max; {|font| in a |char_node|}
@!font_index=0..font_mem_size; {index into |font_info|}
@y
@@ -2171,7 +2179,7 @@ if name=str_ptr-1 then {conserve string pool space (but see note above)}
@!nine_bits=min_quarterword..non_char;
@z
-@x [30.549] l.10682 - texarray
+@x [30.549] l.10717 - texarray
@!font_info:array[font_index] of memory_word;
{the big collection of font data}
@!fmem_ptr:font_index; {first unused word of |font_info|}
@@ -2235,7 +2243,7 @@ if name=str_ptr-1 then {conserve string pool space (but see note above)}
{|font_bchar| if it doesn't exist in the font, otherwise |non_char|}
@z
-@x [30.550] l.10723 - texarray
+@x [30.550] l.10758 - texarray
@!char_base:array[internal_font_number] of integer;
{base addresses for |char_info|}
@!width_base:array[internal_font_number] of integer;
@@ -2275,12 +2283,12 @@ if name=str_ptr-1 then {conserve string pool space (but see note above)}
{base addresses for font parameters}
@z
-@x [30.551] l.10743 - texarray
+@x [30.551] l.10778 - texarray
for k:=font_base to font_max do font_used[k]:=false;
@y
@z
-@x [30.552] l.10749 - texarray
+@x [30.552] l.10784 - texarray
font_ptr:=null_font; fmem_ptr:=7;
font_name[null_font]:="nullfont"; font_area[null_font]:="";
hyphen_char[null_font]:="-"; skew_char[null_font]:=-1;
@@ -2298,7 +2306,7 @@ for k:=0 to 6 do font_info[k].sc:=0;
@y
@z
-@x [30.554] l.10795 - MLTeX: |effective_char| in |char_info|
+@x [30.554] l.10830 - MLTeX: |effective_char| in |char_info|
as fast as possible under the circumstances.
@^inner loop@>
@@ -2356,7 +2364,7 @@ metric information in this font, and character accesses in math mode.
@#
@z
-@x [30] m.560 l.10876 - MLTeX: |effective_char| in |char_info|
+@x [30.560] l.10911 - MLTeX: |effective_char| in |char_info|
@p function read_font_info(@!u:pointer;@!nom,@!aire:str_number;
@y
@p @t\4@>@<Declare additional functions for ML\TeX@>@/
@@ -2364,21 +2372,21 @@ metric information in this font, and character accesses in math mode.
function read_font_info(@!u:pointer;@!nom,@!aire:str_number;
@z
-@x [30.560] l.10898 - Check lengths
+@x [30.560] l.10915 - Check lengths
@!file_opened:boolean; {was |tfm_file| successfully opened?}
@y
@!name_too_long:boolean; {|nom| or |aire| exceeds 255 bytes?}
@!file_opened:boolean; {was |tfm_file| successfully opened?}
@z
-@x [30.561] l.10939 - Check lengths
+@x [30.561] l.10956 - Check lengths
else print(" not loadable: Metric (TFM) file not found");
@y
else if name_too_long then print(" not loadable: Metric (TFM) file name too long")
else print(" not loadable: Metric (TFM) file not found");
@z
-@x [30.563] l.10961 - Check lengths, don't use TEX_font_area.
+@x [30.563] l.10978 - Check lengths, don't use TEX_font_area.
if aire="" then pack_file_name(nom,TEX_font_area,".tfm")
else pack_file_name(nom,aire,".tfm");
@y
@@ -2393,7 +2401,7 @@ pack_file_name(nom,aire,"");
% tfm file, we read its first byte into `tfm_temp' right away. TeX
% looks at `fbyte' before calling `fget', so it ends up seeing every
% byte. This is Pascal-like I/O.
-@x [30.564] l.10956 - reading the tfm file, define fget & fbyte
+@x [30.564] l.10991 - reading the tfm file, define fget & fbyte
@d fget==get(tfm_file)
@d fbyte==tfm_file^
@y
@@ -2401,13 +2409,13 @@ pack_file_name(nom,aire,"");
@d fbyte==tfm_temp
@z
-@x [30.570] l.11064 - MLTeX: fix for bug while loading font
+@x [30.570] l.11100 - MLTeX: fix for bug while loading font
begin qw:=char_info(f)(d);
@y
begin qw:=orig_char_info(f)(d);
@z
-@x [30.573] l.11116 - MLTeX: fix for bug while loading font
+@x [30.573] l.11152 - MLTeX: fix for bug while loading font
qw:=char_info(f)(#); {N.B.: not |qi(#)|}
@y
qw:=orig_char_info(f)(#); {N.B.: not |qi(#)|}
@@ -2416,19 +2424,19 @@ pack_file_name(nom,aire,"");
% [30.575] We only want `eof' on the TFM file to be true if we
% previously had EOF, not if we're at EOF now. This is like `feof', and
% unlike our implementation of `eof' elsewhere.
-@x [30.575] l.11180 - Reading the tfm file, replace eof() by feof().
+@x [30.575] l.11197 - Reading the tfm file, replace eof() by feof().
if eof(tfm_file) then abort;
@y
if feof(tfm_file) then abort;
@z
-@x [30.576] l.11180 - MLTeX: fix for bug while loading font
+@x [30.576] l.11216 - MLTeX: fix for bug while loading font
begin qw:=char_info(f)(bchar); {N.B.: not |qi(bchar)|}
@y
begin qw:=orig_char_info(f)(bchar); {N.B.: not |qi(bchar)|}
@z
-@x [30.582] l.11276 - MLTeX: call |effective_char| in |new_character|
+@x [30.582] l.11312 - MLTeX: call |effective_char| in |new_character|
@p function new_character(@!f:internal_font_number;@!c:eight_bits):pointer;
label exit;
var p:pointer; {newly allocated node}
@@ -2448,7 +2456,7 @@ if font_bc[f]<=qo(ec) then if font_ec[f]>=qo(ec) then
if char_exists(orig_char_info(f)(ec)) then {N.B.: not |char_info|}
@z
-@x [32.592] l.11820 - font numbers can be >255 now.
+@x [32.592] l.11856 - font numbers can be >255 now.
@!c,@!f:quarterword; {character and font in current |char_node|}
@y
{character and font in current |char_node|}
@@ -2456,7 +2464,7 @@ if font_bc[f]<=qo(ec) then if font_ec[f]>=qo(ec) then
@!f:internal_font_number;
@z
-@x [32.595] l.11860 - texarray
+@x [32.595] l.11896 - texarray
@!dvi_buf:array[dvi_index] of eight_bits; {buffer for \.{DVI} output}
@!half_buf:dvi_index; {half of |dvi_buf_size|}
@!dvi_limit:dvi_index; {end of the current half buffer}
@@ -2468,7 +2476,7 @@ if font_bc[f]<=qo(ec) then if font_ec[f]>=qo(ec) then
@!dvi_ptr:integer; {the next available buffer address}
@z
-@x [32.597] l.11886 - write_dvi done in C.
+@x [32.597] l.11922 - write_dvi done in C.
@p procedure write_dvi(@!a,@!b:dvi_index);
var k:dvi_index;
begin for k:=a to b do write(dvi_file,dvi_buf[k]);
@@ -2479,7 +2487,7 @@ the bytes in one shot. Much better even than writing four
bytes at a time.
@z
-@x [32.601] l.11911 - check dvi file size
+@x [32.598] l.11928 - check dvi file size
each time, we use the macro |dvi_out|.
@y
each time, we use the macro |dvi_out|.
@@ -2488,7 +2496,7 @@ The length of |dvi_file| should not exceed |@"7FFFFFFF|; we set |cur_s:=-2|
to prevent further \.{DVI} output causing infinite recursion.
@z
-@x [32.601] l.11918 - dvi_swap: check dvi file size
+@x [32.598] l.11935 - dvi_swap: check dvi file size
begin if dvi_limit=dvi_buf_size then
@y
begin if dvi_ptr>(@"7FFFFFFF-dvi_offset) then
@@ -2499,7 +2507,7 @@ begin if dvi_ptr>(@"7FFFFFFF-dvi_offset) then
if dvi_limit=dvi_buf_size then
@z
-@x [32.602] l.11932 - empty the last bytes: check dvi file size
+@x [32.599] l.11949 - empty the last bytes: check dvi file size
if dvi_ptr>0 then write_dvi(0,dvi_ptr-1)
@y
if dvi_ptr>(@"7FFFFFFF-dvi_offset) then
@@ -2510,7 +2518,7 @@ if dvi_ptr>(@"7FFFFFFF-dvi_offset) then
if dvi_ptr>0 then write_dvi(0,dvi_ptr-1)
@z
-@x [32.602] l.11944 - Allow for outputting more than 256 fonts.
+@x [32.602] l.11980 - Allow for outputting more than 256 fonts.
begin dvi_out(fnt_def1);
dvi_out(f-font_base-1);@/
@y
@@ -2524,7 +2532,7 @@ else begin dvi_out(fnt_def1+1);
end;
@z
-@x [32.617] l.12280 - Use output_comment if the user set it. Assume it's short enough.
+@x [32.617] l.12297 - Use output_comment if the user set it. Assume it's short enough.
old_setting:=selector; selector:=new_string;
@y
if output_comment then
@@ -2535,14 +2543,14 @@ else begin {the default code is unchanged}
old_setting:=selector; selector:=new_string;
@z
-@x [32.617] l.12288 - Use output_comment if the user set it.
+@x [32.617] l.12305 - Use output_comment if the user set it.
end
@y
end;
end
@z
-@x [32.619] l.12294 - MLTeX: substitute character in |hlist_out|
+@x [32.619] l.12330 - MLTeX: substitute character in |hlist_out|
procedure hlist_out; {output an |hlist_node| box}
label reswitch, move_past, fin_rule, next_p;
@y
@@ -2550,7 +2558,7 @@ procedure hlist_out; {output an |hlist_node| box}
label reswitch, move_past, fin_rule, next_p, continue, found;
@z
-@x [32.620] l.12326 - MLTeX: replace virtual character in |hlist_out|
+@x [32.620] l.12365 - MLTeX: replace virtual character in |hlist_out|
reaching a non-|char_node|. The program uses the fact that |set_char_0=0|.
@^inner loop@>
@y
@@ -2573,7 +2581,7 @@ the current hlist is normally traversed more than once!)
@^inner loop@>
@z
-@x [32.620] l.12334 - MLTeX: substitute character during |shipout|
+@x [32.620] l.12373 - MLTeX: substitute character during |shipout|
if c>=qi(128) then dvi_out(set1);
dvi_out(qo(c));@/
cur_h:=cur_h+char_width(f)(char_info(f)(c));
@@ -2590,7 +2598,7 @@ the current hlist is normally traversed more than once!)
continue:
@z
-@x [32.622] l.12349 - more >256 font output stuff.
+@x [32.621] l.12388 - more >256 font output stuff.
else begin dvi_out(fnt1); dvi_out(f-font_base-1);
end;
@y
@@ -2605,7 +2613,7 @@ else begin dvi_out(fnt1+1);
% We output each portion of the page as we get to it, if we are using
% IPC, so that the previewer (TeXView) can display it immediately. [SPM]
-@x [32.640] l.12723 - IPC
+@x [32.640] l.12740 - IPC
done:
@y
ifdef ('IPC')
@@ -2632,14 +2640,14 @@ endif ('IPC');
done:
@z
-@x [32.645] l.12766 - check dvi file size
+@x [32.642] l.12783 - check dvi file size
else begin dvi_out(post); {beginning of the postamble}
@y
else if cur_s<>-2 then
begin dvi_out(post); {beginning of the postamble}
@z
-@x [32.645] l.12775 - Use dvi_offset instead of dvi_buf_size with IPC stuff.
+@x [32.642] l.12792 - Use dvi_offset instead of dvi_buf_size with IPC stuff.
k:=4+((dvi_buf_size-dvi_ptr) mod 4); {the number of 223's}
@y
ifdef ('IPC')
@@ -2650,13 +2658,13 @@ ifndef ('IPC')
endifn ('IPC')
@z
-@x [32.645] l.12780 - use print_file_name
+@x [32.642] l.12797 - use print_file_name
print_nl("Output written on "); slow_print(output_file_name);
@y
print_nl("Output written on "); print_file_name(0, output_file_name, 0);
@z
-@x [32.645] l.12782 - i18n fix
+@x [32.642] l.12799 - i18n fix
print(" ("); print_int(total_pages); print(" page");
if total_pages<>1 then print_char("s");
@y
@@ -2671,7 +2679,7 @@ endifn ('IPC')
% can be substituted => we have to avoid this in math mode
% (for compatibility reasons and to avoid other problems).
%
-@x [35.708] l.13903 - MLTeX: avoid substitution in |var_delimiter|
+@x [35.708] l.13954 - MLTeX: avoid substitution in |var_delimiter|
if (qo(y)>=font_bc[g])and(qo(y)<=font_ec[g]) then
begin continue: q:=char_info(g)(y);
@y
@@ -2679,19 +2687,19 @@ if (qo(y)>=font_bc[g])and(qo(y)<=font_ec[g]) then
begin continue: q:=orig_char_info(g)(y);
@z
-@x [36.722] l.14207 - MLTeX: avoid substitution in |fetch|
+@x [36.722] l.14224 - MLTeX: avoid substitution in |fetch|
cur_i:=char_info(cur_f)(cur_c)
@y
cur_i:=orig_char_info(cur_f)(cur_c)
@z
-@x [36.740] l.14486 - MLTeX: avoid substitution in |make_math_accent|
+@x [36.740] l.14537 - MLTeX: avoid substitution in |make_math_accent|
i:=char_info(f)(y);
@y
i:=orig_char_info(f)(y);
@z
-@x [36.749] l.14638 - MLTeX: avoid substitution in |make_op|
+@x [36.749] l.14689 - MLTeX: avoid substitution in |make_op|
begin c:=rem_byte(cur_i); i:=char_info(cur_f)(c);
@y
begin c:=rem_byte(cur_i); i:=orig_char_info(cur_f)(c);
@@ -2713,7 +2721,7 @@ if (insert_src_special_every_cr) then insert_src_special;
if every_cr<>null then begin_token_list(every_cr,every_cr_text);
@z
-@x [42.920] l.18056 - bigtrie: allow larger hyphenation tries.
+@x [42.920] l.18111 - bigtrie: allow larger hyphenation tries.
Comparatively few different number sequences $n_0\ldots n_k$ actually occur,
since most of the |n|'s are generally zero. Therefore the number sequences
are encoded in such a way that |trie_op|$(z_k)$ is only one byte long.
@@ -2745,14 +2753,14 @@ for this pattern by carrying out the following little program: Set
and |v:=hyf_next[v]|; repeat, if necessary, until |v=min_trie_op|.
@z
-@x [42.920] l.18068 - bigtrie: allow larger hyphenation tries.
+@x [42.920] l.18123 - bigtrie: allow larger hyphenation tries.
@!trie_pointer=0..trie_size; {an index into |trie|}
@y
@!trie_pointer=0..ssup_trie_size; {an index into |trie|}
@!trie_opcode=0..ssup_trie_opcode; {a trie opcode}
@z
-@x [42.921] l.18070 - bigtrie: allow larger hyphenation tries.
+@x [42.921] l.18125 - bigtrie: allow larger hyphenation tries.
@ @d trie_link(#)==trie[#].rh {``downward'' link in a trie}
@d trie_char(#)==trie[#].b1 {character matched at this trie location}
@d trie_op(#)==trie[#].b0 {program for hyphenation at this trie location}
@@ -2768,7 +2776,7 @@ another macro.
@d trie_op(#)==trie_tro[#] {program for hyphenation at this trie location}
@z
-@x [42.921] l.18075 - bigtrie: allow larger hyphenation tries.
+@x [42.921] l.18130 - bigtrie: allow larger hyphenation tries.
@!trie:array[trie_pointer] of two_halves; {|trie_link|, |trie_char|, |trie_op|}
@y
{We will dynamically allocate these arrays.}
@@ -2777,28 +2785,28 @@ another macro.
@!trie_trc:^quarterword; {|trie_char|}
@z
-@x [42.921] l.18078 - bigtrie: allow larger hyphenation tries.
+@x [42.921] l.18133 - bigtrie: allow larger hyphenation tries.
@!hyf_next:array[1..trie_op_size] of quarterword; {continuation code}
@y
@!hyf_next:array[1..trie_op_size] of trie_opcode; {continuation code}
@z
-@x [42.923] l.18099 - bigtrie: allow larger hyphenation tries.
+@x [42.923] l.18154 - bigtrie: allow larger hyphenation tries.
begin if trie_op(z)<>min_quarterword then
@y
begin if trie_op(z)<>min_trie_op then
@z
-@x [42.924] l.18112 - bigtrie: allow larger hyphenation tries.
+@x [42.924] l.18167 - bigtrie: allow larger hyphenation tries.
until v=min_quarterword;
@y
until v=min_trie_op;
@z
%%%%%%%% dynamic hyph_size
-@x 18126 m.925
+@x [42.925] l.18181
different from $\alpha$, we can conclude that $\alpha$ is not in the table.
-@y 18126
+@y
different from $\alpha$, we can conclude that $\alpha$ is not in the table.
This is a clever scheme which saves the need for a hash link array.
However, it is difficult to increase the size of the hyphen exception
@@ -2811,19 +2819,19 @@ arrays start at |0|.
@z
%%%%%%%% dynamic hyph_size
-@x 18134 m.925
+@x [42.925] l.18189
@!hyph_pointer=0..hyph_size; {an index into the ordered hash table}
-@y 18134
+@y
@!hyph_pointer=0..ssup_hyph_size; {index into hyphen exceptions hash table;
enlarging this requires changing (un)dump code}
@z
%%%%%%%% dynamic hyph_size
-@x 18137 m.926
+@x [42.926] l.18192
@!hyph_word:array[hyph_pointer] of str_number; {exception words}
@!hyph_list:array[hyph_pointer] of pointer; {lists of hyphen positions}
@!hyph_count:hyph_pointer; {the number of words in the exception dictionary}
-@y 18139
+@y
@!hyph_word: ^str_number; {exception words}
@!hyph_list: ^pointer; {lists of hyphen positions}
@!hyph_link: ^hyph_pointer; {link array for hyphen exceptions hash table}
@@ -2832,12 +2840,12 @@ arrays start at |0|.
@z
%%%%%%%% dynamic hyph_size
-@x 18145 m.928
+@x [42.928] l.18200
for z:=0 to hyph_size do
begin hyph_word[z]:=0; hyph_list[z]:=null;
end;
hyph_count:=0;
-@y 18148
+@y
for z:=0 to hyph_size do
begin hyph_word[z]:=0; hyph_list[z]:=null; hyph_link[z]:=0;
end;
@@ -2846,7 +2854,7 @@ hyph_next:=hyph_prime+1; if hyph_next>hyph_size then hyph_next:=hyph_prime;
@z
%%%%%%%% dynamic hyph_size
-@x 18163 m.930
+@x [42.930] l.18218
h:=hc[1]; incr(hn); hc[hn]:=cur_lang;
for j:=2 to hn do h:=(h+h+hc[j]) mod hyph_size;
loop@+ begin @<If the string |hyph_word[h]| is less than \(hc)|hc[1..hn]|,
@@ -2855,7 +2863,7 @@ loop@+ begin @<If the string |hyph_word[h]| is less than \(hc)|hc[1..hn]|,
if h>0 then decr(h)@+else h:=hyph_size;
end;
not_found: decr(hn)
-@y 18170
+@y
h:=hc[1]; incr(hn); hc[hn]:=cur_lang;
for j:=2 to hn do h:=(h+h+hc[j]) mod hyph_prime;
loop@+ begin @<If the string |hyph_word[h]| is less than \(hc)|hc[1..hn]|,
@@ -2867,7 +2875,7 @@ loop@+ begin @<If the string |hyph_word[h]| is less than \(hc)|hc[1..hn]|,
not_found: decr(hn)
@z
-@x [42.931] l.18206 - dynamic hyph_size
+@x [42.931] l.18227 - dynamic hyph_size
@ @<If the string |hyph_word[h]| is less than \(hc)...@>=
k:=hyph_word[h]; if k=0 then goto not_found;
if length(k)<hn then goto not_found;
@@ -2878,7 +2886,7 @@ the module title is no longer descriptive.}
k:=hyph_word[h]; if k=0 then goto not_found;
@z
-@x [42.931] l.18211 - dynamic hyph_size
+@x [42.931] l.18232 - dynamic hyph_size
repeat if so(str_pool[u])<hc[j] then goto not_found;
if so(str_pool[u])>hc[j] then goto done;
@y
@@ -2887,21 +2895,21 @@ k:=hyph_word[h]; if k=0 then goto not_found;
@z
%%%%%%%% dynamic hyph_size
-@x 18245 m.934
+@x [42.934] l.18273
@!s,@!t:str_number; {strings being compared or stored}
@y
@!s:str_number; {strings being compared or stored}
@z
%%%%%%%% dynamic hyph_size
-@x 18274 m.939
+@x [42.939] l.18329
begin h:=(h+h+hc[j]) mod hyph_size;
-@y 18274
+@y
begin h:=(h+h+hc[j]) mod hyph_prime;
@z
%%%%%%%% dynamic hyph_size
-@x 18281 m.940
+@x [42.940] l.18336
@ @<Insert the \(p)pair |(s,p)|...@>=
if hyph_count=hyph_size then overflow("exception dictionary",hyph_size);
@:TeX capacity exceeded exception dictionary}{\quad exception dictionary@>
@@ -2912,7 +2920,7 @@ while hyph_word[h]<>0 do
if h>0 then decr(h)@+else h:=hyph_size;
end;
hyph_word[h]:=s; hyph_list[h]:=p
-@y 18290
+@y
@ @<Insert the \(p)pair |(s,p)|...@>=
if hyph_next <= hyph_prime then
while (hyph_next>0) and (hyph_word[hyph_next-1]>0) do decr(hyph_next);
@@ -2935,7 +2943,7 @@ while hyph_word[h]<>0 do
found: hyph_word[h]:=s; hyph_list[h]:=p
@z
-@x [42.941] l.18326 - dynamic hyph_size
+@x [42.941] l.18347 - dynamic hyph_size
@ @<If the string |hyph_word[h]| is less than \(or)...@>=
k:=hyph_word[h];
if length(k)<length(s) then goto found;
@@ -2948,14 +2956,14 @@ k:=hyph_word[h];
if length(k)<>length(s) then goto not_found;
@z
-@x [42.941] l.18331 - dynamic hyph_size
+@x [42.941] l.18352 - dynamic hyph_size
repeat if str_pool[u]<str_pool[v] then goto found;
if str_pool[u]>str_pool[v] then goto not_found;
@y
repeat if str_pool[u]<>str_pool[v] then goto not_found;
@z
-@x [42.941] l.18335 - dynamic hyph_size
+@x [42.941] l.18356 - dynamic hyph_size
found:q:=hyph_list[h]; hyph_list[h]:=p; p:=q;@/
t:=hyph_word[h]; hyph_word[h]:=s; s:=t;
not_found:
@@ -2969,37 +2977,37 @@ goto found;
not_found:
@z
-@x [43.943] l.18332 - bigtrie: Larger tries, also in documentation parts.
+@x [43.943] l.18387 - bigtrie: Larger tries, also in documentation parts.
|hyf_next[@t$v^\prime$@>]=min_quarterword|.
@y
|hyf_next[@t$v^\prime$@>]=min_trie_op|.
@z
-@x [43.943] l.18336 - bigtrie: Larger tries, also in documentation parts.
+@x [43.943] l.18391 - bigtrie: Larger tries, also in documentation parts.
$$\hbox{|@t$v^\prime$@>:=new_trie_op(0,1,min_quarterword)|,\qquad
@y
$$\hbox{|@t$v^\prime$@>:=new_trie_op(0,1,min_trie_op)|,\qquad
@z
-@x [43.943] l.18346 - web2c can't parse negative lower bounds in arrays. Sorry.
+@x [43.943] l.18401 - web2c can't parse negative lower bounds in arrays. Sorry.
@!init @!trie_op_hash:array[-trie_op_size..trie_op_size] of 0..trie_op_size;
@y
@!init @!trie_op_hash:array[neg_trie_op_size..trie_op_size] of 0..trie_op_size;
@z
-@x [43.943] l.18348 - bigtrie: Larger hyphenation tries.
+@x [43.943] l.18403 - bigtrie: Larger hyphenation tries.
@!trie_used:array[ASCII_code] of quarterword;
@y
@!trie_used:array[ASCII_code] of trie_opcode;
@z
-@x [43.943] l.18352 - bigtrie: Larger hyphenation tries.
+@x [43.943] l.18407 - bigtrie: Larger hyphenation tries.
@!trie_op_val:array[1..trie_op_size] of quarterword;
@y
@!trie_op_val:array[1..trie_op_size] of trie_opcode;
@z
-@x [43.943] l.18355 - Dynamic trie arrays
+@x [43.943] l.18410 - Dynamic trie arrays
tini
@y
tini@;
@@ -3007,13 +3015,13 @@ tini@;
@!small_op:boolean; {flag used while dumping or undumping}
@z
-@x [43.944] l.18358 - bigtrie: Larger tries, also in documentation parts.
+@x [43.944] l.18413 - bigtrie: Larger tries, also in documentation parts.
|new_trie_op| could return |min_quarterword| (thereby simply ignoring
@y
|new_trie_op| could return |min_trie_op| (thereby simply ignoring
@z
-@x [43.944] l.18365 - bigtrie: Larger hyphenation tries.
+@x [43.944] l.18420 - bigtrie: Larger hyphenation tries.
function new_trie_op(@!d,@!n:small_number;@!v:quarterword):quarterword;
label exit;
var h:-trie_op_size..trie_op_size; {trial hash location}
@@ -3025,7 +3033,7 @@ var h:neg_trie_op_size..trie_op_size; {trial hash location}
@!u:trie_opcode; {trial op code}
@z
-@x [43.944] l.18370 - Another casting problem, and use |neg_trie_op_size|.
+@x [43.944] l.18425 - Another casting problem, and use |neg_trie_op_size|.
begin h:=abs(n+313*d+361*v+1009*cur_lang) mod (trie_op_size+trie_op_size)
- trie_op_size;
@y
@@ -3033,7 +3041,7 @@ begin h:=abs(n+313*d+361*v+1009*cur_lang) mod (trie_op_size-neg_trie_op_size)
+ neg_trie_op_size;
@z
-@x [43.944] l.18377 - bigtrie: And larger tries again.
+@x [43.944] l.18432 - bigtrie: And larger tries again.
if u=max_quarterword then
overflow("pattern memory ops per language",
max_quarterword-min_quarterword);
@@ -3046,26 +3054,26 @@ begin h:=abs(n+313*d+361*v+1009*cur_lang) mod (trie_op_size-neg_trie_op_size)
if u>max_op_used then max_op_used:=u;
@z
-@x [43.945] l.18399 - bigtrie: And larger tries again.
+@x [43.945] l.18454 - bigtrie: And larger tries again.
op_start[0]:=-min_quarterword;
@y
op_start[0]:=-min_trie_op;
@z
-@x [43.946] l.18416 - bigtrie: And larger tries again.
+@x [43.946] l.18471 - bigtrie: And larger tries again.
for k:=0 to 255 do trie_used[k]:=min_quarterword;
@y
for k:=0 to 255 do trie_used[k]:=min_trie_op;
@z
-@x [43.946] l.18417 - Dynamic trie arrays.
+@x [43.946] l.18472 - Dynamic trie arrays.
trie_op_ptr:=0;
@y
max_op_used:=min_trie_op;
trie_op_ptr:=0;
@z
-@x [43.947] l.18438 - Dynamically allocate arrays, and a casting problem.
+@x [43.947] l.18493 - Dynamically allocate arrays, and a casting problem.
@!init @!trie_c:packed array[trie_pointer] of packed_ASCII_code;
{characters to match}
@t\hskip10pt@>@!trie_o:packed array[trie_pointer] of quarterword;
@@ -3093,13 +3101,13 @@ tini
tini
@z
-@x [43.950] l.18521 - Dynamically allocate & larger tries.
+@x [43.950] l.18576 - Dynamically allocate & larger tries.
@d trie_back(#)==trie[#].lh {backward links in |trie| holes}
@y
@d trie_back(#)==trie_tro[#] {use the opcode field now for backward links}
@z
-@x [43.590] l.18524 - Dynamically allocate & larger tries.
+@x [43.950] l.18579 - Dynamically allocate & larger tries.
@!init @!trie_taken:packed array[1..trie_size] of boolean;
{does a family start here?}
@t\hskip10pt@>@!trie_min:array[ASCII_code] of trie_pointer;
@@ -3117,13 +3125,13 @@ tini
tini
@z
-@x [43.951] l.18539 - Dynamically allocate.
+@x [43.951] l.18594 - Dynamically allocate.
trie_not_ready:=true; trie_root:=0; trie_c[0]:=si(0); trie_ptr:=0;
@y
trie_not_ready:=true;
@z
-@x [43.958] l.18634 - bigtrie: Larger tries.
+@x [43.958] l.18689 - bigtrie: Larger tries.
@<Move the data into |trie|@>=
h.rh:=0; h.b0:=min_quarterword; h.b1:=min_quarterword; {|trie_link:=0|,
|trie_op:=min_quarterword|, |trie_char:=qi(0)|}
@@ -3137,43 +3145,43 @@ h.rh:=0; h.b0:=min_quarterword; h.b1:=min_quarterword; {|trie_link:=0|,
@<Move the data into |trie|@>=
@z
-@x [43.958] l.18638 - bigtrie: Larger tries.
+@x [43.958] l.18693 - bigtrie: Larger tries.
begin for r:=0 to 256 do trie[r]:=h;
@y
begin for r:=0 to 256 do clear_trie;
@z
-@x [43.958] l.18643 - bigtrie: Larger tries.
+@x [43.958] l.18698 - bigtrie: Larger tries.
repeat s:=trie_link(r); trie[r]:=h; r:=s;
@y
repeat s:=trie_link(r); clear_trie; r:=s;
@z
-@x [43.960] l.18677 - bigtrie: Larger tries.
+@x [43.960] l.18732 - bigtrie: Larger tries.
@!v:quarterword; {trie op code}
@y
@!v:trie_opcode; {trie op code}
@z
-@x [43.963] l.18749 - bigtrie: Larger tries.
+@x [43.963] l.18804 - bigtrie: Larger tries.
if trie_o[q]<>min_quarterword then
@y
if trie_o[q]<>min_trie_op then
@z
-@x [43.964] l.18762 - bigtrie: Larger tries.
+@x [43.964] l.18817 - bigtrie: Larger tries.
trie_c[p]:=si(c); trie_o[p]:=min_quarterword;
@y
trie_c[p]:=si(c); trie_o[p]:=min_trie_op;
@z
-@x [43.965] l.18768 - bigtrie: Larger tries.
+@x [43.965] l.18823 - bigtrie: Larger tries.
l:=k; v:=min_quarterword;
@y
l:=k; v:=min_trie_op;
@z
-@x [43.966] l.18786 - bigtrie: Larger tries.
+@x [43.966] l.18841 - bigtrie: Larger tries.
@!h:two_halves; {template used to zero out |trie|'s holes}
@y
@z
@@ -3207,7 +3215,7 @@ l:=k; v:=min_trie_op;
% main_loop_move_lig,
%@z
-@x [46.1034] l.20074 - source specials
+@x [46.1034] l.20132 - source specials
@<Append character |cur_chr|...@>=
@y
@<Append character |cur_chr|...@>=
@@ -3216,7 +3224,7 @@ if ((head=tail) and (mode>0)) then begin
end;
@z
-@x [46.1036] l.20138 - MLTeX: substitution in |main_control|
+@x [46.1036] l.20198 - MLTeX: substitution in |main_control|
main_loop_move+2:if(cur_chr<font_bc[main_f])or(cur_chr>font_ec[main_f]) then
@y
main_loop_move+2:
@@ -3224,13 +3232,13 @@ if(qo(effective_char(false,main_f,qi(cur_chr)))>font_ec[main_f])or
(qo(effective_char(false,main_f,qi(cur_chr)))<font_bc[main_f]) then
@z
-@x [46.1036] l.20141 - MLTeX: substitution in |main_control|
+@x [46.1036] l.20201 - MLTeX: substitution in |main_control|
main_i:=char_info(main_f)(cur_l);
@y
main_i:=effective_char_info(main_f,cur_l);
@z
-@x [46.1049] l.20407 - i18n fix, see change to [16.211]
+@x [46.1049] l.20440
print("' in "); print_mode(mode);
@y
print_in_mode(mode);
@@ -3252,7 +3260,7 @@ print_in_mode(mode);
if every_hbox<>null then begin_token_list(every_hbox,every_hbox_text);
@z
-@x [47.1091] l.21064 - source specials
+@x [47.1091] l.21124 - source specials
if indented then
begin tail:=new_null_box; link(head):=tail; width(tail):=par_indent;@+
end;
@@ -3273,7 +3281,7 @@ if indented then
end;
@z
-@x [48.1142] l.21697 - source specials
+@x [48.1139] l.21722 - source specials
if every_math<>null then begin_token_list(every_math,every_math_text);
@y
if (insert_src_special_every_math) then insert_src_special;
@@ -3288,28 +3296,28 @@ if (insert_src_special_every_display) then append_src_special;
if every_display<>null then begin_token_list(every_display,every_display_text);
@z
-@x [48.1167] l.22042 - source specials
+@x [48.1167] l.22114 - source specials
if every_vbox<>null then begin_token_list(every_vbox,every_vbox_text);
@y
if (insert_src_special_every_vbox) then insert_src_special;
if every_vbox<>null then begin_token_list(every_vbox,every_vbox_text);
@z
-@x [49.1215] l.22719 - hash_extra
+@x [49.1215] l.22793 - hash_extra
if (cur_cs=0)or(cur_cs>frozen_control_sequence) then
@y
if (cur_cs=0)or(cur_cs>eqtb_top)or
((cur_cs>frozen_control_sequence)and(cur_cs<=eqtb_size)) then
@z
-@x [49.1222] l.22794 - MLTeX: \charsubdef primitive
+@x [49.1222] l.22869 - MLTeX: \charsubdef primitive
@d toks_def_code=6 {|shorthand_def| for \.{\\toksdef}}
@y
@d toks_def_code=6 {|shorthand_def| for \.{\\toksdef}}
@d char_sub_def_code=7 {|shorthand_def| for \.{\\charsubdef}}
@z
-@x [49.1222] l.22810 - MLTeX: \charsubdef primitive
+@x [49.1222] l.22885 - MLTeX: \charsubdef primitive
@!@:toks_def_}{\.{\\toksdef} primitive@>
@y
@!@:toks_def_}{\.{\\toksdef} primitive@>
@@ -3320,14 +3328,14 @@ if mltex_p then
end;
@z
-@x [49.1222] l.22820 - MLTeX: \charsubdef primitive
+@x [49.1223] l.22895 - MLTeX: \charsubdef primitive
othercases print_esc("toksdef")
@y
char_sub_def_code: print_esc("charsubdef");
othercases print_esc("toksdef")
@z
-@x [49.1222] l.22833 - MLTeX: \charsubdef primitive
+@x [49.1224] l.22908 - MLTeX: \charsubdef primitive
shorthand_def: begin n:=cur_chr; get_r_token; p:=cur_cs; define(p,relax,256);
@y
shorthand_def: if cur_chr=char_sub_def_code then
@@ -3350,9 +3358,9 @@ shorthand_def: if cur_chr=char_sub_def_code then
else begin n:=cur_chr; get_r_token; p:=cur_cs; define(p,relax,256);
@z
-@x [49.1252] l.23230 - INI = VIR, so have to do runtime test.
+@x [49.1252] l.23309 - INI = VIR, so have to do runtime test.
begin @!init new_patterns; goto done;@;@+tini@/
-@y 23215
+@y
begin @!Init new_patterns; goto done;@;@+Tini@/
@z
@@ -3360,11 +3368,11 @@ else begin n:=cur_chr; get_r_token; p:=cur_cs; define(p,relax,256);
% a) the string is already replaced in |scan_file_name| and therefore
% b) the wrong string will get flushed!!!
%
-@x [49.1257] l.23328 unused variable
+@x [49.1257] l.23354 - unused variable
@!flushable_string:str_number; {string not yet referenced}
@y
@z
-@x [49.1260] l.23383 new_font: string recycling -- already done
+@x [49.1260] l.23409 - new_font: string recycling -- already done
flushable_string:=str_ptr-1;
@y
@z
@@ -3383,7 +3391,7 @@ flushable_string:=str_ptr-1;
%
% otherwise the wrong string will get removed by |flush_string|!!
%
-@x [49.1260] l.23386 new_font: string recycling -- already done
+@x [49.1260] l.23412 - new_font: string recycling -- already done
begin if cur_name=flushable_string then
begin flush_string; cur_name:=font_name[f];
end;
@@ -3392,7 +3400,7 @@ flushable_string:=str_ptr-1;
begin if s>0 then
@z
-@x [49.1265] if batchmode, mktex... scripts should be silent.
+@x [49.1265] l.23454 - if batchmode, mktex... scripts should be silent.
interaction:=cur_chr;
@y
interaction:=cur_chr;
@@ -3401,7 +3409,7 @@ then kpse_make_tex_discard_errors := 1
else kpse_make_tex_discard_errors := 0;
@z
-@x [49.1275] l.23441 - Same stuff as for \input, this time for \openin.
+@x [49.1275] l.23519 - Same stuff as for \input, this time for \openin.
if cur_ext="" then cur_ext:=".tex";
pack_cur_name;
if a_open_in(read_file[n]) then read_open[n]:=just_open;
@@ -3413,7 +3421,7 @@ else kpse_make_tex_discard_errors := 0;
read_open[n]:=just_open;
@z
-@x [50.1301] l.23679 - INI = VIR, so runtime test.
+@x [50.1301] l.23760 - INI = VIR, so runtime test.
format_ident:=" (INITEX)";
@y
if ini_version then format_ident:=" (INITEX)";
@@ -3421,14 +3429,14 @@ if ini_version then format_ident:=" (INITEX)";
% Eliminate now-unused variable `w' in `store_fmt_file'.
% Add format_engine.
-@x [50.1302] l.23690 - store_fmt_file
+@x [50.1302] l.23768 - store_fmt_file
@!w: four_quarters; {four ASCII codes}
@y
@!format_engine: ^text_char;
@z
% MLTeX: dump |mltex_p| to fmt file
-@x [50.1302] l.23694
+@x [50.1302] l.23772
@<Dump constants for consistency check@>;
@y
@<Dump constants for consistency check@>;
@@ -3438,7 +3446,7 @@ if ini_version then format_ident:=" (INITEX)";
% Eliminate now-unused variable `w' in `load_fmt_file'.
% Add format_engine.
% Add dummies for undumping |xord|, |xchr|, and |xprn| into the void.
-@x [50.1303] l.23722 - load_fmt_file
+@x [50.1303] l.23800 - load_fmt_file
@!w: four_quarters; {four ASCII codes}
@y
@!format_engine: ^text_char;
@@ -3448,28 +3456,28 @@ if ini_version then format_ident:=" (INITEX)";
@z
% MLTeX: undump |mltex_enabled_p| from fmt file
-@x [50.1303] l.23694
+@x [50.1303] l.23801
begin @<Undump constants for consistency check@>;
@y
begin @<Undump constants for consistency check@>;
@<Undump ML\TeX-specific data@>;
@z
-@x [50.1305] l.23751 - Do dumping and undumping of fmt files in C.
+@x [50.1305] l.23829 - Do dumping and undumping of fmt files in C.
@d dump_wd(#)==begin fmt_file^:=#; put(fmt_file);@+end
@d dump_int(#)==begin fmt_file^.int:=#; put(fmt_file);@+end
@d dump_hh(#)==begin fmt_file^.hh:=#; put(fmt_file);@+end
@d dump_qqqq(#)==begin fmt_file^.qqqq:=#; put(fmt_file);@+end
@y
@z
-@x [1306]
+@x [50.1306] l.23843
@d undump_wd(#)==begin get(fmt_file); #:=fmt_file^;@+end
@d undump_int(#)==begin get(fmt_file); #:=fmt_file^.int;@+end
@d undump_hh(#)==begin get(fmt_file); #:=fmt_file^.hh;@+end
@d undump_qqqq(#)==begin get(fmt_file); #:=fmt_file^.qqqq;@+end
@y
@z
-@x [still 1306] debug format file
+@x [50.1306] l.23850 - debug format file
@d undump_size_end_end(#)==too_small(#)@+else undump_end_end
@y
@d format_debug_end(#)==
@@ -3483,7 +3491,7 @@ begin @<Undump constants for consistency check@>;
too_small(#)@+else format_debug (#)(x); undump_end_end
@z
-@x [50,1307] l.23779 - texarray
+@x [50.1307] l.23859 - texarray
dump_int(@$);@/
@y
dump_int(@"57325458); {Web2C \TeX's magic constant: "W2TX"}
@@ -3502,13 +3510,13 @@ dump_int(hash_high);
@z
%%%%%%%% dynamic hyph_size
-@x 23784 m.1307
+@x [50.1307] l.23864
dump_int(hyph_size)
-@y 23784
+@y
dump_int(hyph_prime)
@z
-@x [50.1308] l.23793 - texarray
+@x [50.1308] l.23873 - texarray
x:=fmt_file^.int;
if x<>@$ then goto bad_fmt; {check that strings are the same}
@y
@@ -3563,7 +3571,7 @@ undump_int(hash_high);
eqtb[x]:=eqtb[undefined_control_sequence];
@z
-@x [50.1308] l.23795 - texarray
+@x [50.1308] l.23875 - texarray
undump_int(x);
if x<>mem_bot then goto bad_fmt;
undump_int(x);
@@ -3587,15 +3595,15 @@ mem := zmem;
@z
%%%%%%%% dynamic hyph_size
-@x 23804 m.1308
+@x [50.1308] l.23884
if x<>hyph_size then goto bad_fmt
-@y 23804
+@y
if x<>hyph_prime then goto bad_fmt
@z
% [1309] Make dumping/undumping more efficient by doing whole arrays at
% a time, via fread/fwrite in texmfmp.c.
-@x [50.1309] l.23814 - Make dumping/undumping more efficient.
+@x [50.1309] l.23894 - Make dumping/undumping more efficient.
for k:=0 to str_ptr do dump_int(str_start[k]);
k:=0;
while k+4<pool_ptr do
@@ -3607,7 +3615,7 @@ dump_things(str_start[0], str_ptr+1);
dump_things(str_pool[0], pool_ptr);
@z
-@x [50.1310] l.23829 - Make dumping/undumping more efficient.
+@x [50.1310] l.23909 - Make dumping/undumping more efficient.
undump_size(0)(pool_size)('string pool size')(pool_ptr);
undump_size(0)(max_strings)('max strings')(str_ptr);
for k:=0 to str_ptr do undump(0)(pool_ptr)(str_start[k]);
@@ -3629,31 +3637,31 @@ str_pool:=xmalloc_array(packed_ASCII_code, pool_size);
undump_things(str_pool[0], pool_ptr);
@z
-@x [50.1311] l.23850 - Make dumping/undumping more efficient.
+@x [50.1311] l.23930 - Make dumping/undumping more efficient.
repeat for k:=p to q+1 do dump_wd(mem[k]);
@y
repeat dump_things(mem[p], q+2-p);
@z
-@x [50.1311] l.23855 - Make dumping/undumping more efficient.
+@x [50.1311] l.23935 - Make dumping/undumping more efficient.
for k:=p to lo_mem_max do dump_wd(mem[k]);
@y
dump_things(mem[p], lo_mem_max+1-p);
@z
-@x [50.1311] l.23858 - Make dumping/undumping more efficient.
+@x [50.1311] l.23938 - Make dumping/undumping more efficient.
for k:=hi_mem_min to mem_end do dump_wd(mem[k]);
@y
dump_things(mem[hi_mem_min], mem_end+1-hi_mem_min);
@z
-@x [50.1312] l.23873 - Make dumping/undumping more efficient.
+@x [50.1312] l.23953 - Make dumping/undumping more efficient.
repeat for k:=p to q+1 do undump_wd(mem[k]);
@y
repeat undump_things(mem[p], q+2-p);
@z
-@x [50.1312] l.23955 - Check that p did not become corrupt.
+@x [50.1312] l.23954 - Check that p did not become corrupt.
p:=q+node_size(q);
if (p>lo_mem_max)or((q>=rlink(q))and(rlink(q)<>rover)) then goto bad_fmt;
@y
@@ -3669,19 +3677,19 @@ then goto bad_fmt;
p:=q+node_size(q);
@z
-@x [50.1312] l.23878 - Make dumping/undumping more efficient.
+@x [50.1312] l.23958 - Make dumping/undumping more efficient.
for k:=p to lo_mem_max do undump_wd(mem[k]);
@y
undump_things(mem[p], lo_mem_max+1-p);
@z
-@x [50.1312] l.23888 - Make dumping/undumping more efficient.
+@x [50.1312] l.23968 - Make dumping/undumping more efficient.
for k:=hi_mem_min to mem_end do undump_wd(mem[k]);
@y
undump_things (mem[hi_mem_min], mem_end+1-hi_mem_min);
@z
-@x [50.1314] l.23899 - hash_extra, source specials
+@x [50.1314] l.23979 - hash_extra, source specials
undump(hash_base)(frozen_control_sequence)(par_loc);
par_token:=cs_token_flag+par_loc;@/
undump(hash_base)(frozen_control_sequence)(write_loc);@/
@@ -3691,7 +3699,7 @@ par_token:=cs_token_flag+par_loc;@/
undump(hash_base)(hash_top)(write_loc);@/
@z
-@x [50.1315] l.23925 - Make dumping/undumping more efficient - eqtb
+@x [50.1315] l.24005 - Make dumping/undumping more efficienteqtb
while k<l do
begin dump_wd(eqtb[k]); incr(k);
end;
@@ -3699,7 +3707,7 @@ while k<l do
dump_things(eqtb[k], l-k);
@z
-@x [50.1316] l.23944 - Make dumping/undumping more efficient - eqtb
+@x [50.1316] l.24024 - Make dumping/undumping more efficienteqtb
while k<l do
begin dump_wd(eqtb[k]); incr(k);
end;
@@ -3707,7 +3715,7 @@ while k<l do
dump_things(eqtb[k], l-k);
@z
-@x [50.1316] l.23947 - hash_extra
+@x [50.1316] l.24027 - hash_extra
k:=j+1; dump_int(k-l);
until k>eqtb_size
@y
@@ -3717,13 +3725,13 @@ if hash_high>0 then dump_things(eqtb[eqtb_size+1],hash_high);
{dump |hash_extra| part}
@z
-@x [50.1317] l.23958 - Make dumping/undumping more efficient - eqtb
+@x [50.1317] l.24034 - Make dumping/undumping more efficienteqtb
for j:=k to k+x-1 do undump_wd(eqtb[j]);
@y
undump_things(eqtb[k], x);
@z
-@x [50.1317] l.23960 - hash_extra
+@x [50.1317] l.24040 - hash_extra
until k>eqtb_size
@y
until k>eqtb_size;
@@ -3731,20 +3739,20 @@ if hash_high>0 then undump_things(eqtb[eqtb_size+1],hash_high);
{undump |hash_extra| part}
@z
-@x [50.1318] l.23968 - hash_extra
+@x [50.1318] l.24048 - hash_extra
dump_int(hash_used); cs_count:=frozen_control_sequence-1-hash_used;
-@y 23968
+@y
dump_int(hash_used); cs_count:=frozen_control_sequence-1-hash_used+hash_high;
@z
-@x [50.1318] l.23972 - Make dumping/undumping more efficient, hash_extra
+@x [50.1318] l.24052 - Make dumping/undumping more efficient, hash_extra
for p:=hash_used+1 to undefined_control_sequence-1 do dump_hh(hash[p]);
@y
dump_things(hash[hash_used+1], undefined_control_sequence-1-hash_used);
if hash_high>0 then dump_things(hash[eqtb_size+1], hash_high);
@z
-@x [50.1319] l.23980 - Make dumping/undumping more efficient, hash_extra
+@x [50.1319] l.24060 - Make dumping/undumping more efficient, hash_extra
for p:=hash_used+1 to undefined_control_sequence-1 do undump_hh(hash[p]);
@y
undump_things (hash[hash_used+1], undefined_control_sequence-1-hash_used);
@@ -3759,7 +3767,7 @@ if hash_high > 0 then begin
end;
@z
-@x [50.1320] l.23985 - Make dumping/undumping more efficient - tfm
+@x [50.1320] l.24065 - Make dumping/undumping more efficienttfm
for k:=0 to fmem_ptr-1 do dump_wd(font_info[k]);
dump_int(font_ptr);
for k:=null_font to font_ptr do
@@ -3770,7 +3778,7 @@ dump_int(font_ptr);
@<Dump the array info for internal font number |k|@>;
@z
-@x [50.1320] l.23991 - i18n fix
+@x [50.1320] l.24070 - i18n fix
print_int(font_ptr-font_base); print(" preloaded font");
if font_ptr<>font_base+1 then print_char("s")
@y
@@ -3779,7 +3787,7 @@ if font_ptr<>font_base+1 then print(" preloaded fonts")
else print(" preloaded font")
@z
-@x [50.1321] l.23994 - texarray
+@x [50.1321] l.24074 - texarray
undump_size(7)(font_mem_size)('font mem size')(fmem_ptr);
for k:=0 to fmem_ptr-1 do undump_wd(font_info[k]);
undump_size(font_base)(font_max)('font max')(font_ptr);
@@ -3800,7 +3808,7 @@ undump_size(font_base)(font_base+max_font_max)('font max')(font_ptr);
% in the same section of the fmt file. But it's a lot faster to
% write the arrays of information out, one whole array at a time.
% So that's the way we handle dumping and undumping font info.
-@x [50.1322] l.24000 - Make dumping/undumping more efficient - tfm
+@x [50.1322] l.24080 - Make dumping/undumping more efficienttfm
@ @<Dump the array info for internal font number |k|@>=
begin dump_qqqq(font_check[k]);
dump_int(font_size[k]);
@@ -3867,7 +3875,7 @@ for k:=null_font to font_ptr do
end
@z
-@x [50.1322] l.24031 - Make dumping/undumping more efficient - tfm
+@x [50.1323] l.24111 - Make dumping/undumping more efficienttfm
@ @<Undump the array info for internal font number |k|@>=
begin undump_qqqq(font_check[k]);@/
undump_int(font_size[k]);
@@ -3957,12 +3965,12 @@ end
@z
%%%%%%%% dynamic hyph_size
-@x 24058 m.1324
+@x [50.1324] l.24138
dump_int(hyph_count);
for k:=0 to hyph_size do if hyph_word[k]<>0 then
begin dump_int(k); dump_int(hyph_word[k]); dump_int(hyph_list[k]);
end;
-@y 24061
+@y
dump_int(hyph_count);
if hyph_next <= hyph_prime then hyph_next:=hyph_size;
dump_int(hyph_next);{minimum value of |hyphen_size| needed}
@@ -3973,7 +3981,7 @@ for k:=0 to hyph_size do if hyph_word[k]<>0 then
end;
@z
-@x [50.1324] l.24063 - i18n fix
+@x [50.1324] l.24142 - i18n fix
print_ln; print_int(hyph_count); print(" hyphenation exception");
if hyph_count<>1 then print_char("s");
@y
@@ -3982,7 +3990,7 @@ if hyph_count<>1 then print(" hyphenation exceptions")
else print(" hyphenation exception");
@z
-@x [50.1324] l.24066 - Make dumping/undumping more efficient - trie
+@x [50.1324] l.24146 - Make dumping/undumping more efficienttrie
for k:=0 to trie_max do dump_hh(trie[k]);
@y
dump_things(trie_trl[0], trie_max+1);
@@ -3990,7 +3998,7 @@ dump_things(trie_tro[0], trie_max+1);
dump_things(trie_trc[0], trie_max+1);
@z
-@x [50.1324] l.24068 - Make dumping/undumping more efficient - trie
+@x [50.1324] l.24148 - Make dumping/undumping more efficienttrie
for k:=1 to trie_op_ptr do
begin dump_int(hyf_distance[k]);
dump_int(hyf_num[k]);
@@ -4002,7 +4010,7 @@ dump_things(hyf_num[1], trie_op_ptr);
dump_things(hyf_next[1], trie_op_ptr);
@z
-@x [50.1324] l.24076 - i18n fix
+@x [50.1324] l.24155 - i18n fix
print(" has "); print_int(trie_op_ptr); print(" op");
if trie_op_ptr<>1 then print_char("s");
@y
@@ -4012,14 +4020,14 @@ else print(" op");
@z
%%%%%%%% dynamic hyph_size
-@x 24087 m.1325
+@x [50.1325] l.24167
undump(0)(hyph_size)(hyph_count);
for k:=1 to hyph_count do
begin undump(0)(hyph_size)(j);
undump(0)(str_ptr)(hyph_word[j]);
undump(min_halfword)(max_halfword)(hyph_list[j]);
end;
-@y 24092
+@y
undump_size(0)(hyph_size)('hyph_size')(hyph_count);
undump_size(hyph_prime)(hyph_size)('hyph_size')(hyph_next);
j:=0;
@@ -4041,7 +4049,7 @@ for k:=1 to hyph_count do
if hyph_next >= hyph_prime then incr(hyph_next);
@z
-@x [50.1325] l.24094 - Make dumping/undumping more efficient - trie
+@x [50.1325] l.24174 - Make dumping/undumping more efficienttrie
for k:=0 to j do undump_hh(trie[k]);
@y
{These first three haven't been allocated yet unless we're \.{INITEX};
@@ -4054,7 +4062,7 @@ if not trie_trc then trie_trc:=xmalloc_array(quarterword, j+1);
undump_things(trie_trc[0], j+1);
@z
-@x [50.1325] l.24096 - Make dumping/undumping more efficient - trie
+@x [50.1325] l.24176 - Make dumping/undumping more efficienttrie
for k:=1 to j do
begin undump(0)(63)(hyf_distance[k]); {a |small_number|}
undump(0)(63)(hyf_num[k]);
@@ -4068,20 +4076,20 @@ undump_things(hyf_num[1], j);
undump_upper_check_things(max_trie_op, hyf_next[1], j);
@z
-@x [50.1327] l.24117 - Allow command line to override dumped value.
+@x [50.1327] l.24197 - Allow command line to override dumped value.
undump(batch_mode)(error_stop_mode)(interaction);
@y
undump(batch_mode)(error_stop_mode)(interaction);
if interaction_option<>unspecified_mode then interaction:=interaction_option;
@z
-@x [50.1327] l.24172 - Test for end-of-file already done by undump.
+@x [50.1327] l.24200 - Test for end-of-file already done by undump.
if (x<>69069)or eof(fmt_file) then goto bad_fmt
@y
if x<>69069 then goto bad_fmt
@z
-@x [51.1332] l.24203 - make the main program a procedure, for eqtb hack.
+@x [51.1332] l.24283 - make the main program a procedure, for eqtb hack.
@p begin @!{|start_here|}
@y
@d const_chk(#)==begin if # < inf@&# then # := inf@&# else
@@ -4196,7 +4204,7 @@ begin @!{|start_here|}
@+Tini
@z
-@x [51.1332] l.24215 - INI = VIR, so pool init needs runtime test
+@x [51.1332] l.24295 - INI = VIR, so pool init needs runtime test
@!init if not get_strings_started then goto final_end;
init_prim; {call |primitive| for each primitive}
init_str_ptr:=str_ptr; init_pool_ptr:=pool_ptr; fix_date_and_time;
@@ -4208,7 +4216,7 @@ init_str_ptr:=str_ptr; init_pool_ptr:=pool_ptr; fix_date_and_time;
Tini@/
@z
-@x [51.1332] l.24225 - main
+@x [51.1332] l.24305 - main
end_of_TEX: close_files_and_terminate;
final_end: ready_already:=0;
end.
@@ -4218,7 +4226,7 @@ final_end: do_final_end;
end {|main_body|};
@z
-@x [51.1333] l.24254 - Print new line before termination; switch to editor if necessary.
+@x [51.1333] l.24334 - Print new line before termination; switch to editor if necessary.
slow_print(log_name); print_char(".");
end;
end;
@@ -4231,42 +4239,42 @@ if (edit_name_start<>0) and (interaction>batch_mode) then
call_edit(str_pool,edit_name_start,edit_name_length,edit_line);
@z
-@x [51.1334] l.24275 - hash_extra
+@x [51.1334] l.24355 - hash_extra
wlog_ln(' ',cs_count:1,' multiletter control sequences out of ',
hash_size:1);@/
-@y 24276
+@y
wlog_ln(' ',cs_count:1,' multiletter control sequences out of ',
hash_size:1, '+', hash_extra:1);@/
@z
-@x [51.1335] l.24335 - Only do dump if ini.
+@x [51.1335] l.24415 - Only do dump if ini.
begin @!init for c:=top_mark_code to split_bot_mark_code do
@y
begin @!Init for c:=top_mark_code to split_bot_mark_code do
@z
-@x [51.1335] l.24337 - Only do dump if ini.
+@x [51.1335] l.24418 - Only do dump if ini.
store_fmt_file; return;@+tini@/
@y
store_fmt_file; return;@+Tini@/
@z
-@x [51.1337] l.24361 - Handle %&format in all cases.
+@x [51.1337] l.24441 - Handle %&format in all cases.
if (format_ident=0)or(buffer[loc]="&") then
@y
if (format_ident=0)or(buffer[loc]="&")or dump_line then
@z
-@x [51.1337] l.24366 - Dynamic arrays size.
+@x [51.1337] l.24447 - Dynamic arrays size.
w_close(fmt_file);
@y
w_close(fmt_file);
eqtb:=zeqtb;
@z
-%% [51] m.1337 l.24371 - MLTeX: add. MLTeX banner after loading fmt file
+%% [51.1337] l.24371 - MLTeX: add. MLTeX banner after loading fmt file
%% (MLTeX change: only "if mltex_enabled_p then ....;")
-@x [51.1337] l.24371 - Allocate hyphenation tries, do char translation, MLTeX
+@x [51.1337] l.24452 - Allocate hyphenation tries, do char translation, MLTeX
fix_date_and_time;@/
@y
if mltex_enabled_p then
@@ -4339,7 +4347,7 @@ if trie_not_ready then begin {initex without format loaded}
% not possible to portably switch into the debugger while a program is
% running. The best approximation is to do a core dump, then run the
% debugger on it later.
-@x [52.1338] l.24411 - Core-dump in debugging mode on 0 input.
+@x [52.1338] l.24493 - Core-dump in debugging mode on 0 input.
begin goto breakpoint;@/ {go to every declared label at least once}
breakpoint: m:=0; @{'BREAKPOINT'@}@/
end
@@ -4347,9 +4355,9 @@ if trie_not_ready then begin {initex without format loaded}
dump_core {do something to cause a core dump}
@z
-@x [52.1339] l.24429 - debug - print tfm info
+@x [52.1339] l.24511 - debugprint tfm info
5: print_word(font_info[n]);
-@y 24397
+@y
5: begin print_scaled(font_info[n].sc); print_char(" ");@/
print_int(font_info[n].qqqq.b0); print_char(":");@/
print_int(font_info[n].qqqq.b1); print_char(":");@/
@@ -4358,14 +4366,14 @@ if trie_not_ready then begin {initex without format loaded}
end;
@z
-@x [53.1344] l.24544 - source specials
+@x [53.1344] l.24624 - source specials
primitive("special",extension,special_node);@/
@y
primitive("special",extension,special_node);@/
text(frozen_special):="special"; eqtb[frozen_special]:=eqtb[cur_val];@/
@z
-@x [53.1348] (do_extension) Remove unused variables
+@x [53.1348] l.24657 - (do_extension) Remove unused variables
var i,@!j,@!k:integer; {all-purpose integers}
@!p,@!q,@!r:pointer; {all-purpose pointers}
@y
@@ -4377,13 +4385,13 @@ var k:integer; {all-purpose integers}
% refer to an actual file, though, so we don't need to change the
% write_file or write_open arrays. We provide for disabling this at
% runtime, for paranoids.
-@x [53.1350] l.24609 - system: Allow 18 as a \write stream.
+@x [53.1350] l.24691 - system: Allow 18 as a \write stream.
else if cur_val>15 then cur_val:=16;
@y
else if (cur_val>15) and (cur_val <> 18) then cur_val:=16;
@z
-@x [53.1370] l.24770 - \write18{foo}
+@x [53.1370] l.24852 - \write18{foo}
begin @<Expand macros in the token list
@y
@!d:integer; {number of characters in incomplete current string}
@@ -4392,7 +4400,7 @@ begin @<Expand macros in the token list
begin @<Expand macros in the token list
@z
-@x [53.1370] l.24773 - system: (write_out) \write18{foo} => system(foo).
+@x [53.1370] l.24855 - system: (write_out) \write18{foo} => system(foo).
if write_open[j] then selector:=j
@y
if j=18 then selector := new_string
@@ -4400,7 +4408,7 @@ else if write_open[j] then selector:=j
@z
% Then call system(3) on that string.
-@x [53.1370] l.24779 - system: (write_out) \write18{foo} => system(foo).
+@x [53.1370] l.24861 - system: (write_out) \write18{foo} => system(foo).
flush_list(def_ref); selector:=old_setting;
@y
flush_list(def_ref);
@@ -4447,7 +4455,7 @@ end;
selector:=old_setting;
@z
-@x [53.1373] Need new local.
+@x [53.1373] l.24902 - Need new local.
procedure out_what(@!p:pointer);
var j:small_number; {write stream number}
@y
@@ -4456,7 +4464,7 @@ var j:small_number; {write stream number}
@!old_setting:0..max_selector;
@z
-@x [53.1374]
+@x [53.1374] l.24923
else begin if write_open[j] then a_close(write_file[j]);
if subtype(p)=close_node then write_open[j]:=false
@y
@@ -4465,7 +4473,7 @@ var j:small_number; {write stream number}
if subtype(p)=close_node then do_nothing {already closed}
@z
-@x [still 53.1374] Disallow certain \openout filenames, and log results.
+@x [53.1374] l.24930 - Disallow certain \openout filenames, and log results.
while not a_open_out(write_file[j]) do
prompt_file_name("output file name",".tex");
write_open[j]:=true;
@@ -4489,7 +4497,7 @@ var j:small_number; {write stream number}
end;
@z
-@x [54.1376] l.24903 - Add editor-switch variables to globals.
+@x [54.1379] l.24985 - Add editor-switch variables to globals.
@* \[54] System-dependent changes.
This section should be replaced, if necessary, by any special
modifications of the program
@@ -5021,7 +5029,7 @@ if x=1 then mltex_enabled_p:=true
else if x<>0 then goto bad_fmt;
@z
-@x [54.1379] l.24916 - extra routines
+@x [54.1379] l.24996 - extra routines
@* \[55] Index.
@y
diff --git a/Build/source/texk/web2c/tftopl.ch b/Build/source/texk/web2c/tftopl.ch
index 4726146a097..973537d531f 100644
--- a/Build/source/texk/web2c/tftopl.ch
+++ b/Build/source/texk/web2c/tftopl.ch
@@ -75,7 +75,7 @@ procedure initialize; {this procedure gets things started properly}
@y
@z
-@x [5] Increase sizes to match vptovf.
+@x [4] Increase sizes to match vptovf.
@!tfm_size=30000; {maximum length of |tfm| data, in bytes}
@!lig_size=5000; {maximum length of |lig_kern| program, in words}
@!hash_size=5003; {preferably a prime number, a bit larger than the number
diff --git a/Build/source/texk/web2c/tiedir/tie-w2c.ch b/Build/source/texk/web2c/tiedir/tie-w2c.ch
index 61b4e904167..fb09e05060f 100644
--- a/Build/source/texk/web2c/tiedir/tie-w2c.ch
+++ b/Build/source/texk/web2c/tiedir/tie-w2c.ch
@@ -110,8 +110,7 @@ Section 5
Section 6
-l.155
-@x -- replace preprocessor macros
+@x l.155 -- replace preprocessor macros
@d spotless 0
@d troublesome 1
@d fatal 2
@@ -302,7 +301,7 @@ Section 32
Section 33
-@x l.774
+@x l.771
@d jump_out() exit(1)
@y
@d jump_out() exit(EXIT_FAILURE)
diff --git a/Build/source/texk/web2c/unbalanced-braces.ch b/Build/source/texk/web2c/unbalanced-braces.ch
index 9cecdd465ef..29941e7e35a 100644
--- a/Build/source/texk/web2c/unbalanced-braces.ch
+++ b/Build/source/texk/web2c/unbalanced-braces.ch
@@ -6,8 +6,8 @@
% an \output or \write and ending up in all sorts of ill-defined
% trouble. (Including the case of \output=\toks with no braces.)
%
-% For some problematic input files, see tests/unbalanced-braces.test
-% (not a runnable test).
+% For some problematic input texts, see tests/unbalanced-braces.test
+% (not a runnable test). References to bug reports are also there.
%
% The idea is that when it's time to run/evaluate each \output or \write,
% they have to come to an end exactly as expected: at the right brace that
diff --git a/Build/source/texk/web2c/uptexdir/ChangeLog b/Build/source/texk/web2c/uptexdir/ChangeLog
index 5ca5f7b8b76..a68dbcce2f4 100644
--- a/Build/source/texk/web2c/uptexdir/ChangeLog
+++ b/Build/source/texk/web2c/uptexdir/ChangeLog
@@ -1,3 +1,20 @@
+2024-05-18 Hironori Kitagawa <h_kitagawa2001@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@t-lab.opal.ne.jp>
+
+ * uptex-m.ch: Fix unmatched begin-end grouping
+ from Yukimasa Morimi san:
+ https://github.com/texjporg/tex-jp-build/issues/46
+
+2024-05-01 TANAKA Takuji <ttk@t-lab.opal.ne.jp>
+
+ * uptex-m.ch: Revert some patches.
+
2024-04-27 TANAKA Takuji <ttk@t-lab.opal.ne.jp>
* uptex-m.ch, kanji.{c,h}, updvitype.ch, uptex.defines:
diff --git a/Build/source/texk/web2c/uptexdir/ptex-base.ch b/Build/source/texk/web2c/uptexdir/ptex-base.ch
index 3ed7b821e7b..6b77387d58e 100644
--- a/Build/source/texk/web2c/uptexdir/ptex-base.ch
+++ b/Build/source/texk/web2c/uptexdir/ptex-base.ch
@@ -2582,14 +2582,15 @@ if cur_tok<cs_token_flag then
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");
diff --git a/Build/source/texk/web2c/uptexdir/tests/ctlsym_num.tex b/Build/source/texk/web2c/uptexdir/tests/ctlsym_num.tex
new file mode 100644
index 00000000000..40f695b60b5
--- /dev/null
+++ b/Build/source/texk/web2c/uptexdir/tests/ctlsym_num.tex
@@ -0,0 +1,69 @@
+% Copyright 2024 Japanese TeX Development Community <issue@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
diff --git a/Build/source/texk/web2c/uptexdir/uptex-m.ch b/Build/source/texk/web2c/uptexdir/uptex-m.ch
index 8c0f662087c..f4b7c7272d9 100644
--- a/Build/source/texk/web2c/uptexdir/uptex-m.ch
+++ b/Build/source/texk/web2c/uptexdir/uptex-m.ch
@@ -48,7 +48,7 @@
% (2022-07-23) TTK upTeX u1.29
% (2022-12-09) HK Hironori Kitagawa fixed a bug in \char, \kchar.
% (2023-09-16) TTK upTeX u1.30
-% (2024-04-27) TTK upTeX u1.35
+% (2024-05-01) TTK upTeX u1.35
@x
\def\pTeX{p\kern-.15em\TeX}
@@ -581,13 +581,6 @@ if cat=other_kchar then k:=k-multilenbuffchar(cur_chr)+1; {now |k| points to fir
@z
@x
-@!j:0..buf_size; {index into |buffer|}
-@y
-@!j:0..buf_size; {index into |buffer|}
-@!v,@!nn,@!jj: integer;
-@z
-
-@x
if check_kanji(info(p)) then {|wchar_token|}
begin buffer[j]:=Hi(info(p)); buffer2[j]:=1; incr(j); buffer2[j]:=1;
end
@@ -595,31 +588,11 @@ if cat=other_kchar then k:=k-multilenbuffchar(cur_chr)+1; {now |k| points to fir
buffer[j]:=Lo(info(p)); incr(j); p:=link(p);
@y
if check_kanji(info(p)) then {|wchar_token|}
- begin
- if (isinternalUPTEX) then begin
- t:=ktokentochr(info(p));
- t:=toUCS(t);
- nn:=UVSgetcodepointlength(t);
- jj:=1;
- while jj<nn do begin
- v:=UVSgetcodepointinsequence(t,jj);
- if (v>0) then begin
- v:=UCStoUTF8(v);
- if BYTE1(v)<>0 then begin buffer[j]:=BYTE1(v); buffer2[j]:=1; incr(j); end;
- if BYTE2(v)<>0 then begin buffer[j]:=BYTE2(v); buffer2[j]:=1; incr(j); end;
- if BYTE3(v)<>0 then begin buffer[j]:=BYTE3(v); buffer2[j]:=1; incr(j); end;
- buffer[j]:=BYTE4(v); buffer2[j]:=1; incr(j);
- end;
- incr(jj);
- end
- end
- else begin
- t:=toBUFF(info(p) mod max_cjk_val);
- if BYTE1(t)<>0 then begin buffer[j]:=BYTE1(t); buffer2[j]:=1; incr(j); end;
- if BYTE2(t)<>0 then begin buffer[j]:=BYTE2(t); buffer2[j]:=1; incr(j); end;
- if BYTE3(t)<>0 then begin buffer[j]:=BYTE3(t); buffer2[j]:=1; incr(j); end;
- buffer[j]:=BYTE4(t); buffer2[j]:=1; incr(j);
- end;
+ begin t:=toBUFF(info(p) mod max_cjk_val);
+ if BYTE1(t)<>0 then begin buffer[j]:=BYTE1(t); buffer2[j]:=1; incr(j); end;
+ if BYTE2(t)<>0 then begin buffer[j]:=BYTE2(t); buffer2[j]:=1; incr(j); end;
+ if BYTE3(t)<>0 then begin buffer[j]:=BYTE3(t); buffer2[j]:=1; incr(j); end;
+ buffer[j]:=BYTE4(t); buffer2[j]:=1; incr(j);
p:=link(p);
end
else
@@ -1343,9 +1316,8 @@ begin if is_char_node(link(p)) then
ins_kp:=false;
goto again_2
end
- end
end;
- begin if not disp_called then
+ if not disp_called then
begin prev_node:=tail; tail_append(get_node(small_node_size));
type(tail):=disp_node; disp_dimen(tail):=0; disp_called:=true
end;
diff --git a/Build/source/texk/web2c/vftovp.ch b/Build/source/texk/web2c/vftovp.ch
index f972b51f148..bcb0020e2fb 100644
--- a/Build/source/texk/web2c/vftovp.ch
+++ b/Build/source/texk/web2c/vftovp.ch
@@ -122,8 +122,7 @@ end else begin
end;
@z
-% [22] `index' is not a good choice of identifier in C.
-@x
+@x [22] `index' is not a good choice of identifier in C.
@<Types...@>=
@!index=0..tfm_size; {address of a byte in |tfm|}
@y
@@ -142,8 +141,7 @@ end;
@!tfm_file_array: ^byte; {the input data all goes here}
@z
-% [24] abort() should cause a bad exit code.
-@x
+@x [24] abort() should cause a bad exit code.
@d abort(#)==begin print_ln(#);
print_ln('Sorry, but I can''t go on; are you sure this is a TFM?');
goto final_end;
@@ -162,8 +160,7 @@ if 4*lf-1>tfm_size then abort('The file is bigger than I can handle!');
tfm_file_array := xrealloc_array (tfm_file_array, byte, 4 * lf + 1000);
@z
-% [31] Ditto for vf_abort.
-@x
+@x [31] Ditto for vf_abort.
@d vf_abort(#)==
begin print_ln(#);
print_ln('Sorry, but I can''t go on; are you sure this is a VF?');
@@ -260,7 +257,7 @@ free(cur_name);
print_ln('Check sum in VF file being replaced by TFM check sum');
@z
-@x [42] Remove initialization of now-defunct array.
+@x [43] Remove initialization of now-defunct array.
@ @<Set init...@>=
default_directory:=default_directory_name;
@y
@@ -342,8 +339,7 @@ MBL_string:='MBL'; RI_string:='RI '; RCE_string:='RCE';
MBL_string:=' MBL'; RI_string:=' RI '; RCE_string:=' RCE';
@z
-% [60] How we output the character code depends on |charcode_format|.
-@x
+@x [60] How we output the character code depends on |charcode_format|.
begin if font_type>vanilla then
begin tfm[0]:=c; out_octal(0,1)
end
@@ -367,8 +363,7 @@ else begin tfm[0]:=c; out_octal(0,1);
end;
@z
-% [61] Don't output the face code as an integer.
-@x
+@x [61] Don't output the face code as an integer.
out(MBL_string[1+(b mod 3)]);
out(RI_string[1+s]);
out(RCE_string[1+(b div 3)]);
@@ -378,8 +373,7 @@ else begin tfm[0]:=c; out_octal(0,1);
put_byte(RCE_string[1+(b div 3)], vpl_file);
@z
-% [101] No progress reports unless verbose.
-@x
+@x [100] No progress reports unless verbose.
incr(chars_on_line);
end;
print_octal(c); {progress report}
@@ -389,8 +383,7 @@ else begin tfm[0]:=c; out_octal(0,1);
if verbose then print_octal(c); {progress report}
@z
-% [112] No nonlocal goto's.
-@x
+@x [112] No nonlocal goto's.
begin print_ln('Sorry, I haven''t room for so many ligature/kern pairs!');
@.Sorry, I haven't room...@>
goto final_end;
@@ -490,7 +483,7 @@ begin if o>=set1 then
end
@z
-@x [132] Eliminate the |final_end| and |exit| labels.
+@x [131] Eliminate the |final_end| and |exit| labels.
label final_end, exit;
@y
@z
@@ -515,7 +508,7 @@ organize:=vf_input;
end;
@z
-@x [134] Eliminate the |final_end| and |exit| labels.
+@x [133] Eliminate the |final_end| and |exit| labels.
label final_end,exit;
@y
@z
@@ -528,13 +521,13 @@ do_map:=true;
end;
@z
-@x [135] No final newline unless verbose.
+@x [134] No final newline unless verbose.
print_ln('.');@/
@y
if verbose then print_ln('.');@/
@z
-@x [136] System-dependent changes.
+@x [135] System-dependent changes.
This section should be replaced, if necessary, by changes to the program
that are necessary to make \.{VFtoVP} work at a particular installation.
It is usually best to design your change file so that all changes to
diff --git a/Build/source/texk/web2c/weave.ch b/Build/source/texk/web2c/weave.ch
index 3361efc5983..5a932e576ab 100644
--- a/Build/source/texk/web2c/weave.ch
+++ b/Build/source/texk/web2c/weave.ch
@@ -47,28 +47,28 @@
% 11/30/89 KB Version 4.
% (more recent changes in the ChangeLog)
-@x [0] WEAVE: print changes only
+@x [0.0] l.43 - WEAVE: print changes only
\def\title{WEAVE}
@y
\let\maybe=\iffalse
\def\title{WEAVE changes for C}
@z
-@x [1] Define my_name
+@x [1.1] l.77 - Define my_name
@d banner=='This is WEAVE, Version 4.5'
@y
@d my_name=='weave'
@d banner=='This is WEAVE, Version 4.5'
@z
-@x [2] No global labels, define and call parse_arguments.
+@x [1.2] l.85 - No global labels, define and call parse_arguments.
calls the `|jump_out|' procedure, which goes to the label |end_of_WEAVE|.
@d end_of_WEAVE = 9999 {go here to wrap it up}
@y
calls the `|jump_out|' procedure.
@z
-@x
+@x [1.2] l.91
label end_of_WEAVE; {go here to finish}
const @<Constants in the outer block@>@/
type @<Types in the outer block@>@/
@@ -91,7 +91,7 @@ procedure initialize;
@<Set initial values@>@/
@z
-@x [8] Increase constants for tex2pdf, etc.
+@x [1.8] l.186 - Increase constants for tex2pdf, etc.
@!max_bytes=45000; {|1/ww| times the number of bytes in identifiers,
index entries, and module names; must be less than 65536}
@!max_names=5000; {number of identifiers, index entries, and module names;
@@ -102,7 +102,7 @@ procedure initialize;
@!max_names=10239; {number of identifiers, index entries, and module names;
must be less than 10240}
@z
-@x
+@x [1.8] l.190
@!max_modules=2000;{greater than the total number of modules}
@!hash_size=353; {should be prime}
@!buf_size=100; {maximum length of input line}
@@ -117,7 +117,7 @@ procedure initialize;
@!long_buf_size=buf_size+longest_name; {C arithmetic in \PASCAL\ constant}
@!line_length=80; {lines of \TeX\ output have at most this many characters,
@z
-@x
+@x [1.8] l.197
@!max_refs=30000; {number of cross references; must be less than 65536}
@!max_toks=30000; {number of symbols in \PASCAL\ texts being parsed;
must be less than 65536}
@@ -135,17 +135,17 @@ procedure initialize;
@!stack_size=2000; {number of simultaneous output levels}
@z
-% [??] The text_char type is used as an array index into xord. The
+% [12] The text_char type is used as an array index into xord. The
% default type `char' produces signed integers, which are bad array
% indices in C.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-@x
+@x [2.12] l.307
@d text_char == char {the data type of characters in text files}
@y
@d text_char == ASCII_code {the data type of characters in text files}
@z
-@x [17] enable maximum character set
+@x [2.17] l.488 - enable maximum character set
for i:=1 to @'37 do xchr[i]:=' ';
for i:=@'200 to @'377 do xchr[i]:=' ';
@y
@@ -153,20 +153,20 @@ for i:=1 to @'37 do xchr[i]:=chr(i);
for i:=@'200 to @'377 do xchr[i]:=chr(i);
@z
-@x [20] Terminal I/O.
+@x [3.20] l.514 - Terminal I/O.
@d print(#)==write(term_out,#) {`|print|' means write on the terminal}
@y
@d term_out==stdout
@d print(#)==write(term_out,#) {`|print|' means write on the terminal}
@z
-@x
+@x [3.20] l.521
@<Globals...@>=
@!term_out:text_file; {the terminal as an output file}
@y
@z
-@x [21] Don't initialize the terminal.
+@x [3.21] l.524 - Don't initialize the terminal.
@ Different systems have different ways of specifying that the output on a
certain file will appear on the user's terminal. Here is one way to do this
on the \PASCAL\ system that was used in \.{TANGLE}'s initial development:
@@ -183,13 +183,13 @@ certain file will appear on the user's terminal.
{nothing need be done}
@z
-@x [22] `break' is `fflush'.
+@x [3.22] l.537 - `break' is `fflush'.
@d update_terminal == break(term_out) {empty the terminal output buffer}
@y
@d update_terminal == fflush(term_out) {empty the terminal output buffer}
@z
-@x [24] Open input files.
+@x [3.24] l.546 - Open input files.
@ The following code opens the input files. Since these files were listed
in the program header, we assume that the \PASCAL\ runtime system has
already checked that suitable file names have been given; therefore no
@@ -211,13 +211,13 @@ begin web_file := kpse_open_file(web_name, kpse_web_format);
end;
@z
-@x [26] Opening the .tex file.
+@x [3.26] l.569 - Opening the .tex file.
rewrite(tex_file);
@y
rewrite(tex_file,tex_name);
@z
-@x [28] web2c doesn't understand f^.
+@x [3.28] l.597 - web2c doesn't understand f^.
begin buffer[limit]:=xord[f^]; get(f);
incr(limit);
if buffer[limit-1]<>" " then final_limit:=limit;
@@ -231,7 +231,7 @@ rewrite(tex_file,tex_name);
begin while not eoln(f) do vgetc(f);
@z
-@x [33] Fix jump_out
+@x [4.33] l.678 - Fix jump_out
@ The |jump_out| procedure just cuts across all active procedure levels
and jumps out of the program. This is the only non-local \&{goto} statement
in \.{WEAVE}. It is used when no recovery from a particular error has
@@ -248,7 +248,7 @@ and jumps out of the program.
It is used when no recovery from a particular error has
been provided.
@z
-@x
+@x [4.33] l.689
@d fatal_error(#)==begin new_line; print(#); error; mark_fatal; jump_out;
end
@@ -275,7 +275,7 @@ stat @<Print statistics about memory usage@>;@+tats@;@/
end;
@z
-@x [37] extend 'byte_mem' for "pdftex.web + pdftex-final.ch"
+@x [5.37] l.726 - extend 'byte_mem' for "pdftex.web + pdftex-final.ch"
there are programs that need more than 65536 bytes; \TeX\ is one of these.
@y
there are programs that need more than 65536 bytes; \TeX\ is one of these
@@ -283,7 +283,7 @@ there are programs that need more than 65536 bytes; \TeX\ is one of these
its ``final'' change file is applied).
@z
-@x
+@x [5.37] l.729
is either 0 or 1. (For generality, the first index is actually allowed to
run between 0 and |ww-1|, where |ww| is defined to be 2; the program will
@y
@@ -291,13 +291,13 @@ is either 0, 1 or 2. (For generality, the first index is actually allowed to
run between 0 and |ww-1|, where |ww| is defined to be 3; the program will
@z
-@x
+@x [5.37] l.734
@d ww=2 {we multiply the byte capacity by approximately this amount}
@y
@d ww=3 {we multiply the byte capacity by approximately this amount}
@z
-@x [50] don't enter xrefs if no_xref set
+@x [5.50] l.910 - don't enter xrefs if no_xref set
@d append_xref(#)==if xref_ptr=max_refs then overflow('cross reference')
else begin incr(xref_ptr); num(xref_ptr):=#;
end
@@ -326,7 +326,7 @@ begin if no_xref then return;
if (reserved(p)or(byte_start[p]+1=byte_start[p+ww]))and
@z
-@x [124]
+@x [12.124] l.2199
`\.{\\input webmac}'.
@.\\input webmac@>
@.webmac@>
@@ -341,7 +341,7 @@ command line), then we use alternative \TeX\ macros from `\.{\\input pwebmac}'.
@.pwebmac@>
@z
-@x
+@x [12.124] l.2204
out_ptr:=1; out_line:=1; out_buf[1]:="c"; write(tex_file,'\input webma');
@y
out_ptr:=1; out_line:=1; out_buf[1]:="c";
@@ -349,7 +349,7 @@ if pdf_output then write(tex_file,'\input pwebma')
else write(tex_file,'\input webma');
@z
-@x [127] see https://tug.org/pipermail/tex-live/2023-July/049306.htm
+@x [12.127] l.2234 - see https://tug.org/pipermail/tex-live/2023-July/049306.htm
preceded by another backslash. In the latter case, a |"%"| is output at
the break.
@y
@@ -357,14 +357,14 @@ preceded by another backslash or a \TeX\ comment marker. In the latter case, a
|'%'| is output at the break.
@z
-@x [127] deal with malign user input
+@x [12.127] l.2248 - deal with malign user input
if (d="\")and(out_buf[k-1]<>"\") then {in this case |k>1|}
@y
if (d="\")and(out_buf[k-1]<>"\")and(out_buf[k-1]<>"%") then
{in this case |k>1|}
@z
-@x [148] Purify 'reduce' and 'squash'.
+@x [15.148] l.3007 - Purify 'reduce' and 'squash'.
@d production(#)==@!debug prod(#) gubed; goto found
@d reduce(#)==red(#); production
@d production_end(#)==@!debug prod(#) gubed; goto found;
@@ -376,68 +376,68 @@ preceded by another backslash or a \TeX\ comment marker. In the latter case, a
@d squash(#)==begin sq(#); production
@z
-@x [151] Special case 'k=0'.
+@x [15.151] l.3100 - Special case 'k=0'.
else if cat[pp+1]=simp then squash(pp+1,1,math,0)(4)
@y
else if cat[pp+1]=simp then reduce(pp+1,0,math,0)(4)
@z
-@x [157] Special case 'k=0'.
+@x [15.157] l.3151 - Special case 'k=0'.
squash(pp,1,intro,-3)(14)
@y
reduce(pp,0,intro,-3)(14)
@z
-@x [161] Special case 'k=0'.
+@x [15.161] l.3193 - Special case 'k=0'.
else squash(pp,1,simp,-2)(25)
@y
else reduce(pp,0,simp,-2)(25)
@z
-@x [162] Special case 'k=0'.
+@x [15.162] l.3212 - Special case 'k=0'.
else if cat[pp+1]=simp then squash(pp+1,1,math,0)(35)
@y
else if cat[pp+1]=simp then reduce(pp+1,0,math,0)(35)
@z
-@x [166] Special case 'k=0'.
+@x [15.166] l.3272 - Special case 'k=0'.
squash(pp,1,terminator,-3)(42)
@y
reduce(pp,0,terminator,-3)(42)
@z
-@x [167] Special case 'k=0'.
+@x [15.167] l.3275 - Special case 'k=0'.
if cat[pp+1]=close then squash(pp,1,stmt,-2)(43)
@y
if cat[pp+1]=close then reduce(pp,0,stmt,-2)(43)
@z
-@x [167] Apply 'squash(...,2,...)'.
+@x [15.167] l.3277 - Apply 'squash(...,2,...)'.
begin app(force); app(backup); app2(pp); reduce(pp,2,intro,-3)(44);
@y
begin app(force); app(backup); squash(pp,2,intro,-3)(44);
@z
-@x [169] Special case 'k=0'.
+@x [15.169] l.3291 - Special case 'k=0'.
squash(pp,1,stmt,-2)(50)
@y
reduce(pp,0,stmt,-2)(50)
@z
-@x [170] Special case 'k=0'.
+@x [15.170] l.3294 - Special case 'k=0'.
if cat[pp+1]=beginning then squash(pp,1,stmt,-2)(51)
@y
if cat[pp+1]=beginning then reduce(pp,0,stmt,-2)(51)
@z
-@x [172] Move special case 'k=1' from 'squash' to special case 'k=0' here.
+@x [15.172] l.3325 - Move special case 'k=1' from 'squash' to special case 'k=0' here.
scrap list.
@y
scrap list. This procedure takes advantage of the simplification that
occurs when |k=0|.
@z
-@x
+@x [15.172] l.3330
begin cat[j]:=c; trans[j]:=text_ptr; freeze_text;
@y
begin cat[j]:=c;
@@ -447,19 +447,19 @@ if k>0 then
end;
@z
-@x [172] Fix spacing.
+@x [15.172] l.3337 - Fix spacing.
@<Change |pp| to $\max(|scrap_base|,|pp+d|)$@>;
@y
@<Change |pp| to $\max(|scrap_base|,\,|pp+d|)$@>;
@z
-@x [173] Fix spacing.
+@x [15.173] l.3340 - Fix spacing.
@ @<Change |pp| to $\max(|scrap_base|,|pp+d|)$@>=
@y
@ @<Change |pp| to $\max(|scrap_base|,\,|pp+d|)$@>=
@z
-@x [174] Rewrite 'squash' to match description in section [148].
+@x [15.174] l.3344 - Rewrite 'squash' to match description in section [148].
@ Similarly, the `|squash|' macro invokes a procedure called `|sq|'. This
procedure takes advantage of the simplification that occurs when |k=1|.
@y
@@ -467,7 +467,7 @@ procedure takes advantage of the simplification that occurs when |k=1|.
combines |app|${}_k$ and |red| for matching numbers~|k|.
@z
-@x
+@x [15.174] l.3349
var i:0..max_scraps; {index into scrap memory}
begin if k=1 then
begin cat[j]:=c; @<Change |pp|...@>;
@@ -488,7 +488,7 @@ begin
red(j,k,c,d);
@z
-@x [239] omit index and module names if no_xref set
+@x [19.239] l.4537 - omit index and module names if no_xref set
@<Phase III: Output the cross-reference index@>=
@y
If the user has set the |no_xref| flag (the `\.{-x} option on the
@@ -505,14 +505,14 @@ if no_xref then begin
else begin
@z
-@x
+@x [19.239] l.4551
print('Done.');
@y
end;
print('Done.');
@z
-@x [258] term_in == stdin, when debugging.
+@x [20.258] l.4782 - term_in == stdin, when debugging.
any error stop will set |debug_cycle| to zero.
@y
any error stop will set |debug_cycle| to zero.
@@ -520,24 +520,24 @@ any error stop will set |debug_cycle| to zero.
@d term_in==stdin
@z
-@x
+@x [20.258] l.4790
@!term_in:text_file; {the user's terminal as an input file}
@y
@z
-@x [259] Take out reset(term_in)
+@x [20.259] l.4798 - Take out reset(term_in)
reset(term_in,'TTY:','/I'); {open |term_in| as the terminal, don't do a |get|}
@y
@z
-@x [261] print newline at end of run and exit based upon value of history
+@x [21.261] l.4851 - print newline at end of run and exit based upon value of history
print_ln(banner); {print a ``banner line''}
@y
print (banner); {print a ``banner line''}
print_ln (version_string);
@z
-@x
+@x [21.261] l.4856
end_of_WEAVE:
stat @<Print statistics about memory usage@>;@+tats@;@/
@t\4\4@>{here files should be closed if the operating system requires it}
@@ -548,7 +548,7 @@ jump_out;
end.
@z
-@x [264] System-dependent changes.
+@x [22.264] l.4886 - System-dependent changes.
This module should be replaced, if necessary, by changes to the program
that are necessary to make \.{WEAVE} work at a particular installation.
It is usually best to design your change file so that all changes to
diff --git a/Build/source/texk/web2c/xetexdir/ChangeLog b/Build/source/texk/web2c/xetexdir/ChangeLog
index 7c3c73753c8..ed2fbea50df 100644
--- a/Build/source/texk/web2c/xetexdir/ChangeLog
+++ b/Build/source/texk/web2c/xetexdir/ChangeLog
@@ -1,3 +1,13 @@
+2024-05-18 Hironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
+ TANAKA Takuji <ttk@t-lab.opal.ne.jp>
+
+ * xetex.web, xetex.ch:
+ Accept characters of over-BMP when getting character codes
+ from control symbols by using backquote "`".
+ * xetex-ctrlsym.test, tests/ctrlsym.{log,tex}: Add tests.
+ * am/xetex.am: Adjusted.
+ https://github.com/texjporg/tex-jp-build/issues/167
+
2024-03-10 Karl Berry <karl@tug.org>
* TL'24 release.
diff --git a/Build/source/texk/web2c/xetexdir/am/xetex.am b/Build/source/texk/web2c/xetexdir/am/xetex.am
index e4260567f06..1e92f605c4b 100644
--- a/Build/source/texk/web2c/xetexdir/am/xetex.am
+++ b/Build/source/texk/web2c/xetexdir/am/xetex.am
@@ -206,9 +206,11 @@ EXTRA_DIST += \
xetex_tests = \
xetexdir/xetex-filedump.test \
xetexdir/xetex-bug73.test \
+ xetexdir/xetex-ctrlsym.test \
xetexdir/xetex.test \
xetexdir/wcfname.test
-xetexdir/xetex-filedump.log xetexdir/xetex-bug73.log xetexdir/xetex.log \
+xetexdir/xetex-filedump.log xetexdir/xetex-bug73.log \
+ xetexdir/xetex-ctrlsym.log xetexdir/xetex.log \
xetexdir/wcfname.log: xetex$(EXEEXT)
EXTRA_DIST += $(xetex_tests)
@@ -225,6 +227,10 @@ DISTCLEANFILES += bug73.fmt bug73.log bug73.out bug73.tex
EXTRA_DIST += xetexdir/tests/filedump.log xetexdir/tests/filedump.tex
DISTCLEANFILES += filedump.log filedump.out filedump.tex
+## xetex-ctrlsym.test
+EXTRA_DIST += xetexdir/tests/ctrlsym.log xetexdir/tests/ctrlsym.tex
+DISTCLEANFILES += xe-ctrlsym.fmt xe-ctrlsym.log xe-ctrlsym.out xe-ctrlsym.tex
+
## wcfname.test
DISTCLEANFILES += xetests/fn*.*
diff --git a/Build/source/texk/web2c/xetexdir/tests/ctrlsym.log b/Build/source/texk/web2c/xetexdir/tests/ctrlsym.log
new file mode 100644
index 00000000000..e6ce6184a97
--- /dev/null
+++ b/Build/source/texk/web2c/xetexdir/tests/ctrlsym.log
@@ -0,0 +1,20 @@
+entering extended mode
+ restricted \write18 enabled.
+ %&-line parsing enabled.
+**xe-ctrlsym
+(./xe-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.
diff --git a/Build/source/texk/web2c/xetexdir/tests/ctrlsym.tex b/Build/source/texk/web2c/xetexdir/tests/ctrlsym.tex
new file mode 100644
index 00000000000..f007708a2bc
--- /dev/null
+++ b/Build/source/texk/web2c/xetexdir/tests/ctrlsym.tex
@@ -0,0 +1,34 @@
+% Copyright 2024 Japanese TeX Development Community <issue@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
diff --git a/Build/source/texk/web2c/xetexdir/xetex-ctrlsym.test b/Build/source/texk/web2c/xetexdir/xetex-ctrlsym.test
new file mode 100755
index 00000000000..5583e943553
--- /dev/null
+++ b/Build/source/texk/web2c/xetexdir/xetex-ctrlsym.test
@@ -0,0 +1,28 @@
+#! /bin/sh -vx
+# Copyright 2024 Japanese TeX Development Community <issue@texjp.org>
+# You may freely use, modify and/or distribute this file.
+
+BinDir=${BinDir:-.}
+ExeExt=${ExeExt:-}
+_xetex=$BinDir/xetex$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 xe-ctrlsym.tex
+$LN_S $srcdir/xetexdir/tests/ctrlsym.tex ./xe-ctrlsym.tex
+
+#exit 77
+
+$_xetex -ini -etex xe-ctrlsym || exit 1
+
+$_xetex -etex -fmt=xe-ctrlsym xe-ctrlsym || exit 2
+
+sed 1d xe-ctrlsym.log >xe-ctrlsym.out
+
+diff $srcdir/xetexdir/tests/ctrlsym.log xe-ctrlsym.out || exit 3
+
diff --git a/Build/source/texk/web2c/xetexdir/xetex.ch b/Build/source/texk/web2c/xetexdir/xetex.ch
index 69143dc907b..8e951103eab 100644
--- a/Build/source/texk/web2c/xetexdir/xetex.ch
+++ b/Build/source/texk/web2c/xetexdir/xetex.ch
@@ -111,6 +111,14 @@ if translate_filename then read_tcx_file;
@!bound_default:integer; {temporary for setup}
@z
+@x [5.??] type of trick_buf[]
+@!trick_buf:array[0..ssup_error_line] of ASCII_code; {circular buffer for
+ pseudoprinting}
+@y
+@!trick_buf:array[0..ssup_error_line] of UnicodeScalar; {circular buffer for
+ pseudoprinting}
+@z
+
@x [5.61] l.1556 - Print rest of banner, eliminate misleading `(no format preloaded)'.
if translate_filename then begin
wterm(' (');
diff --git a/Build/source/texk/web2c/xetexdir/xetex.web b/Build/source/texk/web2c/xetexdir/xetex.web
index 89fd084b828..9affc9bbaf8 100644
--- a/Build/source/texk/web2c/xetexdir/xetex.web
+++ b/Build/source/texk/web2c/xetexdir/xetex.web
@@ -1631,7 +1631,7 @@ parameter |incr_offset| is set |false| except for the very last byte, to avoid
calling |print_ln| in the middle of such character.
@<Basic printing...@>=
-procedure print_raw_char(@!s:ASCII_code;@!incr_offset:boolean); {prints a single character}
+procedure print_raw_char(@!s:UnicodeScalar;@!incr_offset:boolean); {prints a single character}
label exit; {label is not used but nonetheless kept (for other changes?)}
begin
case selector of
@@ -5372,7 +5372,7 @@ paragraphs is to define these names, and to set up the initial values of the
equivalents.
In the first region we have |number_usvs| equivalents for ``active characters''
-that act as control sequences, followed by |number_usvs| equivalents for
+that act as control sequences, followed by |too_big_char| equivalents for
single-character control sequences.
Then comes region~2, which corresponds to the hash table that we will
@@ -5384,7 +5384,9 @@ locations for control sequences that are perpetually defined
@d active_base=1 {beginning of region 1, for active character equivalents}
@d single_base=active_base+number_usvs
{equivalents of one-character control sequences}
-@d null_cs=single_base+number_usvs {equivalent of \.{\\csname\\endcsname}}
+ {single-character sequence whose character code is ${}>|@"FFFF|$ are
+ treated as a multiletter sequence, because UTF-16 is used in the string pool. }
+@d null_cs=single_base+too_big_char {equivalent of \.{\\csname\\endcsname}}
@d hash_base=null_cs+1 {beginning of region 2, for the hash table}
@d frozen_control_sequence=hash_base+hash_size {for error recovery}
@d frozen_protection=frozen_control_sequence {inaccessible but definable}
@@ -10436,7 +10438,19 @@ if cur_tok<cs_token_flag then
end
else if cur_tok<cs_token_flag+single_base then
cur_val:=cur_tok-cs_token_flag-active_base
-else 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-letter whose character code is ${}>|@"FFFF|$ }
+ begin m:=text(cur_tok-cs_token_flag);
+ if str_start_macro(m+1)=2+str_start_macro(m) then begin
+ m:=str_start_macro(m);
+ if (so(str_pool[m])>=@"D800) and (so(str_pool[m])<=@"DBFF)
+ and (so(str_pool[m+1])>=@"DC00) and (so(str_pool[m+1])<=@"DFFF) then
+ cur_val:=@"10000 + (so(str_pool[m])-@"D800) * @"400 + so(str_pool[m+1])-@"DC00
+ else cur_val:=too_big_usv;
+ end
+ else cur_val:=too_big_usv;
+ end;
if cur_val>biggest_usv then
begin print_err("Improper alphabetic constant");
@.Improper alphabetic constant@>