mirror of
https://github.com/falcosecurity/falco.git
synced 2025-10-22 03:49:36 +00:00
This is needed so that rule_loader (which should be renamed in a later pass..) can tag filters with their index.
30 lines
428 B
Lua
30 lines
428 B
Lua
local compiler = require "compiler"
|
|
|
|
if #arg ~= 1 then
|
|
print("Usage: test.lua <string>")
|
|
os.exit(1)
|
|
end
|
|
|
|
local macros = {}
|
|
local ast
|
|
|
|
local function doit(line)
|
|
ast = compiler.compile_line(line, macros)
|
|
|
|
if not ast then
|
|
print("error", error_msg)
|
|
os.exit(1)
|
|
end
|
|
|
|
end
|
|
for str in string.gmatch(arg[1], "([^;]+)") do
|
|
doit(str)
|
|
end
|
|
|
|
if not (ast) then
|
|
compiler.parser.print_ast(ast)
|
|
end
|
|
|
|
os.exit(0)
|
|
|