mirror of
https://github.com/falcosecurity/falco.git
synced 2025-07-15 23:36:19 +00:00
Remove dead macro-checking code
The `check_macros` function wasn't doing anything, and checking is done as part of expansion.
This commit is contained in:
parent
0ec141385d
commit
fdafc7da77
@ -369,23 +369,6 @@ function get_macros(ast, set)
|
|||||||
return set
|
return set
|
||||||
end
|
end
|
||||||
|
|
||||||
function check_macros(ast)
|
|
||||||
local macros
|
|
||||||
if (ast.type == "Rule") then
|
|
||||||
macros = get_macros(ast.filter, {})
|
|
||||||
elseif (ast.type == "MacroDef") then
|
|
||||||
macros = get_macros(ast.value, {})
|
|
||||||
else
|
|
||||||
error ("Unexpected type: "..t)
|
|
||||||
end
|
|
||||||
|
|
||||||
for m, _ in pairs(macros) do
|
|
||||||
if macros[m] == nil then
|
|
||||||
error ("Undefined macro '"..m.."' used in '"..line.."'")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function print_ast(ast, level)
|
function print_ast(ast, level)
|
||||||
local t = ast.type
|
local t = ast.type
|
||||||
level = level or 0
|
level = level or 0
|
||||||
@ -453,9 +436,6 @@ function compiler.compile_line(line, macro_defs)
|
|||||||
return {}
|
return {}
|
||||||
end
|
end
|
||||||
|
|
||||||
-- check that any macros used have already been defined
|
|
||||||
check_macros(ast)
|
|
||||||
|
|
||||||
if (ast.type == "MacroDef") then
|
if (ast.type == "MacroDef") then
|
||||||
-- Parsed line is a macro definition, so update our dictionary of macros and
|
-- Parsed line is a macro definition, so update our dictionary of macros and
|
||||||
-- return
|
-- return
|
||||||
|
Loading…
Reference in New Issue
Block a user