From 40cf2319dbf8b2d6796c7941a31795cd2cb55eb3 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sun, 9 Jun 2013 11:34:33 +0200 Subject: sync with Context as of 2013-06-09 --- lualibs-util-str.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'lualibs-util-str.lua') diff --git a/lualibs-util-str.lua b/lualibs-util-str.lua index 6389957..10456a7 100644 --- a/lualibs-util-str.lua +++ b/lualibs-util-str.lua @@ -195,12 +195,14 @@ end -- points %p number (scaled points) -- basepoints %b number (scaled points) -- table concat %...t table +-- table concat %{.}t table -- serialize %...T sequenced (no nested tables) +-- serialize %{.}T sequenced (no nested tables) -- boolean (logic) %l boolean -- BOOLEAN %L boolean -- whitespace %...w -- automatic %...a 'whatever' (string, table, ...) --- automatic %...a "whatever" (string, table, ...) +-- automatic %...A "whatever" (string, table, ...) local n = 0 @@ -298,7 +300,7 @@ setmetatable(arguments, { __index = }) local prefix_any = C((S("+- .") + R("09"))^0) -local prefix_tab = C((1-R("az","AZ","09","%%"))^0) +local prefix_tab = P("{") * C((1-P("}"))^0) * P("}") + C((1-R("az","AZ","09","%%"))^0) -- we've split all cases as then we can optimize them (let's omit the fuzzy u) @@ -608,8 +610,8 @@ local builder = Cs { "start", ["b"] = (prefix_any * P("b")) / format_b, -- %b => 12.342bp / maybe: B (and more units) ["t"] = (prefix_tab * P("t")) / format_t, -- %t => concat ["T"] = (prefix_tab * P("T")) / format_T, -- %t => sequenced - ["l"] = (prefix_tab * P("l")) / format_l, -- %l => boolean - ["L"] = (prefix_tab * P("L")) / format_L, -- %L => BOOLEAN + ["l"] = (prefix_any * P("l")) / format_l, -- %l => boolean + ["L"] = (prefix_any * P("L")) / format_L, -- %L => BOOLEAN ["I"] = (prefix_any * P("I")) / format_I, -- %I => signed integer -- ["w"] = (prefix_any * P("w")) / format_w, -- %w => n spaces (optional prefix is added) -- cgit v1.2.3