Ich habe eine mehrdimensionale Tabelle in Lua, aber ich kann nicht scheinen, um es zu erstellen, um in Lua verwenden zu können?
Tabelle
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 },
}
Fehler:
'<name>' expect near ':'