diff options
author | Hironobu Yamashita <h.y.acetaminophen@gmail.com> | 2019-07-12 16:07:27 +0000 |
---|---|---|
committer | Hironobu Yamashita <h.y.acetaminophen@gmail.com> | 2019-07-12 16:07:27 +0000 |
commit | 3e3ef209c676a34275271415b131a95ad024a0c2 (patch) | |
tree | fcce8ecc851bc3ad095731670268eebbfdebe388 /Build/source | |
parent | e79133fcc651c459e8ce7bd269b758098cbe40d6 (diff) |
ptex: strict '! Improper alphabetic or KANJI constant.' error
git-svn-id: svn://tug.org/texlive/trunk@51623 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source')
-rw-r--r-- | Build/source/texk/web2c/ptexdir/ChangeLog | 6 | ||||
-rw-r--r-- | Build/source/texk/web2c/ptexdir/ptex-base.ch | 12 | ||||
-rw-r--r-- | Build/source/texk/web2c/ptexdir/tests/let_char_token.tex | 11 |
3 files changed, 27 insertions, 2 deletions
diff --git a/Build/source/texk/web2c/ptexdir/ChangeLog b/Build/source/texk/web2c/ptexdir/ChangeLog index 779b6f2f2ee..e7a2289424a 100644 --- a/Build/source/texk/web2c/ptexdir/ChangeLog +++ b/Build/source/texk/web2c/ptexdir/ChangeLog @@ -1,3 +1,9 @@ +2019-06-24 Hironobu Yamashita <h.y.acetaminophen@gmail.com> + + * ptex-base.ch: 'Improper alphabetic or KANJI constant' error + should be raised for multibyte CS. + * tests/let_char_token.tex: Added. + 2019-05-28 Hironobu Yamashita <h.y.acetaminophen@gmail.com> * am/ptex.am: Add a new test. diff --git a/Build/source/texk/web2c/ptexdir/ptex-base.ch b/Build/source/texk/web2c/ptexdir/ptex-base.ch index 891861b331e..5b4ff551aff 100644 --- a/Build/source/texk/web2c/ptexdir/ptex-base.ch +++ b/Build/source/texk/web2c/ptexdir/ptex-base.ch @@ -2275,8 +2275,16 @@ 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; -if (cur_val>255)and((cur_cmd<kanji)or(cur_cmd>max_char_code)) then +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; + end; +if (cur_val>255)and(cur_cmd<kanji) then begin print_err("Improper alphabetic or KANJI constant"); @.Improper alphabetic constant@> help2("A one-character control sequence belongs after a ` mark.")@/ diff --git a/Build/source/texk/web2c/ptexdir/tests/let_char_token.tex b/Build/source/texk/web2c/ptexdir/tests/let_char_token.tex new file mode 100644 index 00000000000..2d39d0e3809 --- /dev/null +++ b/Build/source/texk/web2c/ptexdir/tests/let_char_token.tex @@ -0,0 +1,11 @@ +%#!ptex +\newcount\x +\scrollmode +\def\T#1{\x=`#1 \message{\the\x}} +\def\漢{} +\def\aaa{西}\T{\aaa}% err +\def\AAA{s}\T{\AAA} % err +\let\ccc=西\relax\T{\ccc} % err +\T~ \T\a \T{漢} +\T\漢 % err +\end |