diff options
author | Context Git Mirror Bot <phg42.2a@gmail.com> | 2014-05-18 16:15:15 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2014-05-18 16:15:15 +0200 |
commit | 19e74d8d40e9b9fcfbed14174e19ad7af64d3072 (patch) | |
tree | 8e5b6eb3a2a90f9c9c6617302b4b8d65e5140711 /tex/context/base/lpdf-ini.lua | |
parent | cd12b5497dc4a12dc33751a0deffda08b26bcbcd (diff) | |
download | context-19e74d8d40e9b9fcfbed14174e19ad7af64d3072.tar.gz |
2014-05-18 15:59:00
Diffstat (limited to 'tex/context/base/lpdf-ini.lua')
-rw-r--r-- | tex/context/base/lpdf-ini.lua | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/tex/context/base/lpdf-ini.lua b/tex/context/base/lpdf-ini.lua index a89b8b8c5..025f62c4f 100644 --- a/tex/context/base/lpdf-ini.lua +++ b/tex/context/base/lpdf-ini.lua @@ -254,6 +254,8 @@ local f_key_dictionary = formatters["/%s << % t >>"] local f_dictionary = formatters["<< % t >>"] local f_key_array = formatters["/%s [ % t ]"] local f_array = formatters["[ % t ]"] +local f_key_number = formatters["/%s %F"] +local f_tonumber = formatters["%F"] -- local f_key_value = formatters["/%s %s"] -- local f_key_dictionary = formatters["/%s <<% t>>"] @@ -271,6 +273,8 @@ tostring_d = function(t,contentonly,key) local tv = type(v) if tv == "string" then r[rn] = f_key_value(k,toeight(v)) + elseif tv == "number" then + r[rn] = f_key_number(k,v) elseif tv == "unicode" then r[rn] = f_key_value(k,tosixteen(v)) elseif tv == "table" then @@ -309,6 +313,8 @@ tostring_a = function(t,contentonly,key) local tv = type(v) if tv == "string" then r[k] = toeight(v) + elseif tv == "number" then + r[k] = f_tonumber(v) elseif tv == "unicode" then r[k] = tosixteen(v) elseif tv == "table" then @@ -339,14 +345,15 @@ tostring_a = function(t,contentonly,key) end end -local tostring_x = function(t) return concat(t," ") end -local tostring_s = function(t) return toeight(t[1]) end -local tostring_u = function(t) return tosixteen(t[1]) end -local tostring_n = function(t) return tostring(t[1]) end -- tostring not needed -local tostring_c = function(t) return t[1] end -- already prefixed (hashed) -local tostring_z = function() return "null" end -local tostring_t = function() return "true" end -local tostring_f = function() return "false" end +local tostring_x = function(t) return concat(t," ") end +local tostring_s = function(t) return toeight(t[1]) end +local tostring_u = function(t) return tosixteen(t[1]) end +local tostring_n = function(t) return tostring(t[1]) end -- tostring not needed +local tostring_n = function(t) return f_tonumber(t[1]) end -- tostring not needed +local tostring_c = function(t) return t[1] end -- already prefixed (hashed) +local tostring_z = function() return "null" end +local tostring_t = function() return "true" end +local tostring_f = function() return "false" end local tostring_r = function(t) local n = t[1] return n and n > 0 and (n .. " 0 R") or "NULL" end local tostring_v = function(t) |