Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
executable file
·
30 lines (24 loc) · 637 Bytes

File metadata and controls

executable file
·
30 lines (24 loc) · 637 Bytes
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env lua
local fmt = string.format
local datalog = require "datalog"
local die = function(s)
io.stderr:write(s .. "\n")
os.exit(1)
end
local usage = function(arg)
die(fmt("USAGE: %s [file]", arg[0]))
end
local read_file = function(path)
local f, r, e
f, e = io.open(path, "rb")
if not f then return nil, e end
r, e = f:read("*all")
f:close()
return r, e
end
if not arg[1] then usage(arg) end
local program, err = read_file(arg[1])
if err then die(err) end
local ast = datalog.parser.parse(program)
local r = datalog.interpreter.process(ast)
if r then print(datalog.pretty.dump(r)) end
Morty Proxy This is a proxified and sanitized view of the page, visit original site.