rename and,or,nor ->all,any,none in luafilters
these come closer to their actual meaning and also are not lua keywords which might come in hand later, in particular we can now replace the f_and, f_or,f_terrain, with f.all, f.any, f.terrain if we want.
This commit is contained in:
parent
45a09464e1
commit
42920cbc88
2 changed files with 7 additions and 15 deletions
|
@ -11,23 +11,15 @@ local function f_terrain(terrain)
|
|||
end
|
||||
|
||||
local function f_and(...)
|
||||
return { "and", ... }
|
||||
end
|
||||
|
||||
local function f_nand(...)
|
||||
return { "nand", ... }
|
||||
return { "all", ... }
|
||||
end
|
||||
|
||||
local function f_not(...)
|
||||
return { "nand", ... }
|
||||
return { "none", ... }
|
||||
end
|
||||
|
||||
local function f_or(...)
|
||||
return { "or", ... }
|
||||
end
|
||||
|
||||
local function f_nor(...)
|
||||
return { "nor", ... }
|
||||
return { "any", ... }
|
||||
end
|
||||
|
||||
local function f_adjacent(f, ad, count)
|
||||
|
|
|
@ -638,10 +638,10 @@ enum filter_keys { F_AND, F_OR, F_NAND, F_NOR, F_X, F_Y, F_FIND_IN, F_ADJACENT,
|
|||
//todoc++14: std::unordered_map doesn'tsupport herterogrnous lookup.
|
||||
//todo consider renaming and -> all ,or ->any, nor -> none, nand -> notall
|
||||
static const std::unordered_map<std::string, filter_keys> keys {
|
||||
{ "and", F_AND },
|
||||
{ "or", F_OR },
|
||||
{ "nand", F_NAND },
|
||||
{ "or", F_NOR },
|
||||
{ "all", F_AND },
|
||||
{ "any", F_OR },
|
||||
{ "not_all", F_NAND },
|
||||
{ "none", F_NOR },
|
||||
{ "x", F_X },
|
||||
{ "y", F_Y },
|
||||
{ "find_in", F_FIND_IN },
|
||||
|
|
Loading…
Add table
Reference in a new issue