From 8bfadcb777942fb94f714df18d4172f0704dcbea Mon Sep 17 00:00:00 2001 From: Marius Date: Fri, 8 Mar 2013 02:20:14 +0200 Subject: beta 2013.03.08 01:14 --- tex/context/base/cont-new.mkii | 2 +- tex/context/base/cont-new.mkiv | 2 +- tex/context/base/context-version.pdf | Bin 4131 -> 4131 bytes tex/context/base/context-version.png | Bin 40017 -> 39754 bytes tex/context/base/context.mkii | 2 +- tex/context/base/context.mkiv | 2 +- tex/context/base/scrn-fld.mkvi | 2 - tex/context/base/status-files.pdf | Bin 24817 -> 24806 bytes tex/context/base/status-lua.pdf | Bin 209244 -> 209211 bytes tex/context/base/trac-lmx.lua | 85 +++++++++++++++------ tex/context/base/util-sql-users.lua | 22 +++--- tex/generic/context/luatex/luatex-fonts-merged.lua | 2 +- 12 files changed, 79 insertions(+), 40 deletions(-) (limited to 'tex') diff --git a/tex/context/base/cont-new.mkii b/tex/context/base/cont-new.mkii index 43e85bbda..aa4e3223d 100644 --- a/tex/context/base/cont-new.mkii +++ b/tex/context/base/cont-new.mkii @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2013.03.05 19:10} +\newcontextversion{2013.03.08 01:14} %D This file is loaded at runtime, thereby providing an %D excellent place for hacks, patches, extensions and new diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv index 458c168af..debad7bae 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{2013.03.05 19:10} +\newcontextversion{2013.03.08 01:14} %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 597c8952e..398846f55 100644 Binary files a/tex/context/base/context-version.pdf and b/tex/context/base/context-version.pdf differ diff --git a/tex/context/base/context-version.png b/tex/context/base/context-version.png index 2940bcabd..3be5fcc66 100644 Binary files a/tex/context/base/context-version.png and b/tex/context/base/context-version.png differ diff --git a/tex/context/base/context.mkii b/tex/context/base/context.mkii index a24c9939b..20aefca87 100644 --- a/tex/context/base/context.mkii +++ b/tex/context/base/context.mkii @@ -20,7 +20,7 @@ %D your styles an modules. \edef\contextformat {\jobname} -\edef\contextversion{2013.03.05 19:10} +\edef\contextversion{2013.03.08 01:14} %D For those who want to use this: diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv index d846c90c3..4fcd7ae07 100644 --- a/tex/context/base/context.mkiv +++ b/tex/context/base/context.mkiv @@ -25,7 +25,7 @@ %D up and the dependencies are more consistent. \edef\contextformat {\jobname} -\edef\contextversion{2013.03.05 19:10} +\edef\contextversion{2013.03.08 01:14} %D For those who want to use this: diff --git a/tex/context/base/scrn-fld.mkvi b/tex/context/base/scrn-fld.mkvi index a811c6481..cc84b9c71 100644 --- a/tex/context/base/scrn-fld.mkvi +++ b/tex/context/base/scrn-fld.mkvi @@ -231,7 +231,6 @@ depth = \number\dimexpr\fieldbodyparameter\c!depth \relax, align = "\fieldbodyparameter\c!align", length = "\fieldbodyparameter\c!n", - style = "\fieldbodyparameter\c!style", fontstyle = "\fontstyle", fontalternative = "\fontalternative", fontsize = "\fontbody", @@ -241,7 +240,6 @@ \ifx\currentfieldbackgroundcolor\empty \else backgroundcolor = "\currentfieldbackgroundcolor", backgroundcolorvalue = "\currentfieldbackgroundcolorvalue", - \fi \ifx\currentfieldframecolor\empty \else framecolor = "\currentfieldframecolor", diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf index af6e79ce9..6fb7f16c3 100644 Binary files a/tex/context/base/status-files.pdf and b/tex/context/base/status-files.pdf differ diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf index f6e8fb0a8..19170f8b0 100644 Binary files a/tex/context/base/status-lua.pdf and b/tex/context/base/status-lua.pdf differ diff --git a/tex/context/base/trac-lmx.lua b/tex/context/base/trac-lmx.lua index ea0ac6c53..fb3211079 100644 --- a/tex/context/base/trac-lmx.lua +++ b/tex/context/base/trac-lmx.lua @@ -154,6 +154,8 @@ lmx.loadedfile = loadedfile local usedpaths = { } local givenpath = nil +local do_nested_include = nil + local pattern = lpeg.replacer { ["&"] = "&", [">"] = ">", @@ -227,11 +229,17 @@ local function do_include(filename) if (not data or data == "") and type(usedpaths) == "table" then for i=1,#usedpaths do data = loadedsubfile(joinpath(usedpaths[i],filename)) + if data and data ~= "" then + break + end end end if not data or data == "" then data = format("",filename) report_lmx("empty include file: %s",filename) + else + -- report_lmx("included file: %s",filename) + data = do_nested_include(data) end return data end @@ -240,6 +248,7 @@ end lmx.print = do_print lmx.type = do_type +lmx.eprint = do_eprint lmx.fprint = do_fprint lmx.escape = do_escape @@ -367,9 +376,13 @@ local finject = lmx.fprint -- better use the following local einject = lmx.eprint -- better use the following local injectf = lmx.fprint local injecte = lmx.eprint +local injectfmt = lmx.fprint +local injectesc = lmx.eprint local escape = lmx.escape local verbose = lmx.type +local i_n_j_e_c_t = lmx.print + -- shortcuts (sort of obsolete as there is no gain) local p = lmx.print @@ -421,10 +434,13 @@ local endembedxml = P("?>") local beginembedcss = P("/*") local endembedcss = P("*/") -local gobbledend = (optionalspaces * endembedxml) / "" -local argument = (1-gobbledend)^0 +local gobbledendxml = (optionalspaces * endembedxml) / "" +local argumentxml = (1-gobbledendxml)^0 -local comment = (begincomment * (1-endcomment)^0 * endcomment) / "" +local gobbledendcss = (optionalspaces * endembedcss) / "" +local argumentcss = (1-gobbledendcss)^0 + +local commentxml = (begincomment * (1-endcomment)^0 * endcomment) / "" local beginluaxml = (beginembedxml * P("lua")) / "" local endluaxml = endembedxml / "" @@ -440,30 +456,50 @@ local luacodecss = beginluacss * (1-endluacss)^1 * endluacss -local othercode = (1-beginluaxml-beginluacss)^1 / " p[==[%0]==] " +local othercode = (1-beginluaxml-beginluacss)^1 / " i_n_j_e_c_t[==[%0]==] " + +local includexml = ((beginembedxml * P("lmx-include") * optionalspaces) / "") + * (argumentxml / do_include) + * gobbledendxml + +local includecss = ((beginembedcss * P("lmx-include") * optionalspaces) / "") + * (argumentcss / do_include) + * gobbledendcss -local include = ((beginembedxml * P("lmx-include") * optionalspaces) / "") - * (argument / do_include) - * gobbledend +local definexml_b = ((beginembedxml * P("lmx-define-begin") * optionalspaces) / "") + * argumentxml + * gobbledendxml -local define_b = ((beginembedxml * P("lmx-define-begin") * optionalspaces) / "") - * argument - * gobbledend +local definexml_e = ((beginembedxml * P("lmx-define-end") * optionalspaces) / "") + * argumentxml + * gobbledendxml -local define_e = ((beginembedxml * P("lmx-define-end") * optionalspaces) / "") - * argument - * gobbledend +local definexml_c = C((1-definexml_e)^0) -local define_c = C((1-define_e)^0) +local definexml = (Carg(1) * C(definexml_b) * definexml_c * definexml_e) / savedefinition -local define = (Carg(1) * C(define_b) * define_c * define_e) / savedefinition +local resolvexml = ((beginembedxml * P("lmx-resolve") * optionalspaces) / "") + * ((Carg(1) * C(argumentxml)) / getdefinition) + * gobbledendxml -local resolve = ((beginembedxml * P("lmx-resolve") * optionalspaces) / "") - * ((Carg(1) * C(argument)) / getdefinition) - * gobbledend +local definecss_b = ((beginembedcss * P("lmx-define-begin") * optionalspaces) / "") + * argumentcss + * gobbledendcss -local pattern_1 = Cs((comment + include + P(1))^0) -- get rid of comments asap -local pattern_2 = Cs((define + resolve + P(1))^0) +local definecss_e = ((beginembedcss * P("lmx-define-end") * optionalspaces) / "") + * argumentcss + * gobbledendcss + +local definecss_c = C((1-definecss_e)^0) + +local definecss = (Carg(1) * C(definecss_b) * definecss_c * definecss_e) / savedefinition + +local resolvecss = ((beginembedcss * P("lmx-resolve") * optionalspaces) / "") + * ((Carg(1) * C(argumentcss)) / getdefinition) + * gobbledendcss + +local pattern_1 = Cs((commentxml + includexml + includecss + P(1))^0) -- get rid of xml comments asap +local pattern_2 = Cs((definexml + resolvexml + definecss + resolvecss + P(1))^0) local pattern_3 = Cs((luacodexml + luacodecss + othercode)^0) local cache = { } @@ -482,6 +518,10 @@ local function wrapper(converter,defaults,variables) end end +do_nested_include = function(data) -- also used in include + return lpegmatch(pattern_1,data) +end + function lmxnew(data,defaults,nocache,path) -- todo: use defaults in calling routines data = data or "" local known = cache[data] @@ -505,6 +545,7 @@ function lmxnew(data,defaults,nocache,path) -- todo: use defaults in calling rou return wrapper(converted,defaults,variables) end else + report_error("error in:\n%s\n:",data) converter = function() lmxerror("error in template") end end known = { @@ -610,9 +651,9 @@ function lmx.color(r,g,b,a) a = 1 end if a > 0 then - return string.format("rgba(%s%%,%s%%,%s%%,%s)",r*100,g*100,b*100,a) + return format("rgba(%s%%,%s%%,%s%%,%s)",r*100,g*100,b*100,a) else - return string.format("rgb(%s%%,%s%%,%s%%)",r*100,g*100,b*100) + return format("rgb(%s%%,%s%%,%s%%)",r*100,g*100,b*100) end end diff --git a/tex/context/base/util-sql-users.lua b/tex/context/base/util-sql-users.lua index 2b871acdc..00fca942e 100644 --- a/tex/context/base/util-sql-users.lua +++ b/tex/context/base/util-sql-users.lua @@ -157,9 +157,9 @@ local template =[[ FROM %basename% WHERE - `name` = '%name%' + `name` = '%[name]%' AND - `password` = '%password%' + `password` = '%[password]%' ; ]] @@ -169,7 +169,7 @@ local template =[[ FROM %basename% WHERE - `name` = '%name%' + `name` = '%[name]%' ; ]] @@ -216,9 +216,9 @@ local template =[[ ) VALUES ( '%[name]%', '%[fullname]%', - '%password%', - '%group%', - '%enabled%', + '%[password]%', + '%[group]%', + '%[enabled]%', '%[email]%', '%[address]%', '%[theme]%', @@ -260,7 +260,7 @@ local template =[[ FROM %basename% WHERE - `name` = '%name%' ; + `name` = '%[name]%' ; ]] function users.getbyname(db,name) @@ -310,10 +310,10 @@ local template =[[ UPDATE %basename% SET - `fullname` = '%fullname%', - `password` = '%password%', - `group` = '%group%', - `enabled` = '%enabled%', + `fullname` = '%[fullname]%', + `password` = '%[password]%', + `group` = '%[group]%', + `enabled` = '%[enabled]%', `email` = '%[email]%', `address` = '%[address]%', `theme` = '%[theme]%', diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index 9dd1797e9..28859a963 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 : 03/05/13 19:10:20 +-- merge date : 03/08/13 01:14:04 do -- begin closure to overcome local limits and interference -- cgit v1.2.3