Это ::=
немного странно.Похоже, вы выполняете ASN.1 вместо Lua.
Попробуйте вместо этого:
items = {
{["category"]="tools", ["name"]="hammer", ["price"]=10, ["quantity"]=5 },
{["category"]="tools", ["name"]="saw", ["price"]=15, ["quantity"]=4 },
{["category"]="tools", ["name"]="screwdriver", ["price"]=4, ["quantity"]=12 },
{["category"]="tools", ["name"]="measuring tape", ["price"]=9, ["quantity"]=3 },
{["category"]="tools", ["name"]="pliers", ["price"]=10, ["quantity"]=5 },
{["category"]="tools", ["name"]="wrench", ["price"]=10, ["quantity"]=5 },
{["category"]="fasteners", ["name"]="nails", ["price"]=.1, ["quantity"]=1500 },
{["category"]="fasteners", ["name"]="screws", ["price"]=.2, ["quantity"]=1200 },
{["category"]="fasteners", ["name"]="staples", ["price"]=.05, ["quantity"]=2000 },
}
Когда я использую это, я получаю в оболочке Lua следующее:
for k,v in pairs(items) do for k1,v1 in pairs(v) do print(k1,v1) end end
price 10
quantity 5
name hammer
category tools
price 15
quantity 4
name saw
category tools
price 4
quantity 12
name screwdriver
category tools
price 9
quantity 3
name measuring tape
c ategory tools
price 10
quantity 5
name pliers
category tools
price 10
quantity 5
name wrench
category tools
price 0.1
quantity 1500
name nails
category fasteners
price 0.2
quantity 1200
name screws
category fasteners
price 0.05
quantity 2000
name staples
category fasteners