Skip to content

Commit 24710c8

Browse files
committed
fusion-ast: Use serpent instead of Penlight
1 parent d26d096 commit 24710c8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

bin/util/ast.lua

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
-- @usage fusion-ast [FILE]
66
local argparse = require("argparse")
77
local parser = require("fusion.core.parser")
8-
local pretty = require("pl.pretty") -- TODO: replace
8+
local serpent = require("serpent")
99

1010
local argparser = argparse() {
1111
name = "fusion-ast";
@@ -19,9 +19,10 @@ local function read_file(file)
1919
local file_handler = assert(io.open(file))
2020
local line = file_handler:read()
2121
if line:sub(1, 2) == "#!" then
22-
pretty.dump(parser:match(file_handler:read("*a")))
22+
print(serpent.block(parser:match(file_handler:read("*a"))))
2323
else
24-
pretty.dump(parser:match(line .. '\n' .. file_handler:read("*a")))
24+
print(serpent.block(parser:match(line .. '\n' ..
25+
file_handler:read("*a"))))
2526
end
2627
file_handler:close()
2728
end

0 commit comments

Comments
 (0)