summaryrefslogtreecommitdiff
path: root/lualibs-util-str.lua
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2013-06-09 11:34:33 +0200
committerPhilipp Gesang <phg42.2a@gmail.com>2013-06-09 11:34:33 +0200
commit40cf2319dbf8b2d6796c7941a31795cd2cb55eb3 (patch)
tree3ccabaa43445a099852e45add9fa93574fab59bb /lualibs-util-str.lua
parentc0eecc6f6ac9622b498134d8415010b077f4d57d (diff)
downloadlualibs-40cf2319dbf8b2d6796c7941a31795cd2cb55eb3.tar.gz
sync with Context as of 2013-06-09
Diffstat (limited to 'lualibs-util-str.lua')
-rw-r--r--lualibs-util-str.lua10
1 files changed, 6 insertions, 4 deletions
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)