diff options
author | Marius <mariausol@gmail.com> | 2011-06-08 20:40:24 +0300 |
---|---|---|
committer | Marius <mariausol@gmail.com> | 2011-06-08 20:40:24 +0300 |
commit | e5fe861660d5cf60cfeb67f7e57f659b309e9613 (patch) | |
tree | f5bc4ea0cd61f18c096f0fd5df8cf439700ba71e /tex/context/base/syst-con.lua | |
parent | b17f22aa285224dcf5b1dbccd795bc73b9a16426 (diff) | |
download | context-e5fe861660d5cf60cfeb67f7e57f659b309e9613.tar.gz |
beta 2011.06.08 19:06
Diffstat (limited to 'tex/context/base/syst-con.lua')
-rw-r--r-- | tex/context/base/syst-con.lua | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tex/context/base/syst-con.lua b/tex/context/base/syst-con.lua index bcc020528..f78d83011 100644 --- a/tex/context/base/syst-con.lua +++ b/tex/context/base/syst-con.lua @@ -14,7 +14,8 @@ the top of <l n='luatex'/>'s char range but outside the unicode range.</p> --ldx]]-- local tonumber = tonumber -local char, texsprint, format = unicode.utf8.char, tex.sprint, string.format +local char, texsprint = unicode.utf8.char, tex.sprint +local gsub, format = string.gsub, string.format function converters.hexstringtonumber(n) tonumber(n,16) end function converters.octstringtonumber(n) tonumber(n, 8) end @@ -33,3 +34,8 @@ function commands.uchexnumber (n) context(format("%X" ,n)) end function commands.lchexnumbers (n) context(format("%02x",n)) end function commands.uchexnumbers (n) context(format("%02X",n)) end function commands.octnumber (n) context(format("%03o",n)) end + +function commands.format(fmt,...) + fmt = gsub(fmt,"@","%%") + context(fmt,...) +end |