fpga: Make formspec usage less prone to breakage

This commit is contained in:
sfan5 2017-01-28 11:54:27 +01:00
parent 07d074075c
commit 2bc3c5d97c

@ -203,14 +203,15 @@ plg.from_formspec_fields = function(fields)
return nil
end
local mapping = {
[" AND"] = "and",
[" OR"] = "or",
[" NOT"] = "not",
[" XOR"] = "xor",
["AND"] = "and",
["OR"] = "or",
["NOT"] = "not",
["XOR"] = "xor",
["NAND"] = "nand",
[" ="] = "buf",
["="] = "buf",
["XNOR"] = "xnor",
}
s = s:gsub("^%s*", "") -- remove leading spaces
return mapping[s]
end
local is = {}