summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorHironobu Yamashita <h.y.acetaminophen@gmail.com>2018-01-21 03:48:06 +0000
committerHironobu Yamashita <h.y.acetaminophen@gmail.com>2018-01-21 03:48:06 +0000
commitfa0ffd9d1a8e3b86577dd54956b457241ec574aa (patch)
tree7317222dd8f72114f8ccf6582259e48a6c5b5d36 /Build
parent9fe3d1656ac8c1b2082509299124a030d8a55285 (diff)
(e-)(u)pTeX: Add \ptexversion and co. (H. Kitagawa)
git-svn-id: svn://tug.org/texlive/trunk@46399 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r--Build/source/texk/web2c/Makefile.in2
-rw-r--r--Build/source/texk/web2c/eptexdir/ChangeLog5
-rw-r--r--Build/source/texk/web2c/eptexdir/eptex.ech37
-rw-r--r--Build/source/texk/web2c/eptexdir/eptex_version.h2
-rw-r--r--Build/source/texk/web2c/eptexdir/etex.ch024
-rw-r--r--Build/source/texk/web2c/eptexdir/etex.ch132
-rw-r--r--Build/source/texk/web2c/eptexdir/pdfutils.ch8
-rw-r--r--Build/source/texk/web2c/euptexdir/ChangeLog5
-rw-r--r--Build/source/texk/web2c/euptexdir/am/euptex.am2
-rw-r--r--Build/source/texk/web2c/euptexdir/euptex.ch011
-rw-r--r--Build/source/texk/web2c/euptexdir/euptex.ch120
-rw-r--r--Build/source/texk/web2c/euptexdir/pdfstrcmp-eup-post.ch12
-rw-r--r--Build/source/texk/web2c/ptexdir/ChangeLog6
-rw-r--r--Build/source/texk/web2c/ptexdir/ptex-base.ch54
-rw-r--r--Build/source/texk/web2c/ptexdir/ptex_version.h2
-rw-r--r--Build/source/texk/web2c/tests/ptexversion.tex44
-rw-r--r--Build/source/texk/web2c/uptexdir/ChangeLog4
-rw-r--r--Build/source/texk/web2c/uptexdir/uptex-m.ch65
18 files changed, 322 insertions, 13 deletions
diff --git a/Build/source/texk/web2c/Makefile.in b/Build/source/texk/web2c/Makefile.in
index 9c0460f4784..e9b2c50717a 100644
--- a/Build/source/texk/web2c/Makefile.in
+++ b/Build/source/texk/web2c/Makefile.in
@@ -3281,8 +3281,8 @@ euptex_ch_srcs = \
uptexdir/uptex-m.ch \
euptexdir/euptex.ch0 \
eptexdir/eptex.ech \
- euptexdir/euptex.ch1 \
eptexdir/etex.ch1 \
+ euptexdir/euptex.ch1 \
$(euptex_ch_synctex) \
eptexdir/fam256.ch \
euptexdir/pdfstrcmp-eup-pre.ch \
diff --git a/Build/source/texk/web2c/eptexdir/ChangeLog b/Build/source/texk/web2c/eptexdir/ChangeLog
index 7eefff664e9..61d620c1491 100644
--- a/Build/source/texk/web2c/eptexdir/ChangeLog
+++ b/Build/source/texk/web2c/eptexdir/ChangeLog
@@ -1,3 +1,8 @@
+2018-01-21 Hironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
+
+ * eptex.ech, etex.ch0, etex.ch1, pdfutils.ch: New primitive \epTeXversion.
+ * eptex.ech, eptex_version.h: e-pTeX version 180121.
+
2017-12-22 Hironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
* fam256.ch: \delcode defaults to -1, not -4097, to be compatible
diff --git a/Build/source/texk/web2c/eptexdir/eptex.ech b/Build/source/texk/web2c/eptexdir/eptex.ech
index 57592ac0308..3f3b0e01e4b 100644
--- a/Build/source/texk/web2c/eptexdir/eptex.ech
+++ b/Build/source/texk/web2c/eptexdir/eptex.ech
@@ -19,7 +19,8 @@
@y
@d eTeX_version_string=='-2.6' {current \eTeX\ version}
@#
-@d epTeX_version_string=='-170924'
+@d epTeX_version_string=='-180121'
+@d epTeX_version_number==180121
@z
@x e-pTeX: banner
@@ -71,11 +72,38 @@ var m:halfword; {|chr_code| part of the operand token}
@x
@d input_line_no_code=glue_val+2 {code for \.{\\inputlineno}}
+@d badness_code=glue_val+2 {code for \.{\\badness}}
@y
@d last_node_char_code=glue_val+2 {code for \.{\\lastnodechar}}
@d input_line_no_code=glue_val+3 {code for \.{\\inputlineno}}
+@d badness_code=glue_val+4 {code for \.{\\badness}}
@z
+@x
+@d ptex_minor_version_code=ptex_version_code+1 {code for \.{\\ptexminorversion}}
+@y
+@d ptex_minor_version_code=ptex_version_code+1 {code for \.{\\ptexminorversion}}
+@d eptex_version_code=ptex_minor_version_code+1 {code for \.{\\epTeXversion}}
+@z
+
+@x
+primitive("ptexversion",last_item,ptex_version_code);
+@!@:ptexversion_}{\.{\\ptexversion} primitive@>
+@y
+primitive("ptexversion",last_item,ptex_version_code);
+@!@:ptexversion_}{\.{\\ptexversion} primitive@>
+primitive("epTeXversion",last_item,eptex_version_code);
+@!@:epTeXversion_}{\.{\\epTeXversion} primitive@>
+@z
+
+@x
+ ptex_version_code: print_esc("ptexversion");
+@y
+ ptex_version_code: print_esc("ptexversion");
+ eptex_version_code: print_esc("epTeXversion");
+@z
+
+
@x [26.420] l.8474 - pTeX: Fetch a box dimension: dir_node
begin scan_eight_bit_int; q:=box(cur_val);
@y
@@ -139,6 +167,13 @@ else find_last_char;
end
@z
+@x
+ ptex_version_code: cur_val:=pTeX_version;
+@y
+ ptex_version_code: cur_val:=pTeX_version;
+ eptex_version_code: cur_val:=epTeX_version_number;
+@z
+
@x [26.424] e-pTeX: node char
if cur_chr=last_node_type_code then
begin cur_val_level:=int_val;
diff --git a/Build/source/texk/web2c/eptexdir/eptex_version.h b/Build/source/texk/web2c/eptexdir/eptex_version.h
index 93f2647018d..f2c3c67db9b 100644
--- a/Build/source/texk/web2c/eptexdir/eptex_version.h
+++ b/Build/source/texk/web2c/eptexdir/eptex_version.h
@@ -1 +1 @@
-#define EPTEX_VERSION "170924"
+#define EPTEX_VERSION "180121"
diff --git a/Build/source/texk/web2c/eptexdir/etex.ch0 b/Build/source/texk/web2c/eptexdir/etex.ch0
index 154391e42c6..782af3cf038 100644
--- a/Build/source/texk/web2c/eptexdir/etex.ch0
+++ b/Build/source/texk/web2c/eptexdir/etex.ch0
@@ -33,6 +33,12 @@ exit:end;
end;
@z
+@x
+@d badness_code=input_line_no_code+1 {code for \.{\\badness}}
+@y
+@d badness_code=glue_val+2 {code for \.{\\badness}}
+@z
+
@x [26.420]
begin scan_register_num; fetch_box(q);
if q=null then cur_val:=0 @+else cur_val:=mem[q+m].sc;
@@ -54,6 +60,24 @@ legal in similar contexts.
@y
@z
+@x
+ if m>=eTeX_glue then @<Process an expression and |return|@>@;
+ else if m>=eTeX_dim then
+ begin case m of
+ @/@<Cases for fetching a dimension value@>@/
+ end; {there are no other cases}
+ cur_val_level:=dimen_val;
+ end
+ else begin case m of
+ input_line_no_code: cur_val:=line;
+ badness_code: cur_val:=last_badness;
+ @/@<Cases for fetching an integer value@>@/
+ end; {there are no other cases}
+@y
+ begin if cur_chr=input_line_no_code then cur_val:=line
+ else cur_val:=last_badness; {|cur_chr=badness_code|}
+@z
+
@x [26.424]
find_effective_tail;
@y
diff --git a/Build/source/texk/web2c/eptexdir/etex.ch1 b/Build/source/texk/web2c/eptexdir/etex.ch1
index 68405f2c08a..965465cd919 100644
--- a/Build/source/texk/web2c/eptexdir/etex.ch1
+++ b/Build/source/texk/web2c/eptexdir/etex.ch1
@@ -16,6 +16,38 @@
@d etex_int_base=tex_int_pars {base for \eTeX's integer parameters}
@z
+@x
+@d eTeX_int=badness_code+1 {first of \eTeX\ codes for integers}
+@y
+@d eTeX_int=ptex_minor_version_code+1 {first of \eTeX\ codes for integers}
+@z
+
+@x
+ begin case m of
+ input_line_no_code: cur_val:=line;
+ badness_code: cur_val:=last_badness;
+ ptex_version_code: cur_val:=pTeX_version;
+ eptex_version_code: cur_val:=epTeX_version_number;
+ ptex_minor_version_code: cur_val:=pTeX_minor_version;
+ end; {there and no other cases}
+@y
+ if m>=eTeX_glue then @<Process an expression and |return|@>@;
+ else if m>=eTeX_dim then
+ begin case m of
+ @/@<Cases for fetching a dimension value@>@/
+ end; {there are no other cases}
+ cur_val_level:=dimen_val;
+ end
+ else begin case m of
+ input_line_no_code: cur_val:=line;
+ badness_code: cur_val:=last_badness;
+ ptex_version_code: cur_val:=pTeX_version;
+ eptex_version_code: cur_val:=epTeX_version_number;
+ ptex_minor_version_code: cur_val:=pTeX_minor_version;
+ @/@<Cases for fetching an integer value@>@/
+ end; {there are no other cases}
+@z
+
@x [27.468]
@d job_name_code=ptex_convert_codes {command code for \.{\\jobname}}
@y
diff --git a/Build/source/texk/web2c/eptexdir/pdfutils.ch b/Build/source/texk/web2c/eptexdir/pdfutils.ch
index fb0511d05ac..14e095ce60f 100644
--- a/Build/source/texk/web2c/eptexdir/pdfutils.ch
+++ b/Build/source/texk/web2c/eptexdir/pdfutils.ch
@@ -758,10 +758,10 @@ ignore_spaces: {trap unexpandable primitives}
@z
@x
-@d badness_code=input_line_no_code+1 {code for \.{\\badness}}
+@d eptex_version_code=ptex_minor_version_code+1 {code for \.{\\epTeXversion}}
@y
-@d badness_code=input_line_no_code+1 {code for \.{\\badness}}
-@d pdf_last_x_pos_code=badness_code+1 {code for \.{\\pdflastxpos}}
+@d eptex_version_code=ptex_minor_version_code+1 {code for \.{\\epTeXversion}}
+@d pdf_last_x_pos_code=eptex_version_code+1 {code for \.{\\pdflastxpos}}
@d pdf_last_y_pos_code=pdf_last_x_pos_code+1 {code for \.{\\pdflastypos}}
@d pdf_shell_escape_code=pdf_last_y_pos_code+1 {code for \.{\\pdflastypos}}
@d elapsed_time_code =pdf_shell_escape_code+1 {code for \.{\\pdfelapsedtime}}
@@ -769,7 +769,7 @@ ignore_spaces: {trap unexpandable primitives}
@z
@x
-@d eTeX_int=badness_code+1 {first of \eTeX\ codes for integers}
+@d eTeX_int=ptex_minor_version_code+1 {first of \eTeX\ codes for integers}
@y
@d eTeX_int=random_seed_code+1 {first of \eTeX\ codes for integers}
@z
diff --git a/Build/source/texk/web2c/euptexdir/ChangeLog b/Build/source/texk/web2c/euptexdir/ChangeLog
index d4c3b66cd01..05d9862794b 100644
--- a/Build/source/texk/web2c/euptexdir/ChangeLog
+++ b/Build/source/texk/web2c/euptexdir/ChangeLog
@@ -1,3 +1,8 @@
+2018-01-21 Hironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
+
+ * euptex.ch0, euptex.ch1, pdfstrcmp-eup-post.ch, am/euptex.am:
+ Adapt to changes in ptexdir/, eptexdir, and uptexdir/.
+
2017-11-30 Hironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
* pdfstrcmp-eup-post.ch, tests/pdfprimitive-euptex.log: Adapt
diff --git a/Build/source/texk/web2c/euptexdir/am/euptex.am b/Build/source/texk/web2c/euptexdir/am/euptex.am
index 84c55e4b57b..21ab6a9a739 100644
--- a/Build/source/texk/web2c/euptexdir/am/euptex.am
+++ b/Build/source/texk/web2c/euptexdir/am/euptex.am
@@ -59,8 +59,8 @@ euptex_ch_srcs = \
uptexdir/uptex-m.ch \
euptexdir/euptex.ch0 \
eptexdir/eptex.ech \
- euptexdir/euptex.ch1 \
eptexdir/etex.ch1 \
+ euptexdir/euptex.ch1 \
$(euptex_ch_synctex) \
eptexdir/fam256.ch \
euptexdir/pdfstrcmp-eup-pre.ch \
diff --git a/Build/source/texk/web2c/euptexdir/euptex.ch0 b/Build/source/texk/web2c/euptexdir/euptex.ch0
index 375193556a2..cc9c0285d34 100644
--- a/Build/source/texk/web2c/euptexdir/euptex.ch0
+++ b/Build/source/texk/web2c/euptexdir/euptex.ch0
@@ -35,3 +35,14 @@
@y
@d protected_token=@"E01 {$2^8\cdot|end_match|+1$}
@z
+
+@x
+ uptex_version_code: print_esc("uptexversion");
+@y
+@z
+
+@x
+ uptex_version_code: cur_val:=upTeX_version;
+@y
+@z
+
diff --git a/Build/source/texk/web2c/euptexdir/euptex.ch1 b/Build/source/texk/web2c/euptexdir/euptex.ch1
index 0745836dead..69a520d901c 100644
--- a/Build/source/texk/web2c/euptexdir/euptex.ch1
+++ b/Build/source/texk/web2c/euptexdir/euptex.ch1
@@ -7,11 +7,31 @@
@z
@x
+@d uptex_version_code=ptex_minor_version_code+1 {code for \.{\\uptexversion}}
+@y
+@d uptex_version_code=ptex_minor_version_code+2 {code for \.{\\uptexversion}}
+@z
+
+@x
+ eptex_version_code: print_esc("epTeXversion");
+@y
+ eptex_version_code: print_esc("epTeXversion");
+ uptex_version_code: print_esc("uptexversion");
+@z
+
+@x
if font_dir[font(tx)]<>dir_default then cur_val:=KANJI(info(link(tx)))
@y
if font_dir[font(tx)]<>dir_default then cur_val:=KANJI(info(link(tx))) mod max_cjk_val
@z
+@x
+ eptex_version_code: cur_val:=epTeX_version_number;
+@y
+ eptex_version_code: cur_val:=epTeX_version_number;
+ uptex_version_code: cur_val:=upTeX_version;
+@z
+
@x e-pTeX: ifcsname l.28620
begin buffer[m]:=Hi(info(p)); incr(m);
end;
diff --git a/Build/source/texk/web2c/euptexdir/pdfstrcmp-eup-post.ch b/Build/source/texk/web2c/euptexdir/pdfstrcmp-eup-post.ch
index c0961189104..2b154f9a28a 100644
--- a/Build/source/texk/web2c/euptexdir/pdfstrcmp-eup-post.ch
+++ b/Build/source/texk/web2c/euptexdir/pdfstrcmp-eup-post.ch
@@ -5,6 +5,18 @@
@z
@x
+@d pdf_last_x_pos_code=eptex_version_code+1 {code for \.{\\pdflastxpos}}
+@y
+@d uptex_version_code=eptex_version_code+1 {code for \.{\\uptexversion}}
+@d pdf_last_x_pos_code=uptex_version_code+1 {code for \.{\\pdflastxpos}}
+@z
+
+@x
+@d uptex_version_code=ptex_minor_version_code+2 {code for \.{\\uptexversion}}
+@y
+@z
+
+@x
procedure print_kanji(@!s:integer); {prints a single character}
begin
if s>255 then begin
diff --git a/Build/source/texk/web2c/ptexdir/ChangeLog b/Build/source/texk/web2c/ptexdir/ChangeLog
index fd21d8f305c..d4deadb2bd6 100644
--- a/Build/source/texk/web2c/ptexdir/ChangeLog
+++ b/Build/source/texk/web2c/ptexdir/ChangeLog
@@ -1,3 +1,9 @@
+2018-01-21 Hironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
+
+ * ptex-base.ch: New primitives: \ptexversion, \ptexminorversion
+ and \ptexrevision.
+ * ptex_version.h: pTeX version p3.8.0.
+
2017-12-21 Hironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
* ptex-base.ch: Include zw etc. in "Dimensions can be in units ..."
diff --git a/Build/source/texk/web2c/ptexdir/ptex-base.ch b/Build/source/texk/web2c/ptexdir/ptex-base.ch
index a8d1a8dd477..9e77bf35372 100644
--- a/Build/source/texk/web2c/ptexdir/ptex-base.ch
+++ b/Build/source/texk/web2c/ptexdir/ptex-base.ch
@@ -57,6 +57,7 @@
% (2016-06-06) AK Hironori Kitagawa fixed a bug in check_box(box_p:pointer).
% pTeX p3.7.1.
% (2017-09-07) HK pTeX p3.7.2 More restrictions on direction change commands.
+% (2018-01-21) HK Added \ptexversion primitive and co. pTeX p3.8.
%
@x
@@ -70,7 +71,10 @@
@d banner==TeX_banner
@d banner_k==TeX_banner_k
@y
-@d pTeX_version_string=='-p3.7.2' {current \pTeX\ version}
+@d pTeX_version=3
+@d pTeX_minor_version=8
+@d pTeX_revision==".0"
+@d pTeX_version_string=='-p3.8.0' {current \pTeX\ version}
@#
@d pTeX_banner=='This is pTeX, Version 3.14159265',pTeX_version_string
@d pTeX_banner_k==pTeX_banner
@@ -2067,6 +2071,34 @@ else { \.{\\delcode} }
scanned_result(eqtb[m+cur_val].int)(int_val) end;
@z
+@x pTeX: \ptexversion
+@d badness_code=glue_val+2 {code for \.{\\badness}}
+@y
+@d badness_code=glue_val+2 {code for \.{\\badness}}
+@d ptex_version_code=badness_code+1 {code for \.{\\ptexversion}}
+@d ptex_minor_version_code=ptex_version_code+1 {code for \.{\\ptexminorversion}}
+@z
+
+@x pTeX: \ptexversion
+primitive("badness",last_item,badness_code);
+@!@:badness_}{\.{\\badness} primitive@>
+@y
+primitive("badness",last_item,badness_code);
+@!@:badness_}{\.{\\badness} primitive@>
+primitive("ptexversion",last_item,ptex_version_code);
+@!@:ptexversion_}{\.{\\ptexversion} primitive@>
+primitive("ptexminorversion",last_item,ptex_minor_version_code);
+@!@:ptexminorversion_}{\.{\\ptexminorversion} primitive@>
+@z
+
+@x pTeX: \ptexversion
+ input_line_no_code: print_esc("inputlineno");
+@y
+ input_line_no_code: print_esc("inputlineno");
+ ptex_version_code: print_esc("ptexversion");
+ ptex_minor_version_code: print_esc("ptexminorversion");
+@z
+
@x [26.420] l.8474 - pTeX: Fetch a box dimension: dir_node
begin scan_eight_bit_int;
if box(cur_val)=null then cur_val:=0 @+else cur_val:=mem[box(cur_val)+m].sc;
@@ -2119,6 +2151,18 @@ if not is_char_node(tx) then
@<Fetch an item in the current node...@>=
@z
+@x pTeX: \ptexversion
+ begin if cur_chr=input_line_no_code then cur_val:=line
+ else cur_val:=last_badness; {|cur_chr=badness_code|}
+@y
+ begin case m of
+ input_line_no_code: cur_val:=line;
+ badness_code: cur_val:=last_badness;
+ ptex_version_code: cur_val:=pTeX_version;
+ ptex_minor_version_code: cur_val:=pTeX_minor_version;
+ end; {there and no other cases}
+@z
+
@x [26.424] l.8516 - pTeX: Fetch an item ...: disp_node
else begin if cur_chr=glue_val then cur_val:=zero_glue@+else cur_val:=0;
@y
@@ -2296,7 +2340,8 @@ help6("Dimensions can be in units of em, ex, zw, zh, in, pt, pc,")@/
@d sjis_code=7 {command code for \.{\\sjis}}
@d jis_code=8 {command code for \.{\\jis}}
@d kuten_code=9 {command code for \.{\\kuten}}
-@d ptex_convert_codes=10 {end of \pTeX's command codes}
+@d ptex_revision_code=10 {command code for \.{\\ptexrevision}}
+@d ptex_convert_codes=11 {end of \pTeX's command codes}
@d job_name_code=ptex_convert_codes {command code for \.{\\jobname}}
@z
@@ -2316,6 +2361,8 @@ primitive("jis",convert,jis_code);
@!@:jis_}{\.{\\jis} primitive@>
primitive("kuten",convert,kuten_code);
@!@:kuten_}{\.{\\kuten} primitive@>
+primitive("ptexrevision",convert,ptex_revision_code);
+@!@:ptexrevision_}{\.{\\ptexrevision} primitive@>
@z
@x [27.469] l.9558 - pTeX:
@@ -2327,6 +2374,7 @@ primitive("kuten",convert,kuten_code);
sjis_code:print_esc("sjis");
jis_code:print_esc("jis");
kuten_code:print_esc("kuten");
+ ptex_revision_code:print_esc("ptexrevision");
@z
@x [27.470] l.9566 - pTeX: convert KANJI code continue
@@ -2351,6 +2399,7 @@ KANJI(cx):=0;
case c of
number_code,roman_numeral_code,
kansuji_code,euc_code,sjis_code,jis_code,kuten_code: scan_int;
+ptex_revision_code: do_nothing;
string_code, meaning_code: begin save_scanner_status:=scanner_status;
scanner_status:=normal; get_token;
if (cur_cmd=kanji)or(cur_cmd=kana)or(cur_cmd=other_kchar) then {|wchar_token|}
@@ -2375,6 +2424,7 @@ jis_code: print_int(fromJIS(cur_val));
euc_code: print_int(fromEUC(cur_val));
sjis_code: print_int(fromSJIS(cur_val));
kuten_code: print_int(fromKUTEN(cur_val));
+ptex_revision_code: print(pTeX_revision);
kansuji_code: print_kansuji(cur_val);
string_code:if cur_cs<>0 then sprint_cs(cur_cs)
else if KANJI(cx)=0 then print_char(cur_chr)
diff --git a/Build/source/texk/web2c/ptexdir/ptex_version.h b/Build/source/texk/web2c/ptexdir/ptex_version.h
index 140c16d5984..ef39b9ff037 100644
--- a/Build/source/texk/web2c/ptexdir/ptex_version.h
+++ b/Build/source/texk/web2c/ptexdir/ptex_version.h
@@ -1 +1 @@
-#define PTEX_VERSION "p3.7.2"
+#define PTEX_VERSION "p3.8.0"
diff --git a/Build/source/texk/web2c/tests/ptexversion.tex b/Build/source/texk/web2c/tests/ptexversion.tex
new file mode 100644
index 00000000000..49cdd2eac4e
--- /dev/null
+++ b/Build/source/texk/web2c/tests/ptexversion.tex
@@ -0,0 +1,44 @@
+\catcode`\@=11
+\def\R#1{%
+ \ifx#1\undefined\else
+ \immediate\write16{\meaning#1: \the#1\space}%
+ \fi}
+\def\S#1{%
+ \ifx#1\undefined\else
+ \immediate\write16{\meaning#1: "#1"\space}%
+ \fi}
+
+\ifx\eTeXversion\undefined\else
+ \R\eTeXversion
+ \S\eTeXrevision
+\fi
+
+\ifx\ptexversion\undefined\else
+ \R\ptexversion
+ \R\ptexminorversion
+ \S\ptexrevision
+ \R\epTeXversion
+ \R\uptexversion
+ \S\uptexrevision
+\fi
+
+\ifx\Omegaversion\undefined\else
+ \R\Omegaversion
+ \R\Omegaminorversion
+ \S\Omegarevision
+ \R\Alephversion
+ \R\Alephminorversion
+ \S\Alephrevision
+\fi
+
+\ifx\pdftexversion\undefined\else
+ \R\pdftexversion
+ \S\pdftexrevision
+\fi
+\ifx\luatexversion\undefined\else
+ \R\luatexversion
+ \S\luatexrevision
+\fi
+
+\end
+
diff --git a/Build/source/texk/web2c/uptexdir/ChangeLog b/Build/source/texk/web2c/uptexdir/ChangeLog
index 00b58d2e7bd..9a761ab3be7 100644
--- a/Build/source/texk/web2c/uptexdir/ChangeLog
+++ b/Build/source/texk/web2c/uptexdir/ChangeLog
@@ -1,3 +1,7 @@
+2018-01-21 Hironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
+
+ * uptex-m.ch: New primitives: \uptexversion and \uptexrevision.
+
2017-04-24 Hironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
* uptex-m.ch: Adapt to changes in ptexdir/ptex-base.ch (p\TeX -> \pTeX).
diff --git a/Build/source/texk/web2c/uptexdir/uptex-m.ch b/Build/source/texk/web2c/uptexdir/uptex-m.ch
index 472d8f45467..63305805305 100644
--- a/Build/source/texk/web2c/uptexdir/uptex-m.ch
+++ b/Build/source/texk/web2c/uptexdir/uptex-m.ch
@@ -561,6 +561,37 @@ char_given,math_given: scanned_result(cur_chr)(int_val);
@z
@x
+@d ptex_minor_version_code=ptex_version_code+1 {code for \.{\\ptexminorversion}}
+@y
+@d ptex_minor_version_code=ptex_version_code+1 {code for \.{\\ptexminorversion}}
+@d uptex_version_code=ptex_minor_version_code+1 {code for \.{\\uptexversion}}
+@z
+
+@x
+primitive("ptexversion",last_item,ptex_version_code);
+@!@:ptexversion_}{\.{\\ptexversion} primitive@>
+@y
+primitive("ptexversion",last_item,ptex_version_code);
+@!@:ptexversion_}{\.{\\ptexversion} primitive@>
+primitive("uptexversion",last_item,uptex_version_code);
+@!@:uptexversion_}{\.{\\uptexversion} primitive@>
+@z
+
+@x
+ ptex_version_code: print_esc("ptexversion");
+@y
+ ptex_version_code: print_esc("ptexversion");
+ uptex_version_code: print_esc("uptexversion");
+@z
+
+@x
+ ptex_version_code: cur_val:=pTeX_version;
+@y
+ ptex_version_code: cur_val:=pTeX_version;
+ uptex_version_code: cur_val:=upTeX_version;
+@z
+
+@x
if (cur_cmd=kanji)or(cur_cmd=kana)or(cur_cmd=other_kchar) then {|wchar_token|}
@y
if (cur_cmd>=kanji)and(cur_cmd<=hangul) then {|wchar_token|}
@@ -600,10 +631,14 @@ while k<pool_ptr do
@z
@x
-@d ptex_convert_codes=10 {end of \pTeX's command codes}
+
+@d ptex_revision_code=10 {command code for \.{\\ptexrevision}}
+@d ptex_convert_codes=11 {end of \pTeX's command codes}
@y
@d ucs_code=10 {command code for \.{\\ucs}}
-@d ptex_convert_codes=11 {end of \pTeX's command codes}
+@d ptex_revision_code=11 {command code for \.{\\ptexrevision}}
+@d uptex_revision_code=12 {command code for \.{\\uptexrevision}}
+@d ptex_convert_codes=13 {end of \pTeX's command codes}
@z
@x
@@ -615,6 +650,16 @@ primitive("ucs",convert,ucs_code);
@z
@x
+primitive("ptexrevision",convert,ptex_revision_code);
+@!@:ptexrevision_}{\.{\\ptexrevision} primitive@>
+@y
+primitive("ptexrevision",convert,ptex_revision_code);
+@!@:ptexrevision_}{\.{\\ptexrevision} primitive@>
+primitive("uptexrevision",convert,uptex_revision_code);
+@!@:uptexrevision_}{\.{\\uptexrevision} primitive@>
+@z
+
+@x
kuten_code:print_esc("kuten");
@y
kuten_code:print_esc("kuten");
@@ -622,12 +667,21 @@ primitive("ucs",convert,ucs_code);
@z
@x
+ ptex_revision_code:print_esc("ptexrevision");
+@y
+ ptex_revision_code:print_esc("ptexrevision");
+ uptex_revision_code:print_esc("uptexrevision");
+@z
+
+@x
kansuji_code,euc_code,sjis_code,jis_code,kuten_code: scan_int;
+ptex_revision_code: do_nothing;
string_code, meaning_code: begin save_scanner_status:=scanner_status;
scanner_status:=normal; get_token;
if (cur_cmd=kanji)or(cur_cmd=kana)or(cur_cmd=other_kchar) then {|wchar_token|}
@y
kansuji_code,euc_code,sjis_code,jis_code,kuten_code,ucs_code: scan_int;
+ptex_revision_code, uptex_revision_code: do_nothing;
string_code, meaning_code: begin save_scanner_status:=scanner_status;
scanner_status:=normal; get_token;
if (cur_cmd>=kanji)and(cur_cmd<=hangul) then {|wchar_token|}
@@ -641,6 +695,13 @@ ucs_code: print_int(fromUCS(cur_val));
@z
@x
+ptex_revision_code: print(pTeX_revision);
+@y
+ptex_revision_code: print(pTeX_revision);
+uptex_revision_code: print(upTeX_revision);
+@z
+
+@x
if (cur_cmd=kanji)or(cur_cmd=kana)or(cur_cmd=other_kchar) then
@y
if (cur_cmd>=kanji)and(cur_cmd<=hangul) then