mirror of
https://github.com/falcosecurity/falco.git
synced 2025-06-29 08:07:24 +00:00
commit
ae08d6ca8f
@ -300,7 +300,7 @@ function expand_in(node)
|
|||||||
local mapper = function(element)
|
local mapper = function(element)
|
||||||
return {
|
return {
|
||||||
type = "BinaryRelOp",
|
type = "BinaryRelOp",
|
||||||
operator = "eq",
|
operator = "=",
|
||||||
left = node.left,
|
left = node.left,
|
||||||
right = element
|
right = element
|
||||||
}
|
}
|
||||||
@ -350,7 +350,7 @@ function expand_macros(ast, defs, changed)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if (ast.type == "Rule") then
|
if (ast.type == "Rule") then
|
||||||
macros = expand_macros(ast.filter, defs, changed)
|
return expand_macros(ast.filter, defs, changed)
|
||||||
elseif ast.type == "Filter" then
|
elseif ast.type == "Filter" then
|
||||||
if (ast.value.type == "Macro") then
|
if (ast.value.type == "Macro") then
|
||||||
if (defs[ast.value.value] == nil) then
|
if (defs[ast.value.value] == nil) then
|
||||||
@ -514,6 +514,8 @@ function compiler.compile_line(line, macro_defs)
|
|||||||
check_macros(ast)
|
check_macros(ast)
|
||||||
|
|
||||||
if (ast.type == "MacroDef") then
|
if (ast.type == "MacroDef") then
|
||||||
|
expand_in(ast.value)
|
||||||
|
|
||||||
-- 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
|
||||||
macro_defs[ast.name] = ast.value
|
macro_defs[ast.name] = ast.value
|
||||||
|
Loading…
Reference in New Issue
Block a user