diff options
author | Norbert Preining <norbert@preining.info> | 2021-11-07 03:01:05 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2021-11-07 03:01:05 +0000 |
commit | 8389f0bb8e6af2c5dcbfe3cdad746a9c170d1157 (patch) | |
tree | 3b49c58b6652468cb2c68b4bc8b57356bb449ebb /macros/luatex/generic/luakeys/luakeys.lua | |
parent | 2ea2cee6498139387ba3c0815d105b4344c0fb50 (diff) |
CTAN sync 202111070301
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 |