summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.rst (renamed from README)0
-rw-r--r--scripts/context/lua/mtxrun.lua12
-rw-r--r--scripts/context/stubs/mswin/mtxrun.lua12
-rw-r--r--scripts/context/stubs/unix/mtxrun12
-rw-r--r--scripts/context/stubs/win64/mtxrun.lua12
-rw-r--r--tex/context/base/cont-new.mkiv2
-rw-r--r--tex/context/base/context-version.pdfbin4062 -> 4283 bytes
-rw-r--r--tex/context/base/context.mkiv2
-rw-r--r--tex/context/base/lpdf-ini.lua23
-rw-r--r--tex/context/base/publ-dat.lua69
-rw-r--r--tex/context/base/publ-ini.lua30
-rw-r--r--tex/context/base/publ-ini.mkiv29
-rw-r--r--tex/context/base/status-files.pdfbin24618 -> 24609 bytes
-rw-r--r--tex/context/base/status-lua.pdfbin243725 -> 244006 bytes
-rw-r--r--tex/context/base/util-str.lua7
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua8
16 files changed, 144 insertions, 74 deletions
diff --git a/README b/README.rst
index 3d716e98e..3d716e98e 100644
--- a/README
+++ b/README.rst
diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua
index cd8b6cc4e..c3d411162 100644
--- a/scripts/context/lua/mtxrun.lua
+++ b/scripts/context/lua/mtxrun.lua
@@ -4871,7 +4871,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["util-str"] = package.loaded["util-str"] or true
--- original size: 32843, stripped down to: 18226
+-- original size: 33063, stripped down to: 18397
if not modules then modules={} end modules ['util-str']={
version=1.001,
@@ -5186,7 +5186,11 @@ local format_f=function(f)
end
local format_F=function(f)
n=n+1
- return format("((a%s == 0 and '0') or (a%s == 1 and '1') or format('%%%sf',a%s))",n,n,f,n)
+ if not f or f=="" then
+ return format("(((a%s > -0.0000000005 and a%s < 0.0000000005) and '0') or (a%s == 1 and '1') or format('%%.9f',a%s))",n,n,n,n)
+ else
+ return format("((a%s == 0 and '0') or (a%s == 1 and '1') or format('%%%sf',a%s))",n,n,f,n)
+ end
end
local format_g=function(f)
n=n+1
@@ -16875,8 +16879,8 @@ end -- of closure
-- used libraries : l-lua.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-mrg.lua util-tpl.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua
-- skipped libraries : -
--- original bytes : 694739
--- stripped bytes : 246658
+-- original bytes : 694959
+-- stripped bytes : 246707
-- end library merge
diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua
index cd8b6cc4e..c3d411162 100644
--- a/scripts/context/stubs/mswin/mtxrun.lua
+++ b/scripts/context/stubs/mswin/mtxrun.lua
@@ -4871,7 +4871,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["util-str"] = package.loaded["util-str"] or true
--- original size: 32843, stripped down to: 18226
+-- original size: 33063, stripped down to: 18397
if not modules then modules={} end modules ['util-str']={
version=1.001,
@@ -5186,7 +5186,11 @@ local format_f=function(f)
end
local format_F=function(f)
n=n+1
- return format("((a%s == 0 and '0') or (a%s == 1 and '1') or format('%%%sf',a%s))",n,n,f,n)
+ if not f or f=="" then
+ return format("(((a%s > -0.0000000005 and a%s < 0.0000000005) and '0') or (a%s == 1 and '1') or format('%%.9f',a%s))",n,n,n,n)
+ else
+ return format("((a%s == 0 and '0') or (a%s == 1 and '1') or format('%%%sf',a%s))",n,n,f,n)
+ end
end
local format_g=function(f)
n=n+1
@@ -16875,8 +16879,8 @@ end -- of closure
-- used libraries : l-lua.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-mrg.lua util-tpl.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua
-- skipped libraries : -
--- original bytes : 694739
--- stripped bytes : 246658
+-- original bytes : 694959
+-- stripped bytes : 246707
-- end library merge
diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun
index cd8b6cc4e..c3d411162 100644
--- a/scripts/context/stubs/unix/mtxrun
+++ b/scripts/context/stubs/unix/mtxrun
@@ -4871,7 +4871,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["util-str"] = package.loaded["util-str"] or true
--- original size: 32843, stripped down to: 18226
+-- original size: 33063, stripped down to: 18397
if not modules then modules={} end modules ['util-str']={
version=1.001,
@@ -5186,7 +5186,11 @@ local format_f=function(f)
end
local format_F=function(f)
n=n+1
- return format("((a%s == 0 and '0') or (a%s == 1 and '1') or format('%%%sf',a%s))",n,n,f,n)
+ if not f or f=="" then
+ return format("(((a%s > -0.0000000005 and a%s < 0.0000000005) and '0') or (a%s == 1 and '1') or format('%%.9f',a%s))",n,n,n,n)
+ else
+ return format("((a%s == 0 and '0') or (a%s == 1 and '1') or format('%%%sf',a%s))",n,n,f,n)
+ end
end
local format_g=function(f)
n=n+1
@@ -16875,8 +16879,8 @@ end -- of closure
-- used libraries : l-lua.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-mrg.lua util-tpl.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua
-- skipped libraries : -
--- original bytes : 694739
--- stripped bytes : 246658
+-- original bytes : 694959
+-- stripped bytes : 246707
-- end library merge
diff --git a/scripts/context/stubs/win64/mtxrun.lua b/scripts/context/stubs/win64/mtxrun.lua
index cd8b6cc4e..c3d411162 100644
--- a/scripts/context/stubs/win64/mtxrun.lua
+++ b/scripts/context/stubs/win64/mtxrun.lua
@@ -4871,7 +4871,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["util-str"] = package.loaded["util-str"] or true
--- original size: 32843, stripped down to: 18226
+-- original size: 33063, stripped down to: 18397
if not modules then modules={} end modules ['util-str']={
version=1.001,
@@ -5186,7 +5186,11 @@ local format_f=function(f)
end
local format_F=function(f)
n=n+1
- return format("((a%s == 0 and '0') or (a%s == 1 and '1') or format('%%%sf',a%s))",n,n,f,n)
+ if not f or f=="" then
+ return format("(((a%s > -0.0000000005 and a%s < 0.0000000005) and '0') or (a%s == 1 and '1') or format('%%.9f',a%s))",n,n,n,n)
+ else
+ return format("((a%s == 0 and '0') or (a%s == 1 and '1') or format('%%%sf',a%s))",n,n,f,n)
+ end
end
local format_g=function(f)
n=n+1
@@ -16875,8 +16879,8 @@ end -- of closure
-- used libraries : l-lua.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-mrg.lua util-tpl.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua
-- skipped libraries : -
--- original bytes : 694739
--- stripped bytes : 246658
+-- original bytes : 694959
+-- stripped bytes : 246707
-- end library merge
diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv
index cded7454f..e20a7df91 100644
--- a/tex/context/base/cont-new.mkiv
+++ b/tex/context/base/cont-new.mkiv
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2014.05.17 23:46}
+\newcontextversion{2014.05.18 15:57}
%D This file is loaded at runtime, thereby providing an excellent place for
%D hacks, patches, extensions and new features.
diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf
index 2b973ae9b..acc0c1f36 100644
--- a/tex/context/base/context-version.pdf
+++ b/tex/context/base/context-version.pdf
Binary files differ
diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv
index ef3c639e3..abf7d5c14 100644
--- a/tex/context/base/context.mkiv
+++ b/tex/context/base/context.mkiv
@@ -28,7 +28,7 @@
%D up and the dependencies are more consistent.
\edef\contextformat {\jobname}
-\edef\contextversion{2014.05.17 23:46}
+\edef\contextversion{2014.05.18 15:57}
\edef\contextkind {beta}
%D For those who want to use this:
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)
diff --git a/tex/context/base/publ-dat.lua b/tex/context/base/publ-dat.lua
index da2fe1f6c..5e255029a 100644
--- a/tex/context/base/publ-dat.lua
+++ b/tex/context/base/publ-dat.lua
@@ -77,53 +77,46 @@ local defaultshortcuts = {
local l_splitter = lpeg.tsplitat("+")
local d_splitter = lpeg.splitat ("+")
-function publications.new(name)
- publicationsstats.nofdatasets = publicationsstats.nofdatasets + 1
- local function getcombinedluadata(t,k)
- if find(k,"%+") then
- local tags = lpegmatch(l_splitter,k)
- local parent = tags[i]
- local first = rawget(t,parent)
- if first then
- local combined = first.combined
- if not combined then
- combined = { }
- first.combined = combined
- end
- -- add new ones but only once
- for i=1,#tags do
- local tag = tags[i]
- local new = true
- for j=1,#combined do
- if combined[j] == tag then
- new = false
- end
+function publications.parenttag(dataset,tag)
+ if find(tag,"%+") then
+ local tags = lpegmatch(l_splitter,tag)
+ local parent = tags[1]
+ local luadata = datasets[dataset].luadata
+ local first = luadata[parent]
+ if first then
+ local combined = first.combined
+ if not combined then
+ combined = { }
+ first.combined = combined
+ end
+ -- add new ones but only once
+ for i=2,#tags do
+ local tag = tags[i]
+ for j=1,#combined do
+ if combined[j] == tag then
+ tag = false
end
- if new then
- local entry = rawget(t,tag)
- if entry then
- combined[#combined+1] = tag
- entry.combined[parent] = true
- end
+ end
+ if tag then
+ local entry = luadata[tag]
+ if entry then
+ combined[#combined+1] = tag
end
end
- return first
end
+ return parent
end
end
- local function getcombineddetails(t,k)
- if find(k,"%+") then
- local tag = lpegmatch(d_splitter,k)
- return rawget(t,tag)
- end
- end
- local luadata = setmetatableindex({ },getcombinedluadata)
- local details = setmetatableindex({ },getcombineddetails)
+ return tag
+end
+
+function publications.new(name)
+ publicationsstats.nofdatasets = publicationsstats.nofdatasets + 1
local dataset = {
name = name or "dataset " .. publicationsstats.nofdatasets,
nofentries = 0,
shortcuts = { },
- luadata = luadata,
+ luadata = { },
xmldata = xmlconvert(xmlplaceholder),
-- details = { },
nofbytes = 0,
@@ -145,7 +138,7 @@ function publications.new(name)
setmetatableindex(dataset,function(t,k)
-- will become a plugin
if k == "details" and publications.enhance then
- dataset.details = details
+ dataset.details = { }
publications.enhance(dataset.name)
return dataset.details
end
diff --git a/tex/context/base/publ-ini.lua b/tex/context/base/publ-ini.lua
index 09f4b0e11..d713f552c 100644
--- a/tex/context/base/publ-ini.lua
+++ b/tex/context/base/publ-ini.lua
@@ -116,6 +116,7 @@ local ctx_gobbleoneargument = context.gobbleoneargument
local ctx_btxdirectlink = context.btxdirectlink
local ctx_btxhandlelistentry = context.btxhandlelistentry
local ctx_btxchecklistentry = context.btxchecklistentry
+local ctx_btxchecklistcombi = context.btxchecklistcombi
----- ctx_dodirectfullreference = context.dodirectfullreference
local ctx_btxsetreference = context.btxsetreference
local ctx_directsetup = context.directsetup
@@ -1016,18 +1017,32 @@ function lists.flushentries(dataset,sortvariant)
list = sort(dataset,rendering,list) or list
end
for i=1,#list do
- ctx_setvalue("currentbtxindex",i)
- -- todo: also flush combinations
- ctx_btxhandlelistentry(list[i][1]) -- we can pass i here too ... more efficient to avoid the setvalue
- end
+-- ctx_setvalue("currentbtxindex",i) -- todo: helper
+-- -- todo: also flush combinations
+-- ctx_btxhandlelistentry(list[i][1]) -- we can pass i here too ... more efficient to avoid the setvalue
+ local tag = list[i][1]
+ local entry = datasets[dataset].luadata[tag]
+ if entry then
+ ctx_setvalue("currentbtxindex",i) -- todo: helper
+ local combined = entry.combined
+ if combined then
+ ctx_setvalue("currentbtxcombis",concat(combined,","))
+ else
+ ctx_setvalue("currentbtxcombis","")
+ end
+ ctx_btxhandlelistentry(tag) -- pas i instead
+ end
+ end
end
function lists.fetchentries(dataset)
local list = renderings[dataset].list
for i=1,#list do
- ctx_setvalue("currentbtxindex",i)
- -- todo: what to do with combinations
- ctx_btxchecklistentry(list[i][1])
+ local tag = list[i][1]
+ local entry = datasets[dataset].luadata[tag]
+ if entry then
+ ctx_btxchecklistentry(tag) -- integrate doifalreadyplaced here
+ end
end
end
@@ -1262,6 +1277,7 @@ local f_missing = formatters["<%s>"]
-- maybe also sparse (e.g. pages)
local function processcite(dataset,reference,mark,compress,setup,getter,setter,compressor)
+ reference = publications.parenttag(dataset,reference)
local found, todo, list = findallused(dataset,reference)
if found and setup then
local source = { }
diff --git a/tex/context/base/publ-ini.mkiv b/tex/context/base/publ-ini.mkiv
index 0b1a92300..68e185f23 100644
--- a/tex/context/base/publ-ini.mkiv
+++ b/tex/context/base/publ-ini.mkiv
@@ -350,12 +350,34 @@
\fi
\to \everydefinebtxrendering
+% \unexpanded\def\btx_entry_inject
+% {\begingroup
+% \edef\currentbtxcategory{\btxfield{category}}%
+% \ignorespaces
+% \directsetup{\s!btx:\currentbtxalternative:\currentbtxcategory}%
+% \removeunwantedspaces
+% \endgroup}
+
+\let\currentbtxcombis\empty % goes into the setups
+
\unexpanded\def\btx_entry_inject
{\begingroup
\edef\currentbtxcategory{\btxfield{category}}%
\ignorespaces
\directsetup{\s!btx:\currentbtxalternative:\currentbtxcategory}%
\removeunwantedspaces
+ \ifx\currentbtxcombis\empty \else
+ ;\space % todo .. parameter .. what is a good name .. problem: what if ends with .
+ \processcommacommand[\currentbtxcombis]\btx_entry_inject_combi
+ \fi
+ \endgroup}
+
+\def\btx_entry_inject_combi#1%
+ {\begingroup
+ \def\currentbtxtag{#1}%
+ \ignorespaces
+ \directsetup{\s!btx:\currentbtxalternative:\currentbtxcategory}%
+ \removeunwantedspaces
\endgroup}
\unexpanded\def\completebtxrendering{\dodoubleempty\publ_place_list_complete}
@@ -489,6 +511,13 @@
\fi
\endgroup}
+\unexpanded\def\btxchecklistcombi#1% called at the lua end
+ {\begingroup
+ \edef\currentbtxtag{#1}%
+ ; % todo
+ \publ_check_list_entry
+ \endgroup}
+
\unexpanded\def\publ_check_list_entry
{\global\advance\btxcounter\plusone
% todo, switch to font
diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf
index 5480e6dd9..7efcee997 100644
--- a/tex/context/base/status-files.pdf
+++ b/tex/context/base/status-files.pdf
Binary files differ
diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf
index a41068eda..ea3539ae7 100644
--- a/tex/context/base/status-lua.pdf
+++ b/tex/context/base/status-lua.pdf
Binary files differ
diff --git a/tex/context/base/util-str.lua b/tex/context/base/util-str.lua
index 52c48badd..5609cdf25 100644
--- a/tex/context/base/util-str.lua
+++ b/tex/context/base/util-str.lua
@@ -284,6 +284,7 @@ end
-- octal %...o number
-- string %...s string number
-- float %...f number
+-- checked float %...F number
-- exponential %...e number
-- exponential %...E number
-- autofloat %...g number
@@ -526,7 +527,11 @@ end
local format_F = function(f)
n = n + 1
- return format("((a%s == 0 and '0') or (a%s == 1 and '1') or format('%%%sf',a%s))",n,n,f,n)
+ if not f or f == "" then
+ return format("(((a%s > -0.0000000005 and a%s < 0.0000000005) and '0') or (a%s == 1 and '1') or format('%%.9f',a%s))",n,n,n,n)
+ else
+ return format("((a%s == 0 and '0') or (a%s == 1 and '1') or format('%%%sf',a%s))",n,n,f,n)
+ end
end
local format_g = function(f)
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index f7801ea05..4dfefd656 100644
--- a/tex/generic/context/luatex/luatex-fonts-merged.lua
+++ b/tex/generic/context/luatex/luatex-fonts-merged.lua
@@ -1,6 +1,6 @@
-- merged file : luatex-fonts-merged.lua
-- parent file : luatex-fonts.lua
--- merge date : 05/17/14 23:46:22
+-- merge date : 05/18/14 15:57:13
do -- begin closure to overcome local limits and interference
@@ -2853,7 +2853,11 @@ local format_f=function(f)
end
local format_F=function(f)
n=n+1
- return format("((a%s == 0 and '0') or (a%s == 1 and '1') or format('%%%sf',a%s))",n,n,f,n)
+ if not f or f=="" then
+ return format("(((a%s > -0.0000000005 and a%s < 0.0000000005) and '0') or (a%s == 1 and '1') or format('%%.9f',a%s))",n,n,n,n)
+ else
+ return format("((a%s == 0 and '0') or (a%s == 1 and '1') or format('%%%sf',a%s))",n,n,f,n)
+ end
end
local format_g=function(f)
n=n+1