diff options
author | Context Git Mirror Bot <phg42.2a@gmail.com> | 2014-10-14 11:15:04 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2014-10-14 11:15:04 +0200 |
commit | b37d4b7219f0631cb86b5c2f2fd794dbf57acc3e (patch) | |
tree | a64faa6acffa67b68de9088ebe9f90aad6cfb6f2 /tex/context/base/lpdf-ini.lua | |
parent | e49641aced5df5d5ee289f58a73519eef76a22e3 (diff) | |
download | context-b37d4b7219f0631cb86b5c2f2fd794dbf57acc3e.tar.gz |
2014-10-14 10:59:00
Diffstat (limited to 'tex/context/base/lpdf-ini.lua')
-rw-r--r-- | tex/context/base/lpdf-ini.lua | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/tex/context/base/lpdf-ini.lua b/tex/context/base/lpdf-ini.lua index 033895cdc..6167b86cc 100644 --- a/tex/context/base/lpdf-ini.lua +++ b/tex/context/base/lpdf-ini.lua @@ -313,6 +313,7 @@ local function merge_t(a,b) return setmetatable(t,getmetatable(a)) end +local f_key_null = formatters["/%s null"] local f_key_value = formatters["/%s %s"] local f_key_dictionary = formatters["/%s << % t >>"] local f_dictionary = formatters["<< % t >>"] @@ -344,7 +345,12 @@ tostring_d = function(t,contentonly,key) elseif tv == "table" then local mv = getmetatable(v) if mv and mv.__lpdftype then - r[rn] = f_key_value(k,tostring(v)) + -- if v == t then + -- report_objects("ignoring circular reference in dirctionary") + -- r[rn] = f_key_null(k) + -- else + r[rn] = f_key_value(k,tostring(v)) + -- end elseif v[1] then r[rn] = f_key_value(k,tostring_a(v)) else @@ -385,7 +391,12 @@ tostring_a = function(t,contentonly,key) local mv = getmetatable(v) local mt = mv and mv.__lpdftype if mt then - r[k] = tostring(v) + -- if v == t then + -- report_objects("ignoring circular reference in array") + -- r[k] = "null" + -- else + r[k] = tostring(v) + -- end elseif v[1] then r[k] = tostring_a(v) else @@ -413,7 +424,7 @@ local tostring_x = function(t) return concat(t," ") end local tostring_s = function(t) return toeight(t[1]) end local tostring_p = function(t) return topdfdoc(t[1],t[2]) end local tostring_u = function(t) return tosixteen(t[1]) end -local tostring_n = function(t) return tostring(t[1]) end -- tostring not needed +----- 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 |