diff options
author | Philipp Gesang <phg42.2a@gmail.com> | 2014-04-05 19:35:09 +0200 |
---|---|---|
committer | Philipp Gesang <phg42.2a@gmail.com> | 2014-04-05 19:35:09 +0200 |
commit | 85dfdde68749113ca30d5a32190dfe34fb7c4da0 (patch) | |
tree | be71ef821cfb3b105b87f2c1a965a0f140316eaf | |
parent | f8fa3ab7afa4746d534a8d660b7d6bf9d28a0e9c (diff) | |
download | lualibs-85dfdde68749113ca30d5a32190dfe34fb7c4da0.tar.gz |
sync with Context as of 2014-04-05
-rw-r--r-- | lualibs-lua.lua | 11 | ||||
-rw-r--r-- | lualibs-unicode.lua | 9 | ||||
-rw-r--r-- | lualibs-util-str.lua | 2 |
3 files changed, 21 insertions, 1 deletions
diff --git a/lualibs-lua.lua b/lualibs-lua.lua index 4a96b0b..9565f48 100644 --- a/lualibs-lua.lua +++ b/lualibs-lua.lua @@ -6,6 +6,17 @@ if not modules then modules = { } end modules ['l-lua'] = { license = "see context related readme files" } +-- potential issues with 5.3: + +-- i'm not sure yet if the int/float change is good for luatex + +-- math.min +-- math.max +-- tostring +-- tonumber +-- utf.* +-- bit32 + -- compatibility hacksand helpers local major, minor = string.match(_VERSION,"^[^%d]+(%d+)%.(%d+).*$") diff --git a/lualibs-unicode.lua b/lualibs-unicode.lua index 6601a4c..be61f3d 100644 --- a/lualibs-unicode.lua +++ b/lualibs-unicode.lua @@ -6,7 +6,14 @@ if not modules then modules = { } end modules ['l-unicode'] = { license = "see context related readme files" } --- this module will be reorganized +-- in lua 5.3: + +-- utf8.char(ยทยทยท) : concatinated +-- utf8.charpatt : "[\0-\x7F\xC2-\xF4][\x80-\xBF]*" +-- utf8.codes(s) : for p, c in utf8.codes(s) do body end +-- utf8.codepoint(s [, i [, j]]) +-- utf8.len(s [, i]) +-- utf8.offset(s, n [, i]) -- todo: utf.sub replacement (used in syst-aux) -- we put these in the utf namespace: diff --git a/lualibs-util-str.lua b/lualibs-util-str.lua index 578f4d0..52c48ba 100644 --- a/lualibs-util-str.lua +++ b/lualibs-util-str.lua @@ -47,10 +47,12 @@ if not number then number = { } end -- temp hack for luatex-fonts local stripper = patterns.stripzeros local function points(n) + n = tonumber(n) return (not n or n == 0) and "0pt" or lpegmatch(stripper,format("%.5fpt",n/65536)) end local function basepoints(n) + n = tonumber(n) return (not n or n == 0) and "0bp" or lpegmatch(stripper,format("%.5fbp", n*(7200/7227)/65536)) end |