summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/math-ini.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/mkiv/math-ini.lua')
-rw-r--r--tex/context/base/mkiv/math-ini.lua42
1 files changed, 31 insertions, 11 deletions
diff --git a/tex/context/base/mkiv/math-ini.lua b/tex/context/base/mkiv/math-ini.lua
index 5c495dbd7..b79ef8c8c 100644
--- a/tex/context/base/mkiv/math-ini.lua
+++ b/tex/context/base/mkiv/math-ini.lua
@@ -15,6 +15,7 @@ if not modules then modules = { } end modules ['math-ini'] = {
-- to the fam when set ... we use other means .. ok, we could use it for spacing but
-- then we also have to set the other characters (only a subset done now)
+local next, type = next, type
local formatters, find = string.formatters, string.find
local utfchar, utfbyte, utflength = utf.char, utf.byte, utf.length
----- floor = math.floor
@@ -314,15 +315,29 @@ function mathematics.define(family)
local mathclass = character.mathclass
local mathspec = character.mathspec
if mathspec then
+ if mathclass then
+ local name = character.mathname
+ if name then
+ report_math("fatal error, conlicting mathclass and mathspec for %C",unicode)
+ os.exit()
+ else
+ local class = classes[mathclass] or mathclass -- no real checks needed
+ if not class then
+ if trace_defining then
+ report("unknown",family,unicode)
+ end
+ else
+ if trace_defining then
+ report(class,family,unicode)
+ end
+ mset, dset = setmathcharacter(class,family,unicode,unicode,mset,dset)
+ end
+ end
+ end
for i=1,#mathspec do
local m = mathspec[i]
local name = m.name
local class = m.class
- if not class then
- class = mathclass
- elseif not mathclass then
- mathclass = class
- end
if class then
class = classes[class] or class -- no real checks needed
if name then
@@ -331,7 +346,7 @@ function mathematics.define(family)
end
setmathsymbol(name,class,family,unicode)
else
- name = class == classes.variable or class == classes.number and character.adobename
+ name = (class == classes.variable or class == classes.number) and character.adobename -- bad
if name and trace_defining then
report(class,family,unicode,name)
end
@@ -339,17 +354,22 @@ function mathematics.define(family)
mset, dset = setmathcharacter(class,family,unicode,m.unicode or unicode,mset,dset) -- see solidus
end
end
- end
- if mathclass then
+ elseif mathclass then
local name = character.mathname
local class = classes[mathclass] or mathclass -- no real checks needed
- if name == false then
+ if not class then
+ if trace_defining then
+ report("unknown",family,unicode,name)
+ end
+ elseif name == false then
if trace_defining then
report(class,family,unicode,name)
end
- mset, dset = setmathcharacter(class,family,unicode,mset,dset)
+ mset, dset = setmathcharacter(class,family,unicode,unicode,mset,dset)
else
- name = name or character.contextname
+ -- if not name then
+ -- name = character.contextname -- too dangerous, we loose textslash and a few more
+ -- end
if name then
if trace_defining then
report(class,family,unicode,name)