Josef-Friedrich / luakeys

LuaTeX package to parse key value options in Lua only, like keyval, kvsetkeys, kvoptions, xkeyval, pgfkeys but in Lua

Home Page:https://www.ctan.org/pkg/luakeys

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

nested table, potential bug

Josef-Friedrich opened this issue · comments

Bug report per e-mail:

I am using your luakeys package and noticed something. See example below

\documentclass[11pt]{scrartcl}
\usepackage{luacode}
\begin{document}
    Hello
\begin{luacode*}
    luakeys = require('luakeys')
    kv = luakeys.parse('t={a,b},z={{a,b},{c,d}}')
    luakeys.print(kv)
    for k,v in pairs(kv.t) do print(k,v) end  -- works as expected
    kvz_equivalent = {{'a','b'}, {'c','d'}} -- shouldn't it look like this?
    --for k,v in pairs(kv.z) do print(k,v) end  -- fails because z is interpreted as a standalone key
\end{luacode*}
\end{document}

Here is what the debug says:

{
  ['1'] = 'z',
  ['t'] = {
    ['1'] = 'a',
    ['2'] = 'b',
  },
}

Shouldnt kv.z produce {{'a','b'}, {'c','d'}} ??