summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/luatexdir/tex/texmath.w
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/tex/texmath.w')
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/texmath.w113
1 files changed, 23 insertions, 90 deletions
diff --git a/Build/source/texk/web2c/luatexdir/tex/texmath.w b/Build/source/texk/web2c/luatexdir/tex/texmath.w
index 2adf03c5cec..cadbbb02536 100644
--- a/Build/source/texk/web2c/luatexdir/tex/texmath.w
+++ b/Build/source/texk/web2c/luatexdir/tex/texmath.w
@@ -1,28 +1,28 @@
% texmath.w
-
+%
% Copyright 2008-2010 Taco Hoekwater <taco@@luatex.org>
-
+%
% This file is part of LuaTeX.
-
+%
% LuaTeX is free software; you can redistribute it and/or modify it under
% the terms of the GNU General Public License as published by the Free
% Software Foundation; either version 2 of the License, or (at your
% option) any later version.
-
+%
% LuaTeX is distributed in the hope that it will be useful, but WITHOUT
% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
% FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
% License for more details.
-
+%
% You should have received a copy of the GNU General Public License along
% with LuaTeX; if not, see <http://www.gnu.org/licenses/>.
@ @c
-#include "ptexlib.h"
-
static const char _svn_version[] =
- "$Id: texmath.w 4170 2011-04-16 13:16:39Z taco $ "
- "$URL: http://foundry.supelec.fr/svn/luatex/branches/0.70.x/source/texk/web2c/luatexdir/tex/texmath.w $";
+ "$Id: texmath.w 4566 2013-01-22 13:18:15Z khaled $"
+ "$URL: http://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/texmath.w $";
+
+#include "ptexlib.h"
@ @c
#define mode cur_list.mode_field
@@ -396,13 +396,13 @@ pointer new_noad(void)
}
@ @c
-pointer new_sub_box(pointer cur_box)
+pointer new_sub_box(pointer curbox)
{
pointer p, q;
p = new_noad();
q = new_node(sub_box_node, 0);
nucleus(p) = q;
- math_list(nucleus(p)) = cur_box;
+ math_list(nucleus(p)) = curbox;
return p;
}
@@ -596,12 +596,6 @@ static void print_delimiter(pointer p)
/* modern xetex/luatex style */
print_hex(small_fam(p));
print_hex(small_char(p));
- } else {
- /* assume this is omega-style */
- a = small_fam(p) * 65536 + small_char(p);
- print_hex(a);
- a = large_fam(p) * 65536 + large_char(p);
- print_hex(a);
}
}
@@ -1035,7 +1029,7 @@ void enter_display_math(void)
}
@ The next routine parses all variations of a delimiter code. The |extcode|
- tells what syntax form to use (\TeX, Aleph, XeTeX, XeTeXnum, ...) , the
+ tells what syntax form to use (\TeX, XeTeX, XeTeXnum, ...) , the
|doclass| tells whether or not read a math class also (for \.{\\delimiter} c.s.).
(the class is passed on for conversion to \.{\\mathchar}).
@@ -1049,7 +1043,6 @@ static delcodeval do_scan_extdef_del_code(int extcode, boolean doclass)
NULL
};
delcodeval d;
- int cur_val1; /* and the global |cur_val| */
int mcls, msfam = 0, mschr = 0, mlfam = 0, mlchr = 0;
mcls = 0;
if (extcode == tex_mathcode) { /* \.{\\delcode}, this is the easiest */
@@ -1067,24 +1060,6 @@ static delcodeval do_scan_extdef_del_code(int extcode, boolean doclass)
mschr = (cur_val % 0x100000) / 0x1000;
mlfam = (cur_val & 0xFFF) / 0x100;
mlchr = (cur_val % 0x100);
- } else if (extcode == aleph_mathcode) { /* \.{\\odelcode} */
- /* "MFFCCCC"FFCCCC or "FFCCCC"FFCCCC */
- scan_int();
- if (doclass) {
- mcls = (cur_val / 0x1000000);
- cur_val = (cur_val & 0xFFFFFF);
- }
- cur_val1 = cur_val;
- scan_int();
- if ((cur_val1 > 0xFFFFFF) || (cur_val > 0xFFFFFF)) {
- tex_error("Invalid delimiter code", hlp);
- cur_val1 = 0;
- cur_val = 0;
- }
- msfam = (cur_val1 / 0x10000);
- mschr = (cur_val1 % 0x10000);
- mlfam = (cur_val / 0x10000);
- mlchr = (cur_val % 0x10000);
} else if (extcode == xetex_mathcode) { /* \.{\\Udelcode} */
/* <0-7>,<0-0xFF>,<0-0x10FFFF> or <0-0xFF>,<0-0x10FFFF> */
if (doclass) {
@@ -1172,21 +1147,6 @@ mathcodeval scan_mathchar(int extcode)
mcls = (cur_val / 0x1000);
mfam = ((cur_val % 0x1000) / 0x100);
mchr = (cur_val % 0x100);
- } else if (extcode == aleph_mathcode) { /* \.{\\omathcode} */
- /* "TFFCCCC */
- scan_int();
- if (cur_val > 0x8000000) {
- 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;
- }
- mcls = (cur_val / 0x1000000);
- mfam = ((cur_val % 0x1000000) / 0x10000);
- mchr = (cur_val % 0x10000);
} else if (extcode == xetex_mathcode) {
/* <0-0x7> <0-0xFF> <0-0x10FFFF> */
scan_int();
@@ -1269,10 +1229,6 @@ mathcodeval mathchar_from_integer(int value, int extcode)
mval.class_value = (value / 0x1000);
mval.family_value = ((value % 0x1000) / 0x100);
mval.character_value = (value % 0x100);
- } else if (extcode == aleph_mathcode) {
- mval.class_value = (value / 0x1000000);
- mval.family_value = ((value % 0x1000000) / 0x10000);
- mval.character_value = (value % 0x10000);
} else { /* some xetexended xetex thing */
int mfam = (value / 0x200000) & 0x7FF;
mval.class_value = mfam % 0x08;
@@ -1326,10 +1282,8 @@ int scan_math(pointer p, int mstyle)
if (cur_chr == 0)
mval = scan_mathchar(tex_mathcode);
else if (cur_chr == 1)
- mval = scan_mathchar(aleph_mathcode);
- else if (cur_chr == 2)
mval = scan_mathchar(xetex_mathcode);
- else if (cur_chr == 3)
+ else if (cur_chr == 2)
mval = scan_mathchar(xetexnum_mathcode);
else
confusion("scan_math");
@@ -1337,9 +1291,6 @@ int scan_math(pointer p, int mstyle)
case math_given_cmd:
mval = mathchar_from_integer(cur_chr, tex_mathcode);
break;
- case omath_given_cmd:
- mval = mathchar_from_integer(cur_chr, aleph_mathcode);
- break;
case xmath_given_cmd:
mval = mathchar_from_integer(cur_chr, xetex_mathcode);
break;
@@ -1347,8 +1298,6 @@ int scan_math(pointer p, int mstyle)
if (cur_chr == 0)
mval = scan_delimiter_as_mathchar(tex_mathcode);
else if (cur_chr == 1)
- mval = scan_delimiter_as_mathchar(aleph_mathcode);
- else if (cur_chr == 2)
mval = scan_delimiter_as_mathchar(xetex_mathcode);
else
confusion("scan_math");
@@ -1489,8 +1438,6 @@ static void scan_delimiter(pointer p, int r)
delcodeval dval = { 0, 0, 0, 0, 0, 0 };
if (r == tex_mathcode) { /* \.{\\radical} */
dval = do_scan_extdef_del_code(tex_mathcode, true);
- } else if (r == aleph_mathcode) { /* \.{\\oradical} */
- dval = do_scan_extdef_del_code(aleph_mathcode, true);
} else if (r == xetex_mathcode) { /* \.{\\Uradical} */
dval = do_scan_extdef_del_code(xetex_mathcode, false);
} else if (r == no_mathcode) {
@@ -1503,9 +1450,7 @@ static void scan_delimiter(pointer p, int r)
case delim_num_cmd:
if (cur_chr == 0) /* \.{\\delimiter} */
dval = do_scan_extdef_del_code(tex_mathcode, true);
- else if (cur_chr == 1) /* \.{\\odelimiter} */
- dval = do_scan_extdef_del_code(aleph_mathcode, true);
- else if (cur_chr == 2) /* \.{\\Udelimiter} */
+ else if (cur_chr == 1) /* \.{\\Udelimiter} */
dval = do_scan_extdef_del_code(xetex_mathcode, true);
else
confusion("scan_delimiter1");
@@ -1554,23 +1499,21 @@ void math_radical(void)
left_delimiter(tail) = q;
if (chr_code == 0) /* \.{\\radical} */
scan_delimiter(left_delimiter(tail), tex_mathcode);
- else if (chr_code == 1) /* \.{\\oradical} */
- scan_delimiter(left_delimiter(tail), aleph_mathcode);
- else if (chr_code == 2) /* \.{\\Uradical} */
+ else if (chr_code == 1) /* \.{\\Uradical} */
scan_delimiter(left_delimiter(tail), xetex_mathcode);
- else if (chr_code == 3) /* \.{\\Uroot} */
+ else if (chr_code == 2) /* \.{\\Uroot} */
scan_delimiter(left_delimiter(tail), xetex_mathcode);
- else if (chr_code == 4) /* \.{\\Uunderdelimiter} */
+ else if (chr_code == 3) /* \.{\\Uunderdelimiter} */
scan_delimiter(left_delimiter(tail), xetex_mathcode);
- else if (chr_code == 5) /* \.{\\Uoverdelimiter} */
+ else if (chr_code == 4) /* \.{\\Uoverdelimiter} */
scan_delimiter(left_delimiter(tail), xetex_mathcode);
- else if (chr_code == 6) /* \.{\\Udelimiterunder} */
+ else if (chr_code == 5) /* \.{\\Udelimiterunder} */
scan_delimiter(left_delimiter(tail), xetex_mathcode);
- else if (chr_code == 7) /* \.{\\Udelimiterover} */
+ else if (chr_code == 6) /* \.{\\Udelimiterover} */
scan_delimiter(left_delimiter(tail), xetex_mathcode);
else
confusion("math_radical");
- if (chr_code == 3) {
+ if (chr_code == 2) {
/* the trick with the |vlink(q)| is used by |scan_math|
to decide whether it needs to go on */
q = new_node(math_char_node, 0);
@@ -1606,9 +1549,7 @@ void math_ac(void)
tail_append(new_node(accent_noad, 0));
if (cur_chr == 0) { /* \.{\\mathaccent} */
t = scan_mathchar(tex_mathcode);
- } else if (cur_chr == 1) { /* \.{\\omathaccent} */
- t = scan_mathchar(aleph_mathcode);
- } else if (cur_chr == 2) { /* \.{\\Umathaccent} */
+ } else if (cur_chr == 1) { /* \.{\\Umathaccent} */
if (scan_keyword("fixed")) {
subtype(tail) = 1;
t = scan_mathchar(xetex_mathcode);
@@ -1629,13 +1570,6 @@ void math_ac(void)
} else {
t = scan_mathchar(xetex_mathcode);
}
- } else if (cur_chr == 3) { /* deprecated: \.{\\Umathbotaccent} */
- pdftex_warn("\\Umathbotaccent is deprecated, please update to \\Umathaccent bottom");
- b = scan_mathchar(xetex_mathcode);
- } else if (cur_chr == 4) { /* deprecated: \.{\\Umathaccents} */
- pdftex_warn("\\Umathaccents is deprecated, please update to \\Umathaccent both");
- t = scan_mathchar(xetex_mathcode);
- b = scan_mathchar(xetex_mathcode);
} else {
confusion("math_ac");
}
@@ -1868,7 +1802,6 @@ surround an accent that is the nucleus of an Ord atom.
@c
void close_math_group(pointer p)
{
- pointer q;
int old_style = m_style;
unsave_math();
@@ -1899,7 +1832,7 @@ void close_math_group(pointer p)
if (saved_value(0) == nucleus(tail)) {
if (type(tail) == simple_noad
&& subtype(tail) == ord_noad_type) {
- q = head;
+ pointer q = head;
while (vlink(q) != tail)
q = vlink(q);
vlink(q) = p;