mirror of
https://github.com/minetest-mods/mesecons.git
synced 2024-12-26 10:20:19 +01:00
fpga: Make formspec usage less prone to breakage
This commit is contained in:
parent
07d074075c
commit
2bc3c5d97c
@ -203,14 +203,15 @@ plg.from_formspec_fields = function(fields)
|
|||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
local mapping = {
|
local mapping = {
|
||||||
[" AND"] = "and",
|
["AND"] = "and",
|
||||||
[" OR"] = "or",
|
["OR"] = "or",
|
||||||
[" NOT"] = "not",
|
["NOT"] = "not",
|
||||||
[" XOR"] = "xor",
|
["XOR"] = "xor",
|
||||||
["NAND"] = "nand",
|
["NAND"] = "nand",
|
||||||
[" ="] = "buf",
|
["="] = "buf",
|
||||||
["XNOR"] = "xnor",
|
["XNOR"] = "xnor",
|
||||||
}
|
}
|
||||||
|
s = s:gsub("^%s*", "") -- remove leading spaces
|
||||||
return mapping[s]
|
return mapping[s]
|
||||||
end
|
end
|
||||||
local is = {}
|
local is = {}
|
||||||
|
Loading…
Reference in New Issue
Block a user