mirror of
https://github.com/falcosecurity/falco.git
synced 2025-10-22 12:27:10 +00:00
Move lua/ to userspace/digwatch
This commit is contained in:
26
userspace/digwatch/lua/test.lua
Normal file
26
userspace/digwatch/lua/test.lua
Normal file
@@ -0,0 +1,26 @@
|
||||
local compiler = require "compiler"
|
||||
|
||||
if #arg ~= 1 then
|
||||
print("Usage: test.lua <string>")
|
||||
os.exit(1)
|
||||
end
|
||||
|
||||
local state = compiler.init()
|
||||
|
||||
local function doit(line)
|
||||
local ast = compiler.compile_line(line, state)
|
||||
|
||||
if not ast then
|
||||
print("error", error_msg)
|
||||
os.exit(1)
|
||||
end
|
||||
|
||||
end
|
||||
for str in string.gmatch(arg[1], "([^;]+)") do
|
||||
doit(str)
|
||||
end
|
||||
|
||||
compiler.parser.print_ast(state.ast)
|
||||
|
||||
os.exit(0)
|
||||
|
Reference in New Issue
Block a user