diff options
Diffstat (limited to 'macros/luatex/generic/luakeys/luakeys.lua')
-rw-r--r-- | macros/luatex/generic/luakeys/luakeys.lua | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/macros/luatex/generic/luakeys/luakeys.lua b/macros/luatex/generic/luakeys/luakeys.lua index b026413800..05b3d94e1f 100644 --- a/macros/luatex/generic/luakeys/luakeys.lua +++ b/macros/luatex/generic/luakeys/luakeys.lua @@ -1,4 +1,4 @@ --- luakeys-debug.tex +-- luakeys.lua -- Copyright 2021 Josef Friedrich -- -- This work may be distributed and/or modified under the @@ -13,8 +13,8 @@ -- -- The Current Maintainer of this work is Josef Friedrich. -- --- This work consists of the files luakeys.lua, luakeys-debug.sty --- and luakeys-debug.tex. +-- This work consists of the files luakeys.lua, luakeys.sty, luakeys.tex +-- luakeys-debug.sty and luakeys-debug.tex. --- A key-value parser written with Lpeg. -- @@ -167,7 +167,11 @@ local function generate_parser(options) lpeg.V('dimension') + lpeg.V('number') + lpeg.V('string_quoted') + - lpeg.V('string_unquoted'), + lpeg.V('string_unquoted') + + lpeg.V('array'), + + array = + ws('{') * lpeg.Ct((lpeg.V('value') * ws(',')^-1)^0) * ws('}'), boolean = boolean_true * lpeg.Cc(true) + @@ -175,6 +179,9 @@ local function generate_parser(options) dimension = build_dimension_pattern(), + number = + white_space^0 * (number / tonumber) * white_space^0, + string_quoted = white_space^0 * lpeg.P('"') * lpeg.C((lpeg.P('\\"') + 1 - lpeg.P('"'))^0) * @@ -188,10 +195,6 @@ local function generate_parser(options) white_space^0, word_unquoted = (1 - white_space - lpeg.S('{},='))^1; - - number = - white_space^0 * (number / tonumber) * white_space^0, - }) end |