diff options
-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 |