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

luakeys-debug - why are integer indexes wrapped in quotes?

kalekje opened this issue · comments

Just want to ask why integer indexes are wrapped in quotes when using the debug feature. In my opinion, this is misleading as it makes the user believe they are string indexes.

 \luakeysdebug{{1,2,3},{4,5,6}}
-- writes this;

 ['1'] = {
    ['1'] = 1,
    ['2'] = 2,
    ['3'] = 3,
  },
  ['2'] = {
    ['1'] = 4,
    ['2'] = 5,
    ['3'] = 6,
  },
}

Further...

    \begin{luacode*}
        texio.write_nl(luakeys.parse('{1,2,3},{4,5,6}')[2][2]) -- shows 5 as expected
        --texio.write_nl(luakeys.parse('{1,2,3},{4,5,6}')['2']['2']) -- incorrect
    \end{luacode*}

Thank you for reporting this.