diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2015-12-19 04:43:01 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2015-12-19 04:43:01 +0000 |
commit | aff8cf6c52a5cf470b600e0d5898446af7b313d0 (patch) | |
tree | be65082c0db0af514075e4839f0109a5bed8f15a /Build/source/texk/web2c/luatexdir/tex | |
parent | 6d1ade1093cb96b932388c39e2ebab80a645e675 (diff) |
web2c/luatexdir: sync with the upstream
git-svn-id: svn://tug.org/texlive/trunk@39146 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/tex')
-rw-r--r-- | Build/source/texk/web2c/luatexdir/tex/mathcodes.w | 4 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/tex/texmath.w | 34 |
2 files changed, 27 insertions, 11 deletions
diff --git a/Build/source/texk/web2c/luatexdir/tex/mathcodes.w b/Build/source/texk/web2c/luatexdir/tex/mathcodes.w index 062e271055a..4acd887eace 100644 --- a/Build/source/texk/web2c/luatexdir/tex/mathcodes.w +++ b/Build/source/texk/web2c/luatexdir/tex/mathcodes.w @@ -304,7 +304,9 @@ int get_del_code_num(int n) static void initializedelcode(void) { sa_tree_item sa_value = { 0 }; - sa_value.uint_value = DELCODEDEFAULT; + /* sa_value.uint_value = DELCODEDEFAULT; */ + sa_value.dump_uint.value_1 = DELCODEDEFAULT; + sa_value.dump_uint.value_2 = 0; delcode_head = new_sa_tree(DELCODESTACK, 2, sa_value); } diff --git a/Build/source/texk/web2c/luatexdir/tex/texmath.w b/Build/source/texk/web2c/luatexdir/tex/texmath.w index 16224f09ff0..661830bb16c 100644 --- a/Build/source/texk/web2c/luatexdir/tex/texmath.w +++ b/Build/source/texk/web2c/luatexdir/tex/texmath.w @@ -1191,17 +1191,31 @@ mathcodeval scan_mathchar(int extcode) /* "TFCC */ scan_int(); if (cur_val > 0x8000) { - tex_error("Invalid math code", hlp); - cur_val = 0; - } - if (cur_val < 0) { - snprintf(errstr, 255, "Bad mathchar (%d)", (int)cur_val); - tex_error(errstr, hlp); - cur_val = 0; + /* + tex_error("Invalid math code", hlp); + cur_val = 0; + */ + /* needed for latex: fallback to umathnum_mathcode */ + mfam = (cur_val / 0x200000) & 0x7FF; + mcls = mfam % 0x08; + mfam = mfam / 0x08; + mchr = cur_val & 0x1FFFFF; + if (mchr > 0x10FFFF) { + tex_error("Invalid math code during > 0x8000 mathcode fallback", hlp); + mcls = 0; + mfam = 0; + mchr = 0; + } + } else { + if (cur_val < 0) { + snprintf(errstr, 255, "Bad mathchar (%d)", (int)cur_val); + tex_error(errstr, hlp); + cur_val = 0; + } + mcls = (cur_val / 0x1000); + mfam = ((cur_val % 0x1000) / 0x100); + mchr = (cur_val % 0x100); } - mcls = (cur_val / 0x1000); - mfam = ((cur_val % 0x1000) / 0x100); - mchr = (cur_val % 0x100); } else if (extcode == umath_mathcode) { /* <0-0x7> <0-0xFF> <0-0x10FFFF> */ scan_int(); |