summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/syst-aux.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2018-11-29 20:53:37 +0100
committerContext Git Mirror Bot <phg@phi-gamma.net>2018-11-29 20:53:37 +0100
commit9bd28a3039a458b054459fe1ef80161b107b798f (patch)
treec15bf6aedc4313de999a97bf92dc63b16ca60794 /tex/context/base/mkiv/syst-aux.lua
parent744095aa4676553437db0d71c281a74557a3222f (diff)
downloadcontext-9bd28a3039a458b054459fe1ef80161b107b798f.tar.gz
2018-11-29 19:54:00
Diffstat (limited to 'tex/context/base/mkiv/syst-aux.lua')
-rw-r--r--tex/context/base/mkiv/syst-aux.lua44
1 files changed, 41 insertions, 3 deletions
diff --git a/tex/context/base/mkiv/syst-aux.lua b/tex/context/base/mkiv/syst-aux.lua
index 5072879fa..f3ab7ff61 100644
--- a/tex/context/base/mkiv/syst-aux.lua
+++ b/tex/context/base/mkiv/syst-aux.lua
@@ -323,9 +323,47 @@ end
implement { name = "texdefinition_one", actions = texdefinition_one, scope = "private", arguments = "string" }
implement { name = "texdefinition_two", actions = texdefinition_two, scope = "private" }
-implement { name = "upper", arguments = "string", actions = { utf.upper, context } }
-implement { name = "lower", arguments = "string", actions = { utf.lower, context } }
-implement { name = "strip", arguments = "string", actions = { string.strip, context } } -- or utf.strip
+do
+
+ -- Quite probably we don't yet have characters loaded so we delay some
+ -- aliases.
+
+ local _lower_, _upper_, _strip_
+
+ _lower_ = function(s)
+ if characters and characters.lower then
+ _lower_ = characters.lower
+ return _lower_(s)
+ end
+ return string.lower(s)
+ end
+
+ _upper_ = function(s)
+ if characters and characters.upper then
+ _upper_ = characters.upper
+ return _upper_(s)
+ end
+ return string.upper(s)
+ end
+
+ _strip_ = function(s)
+ -- or utf.strip
+ if string.strip then
+ _strip_ = string.strip
+ return _strip_(s)
+ end
+ return s
+ end
+
+ local function lower() context(_lower_(s)) end
+ local function upper() context(_upper_(s)) end
+ local function strip() context(_strip_(s)) end
+
+ implement { name = "upper", arguments = "string", actions = upper }
+ implement { name = "lower", arguments = "string", actions = lower }
+ implement { name = "strip", arguments = "string", actions = strip }
+
+end
implement {
name = "converteddimen",