1
0
Fork 0
mirror of https://github.com/Reuh/candran.git synced 2025-10-27 17:59:30 +00:00

Added cancheck; candran.compile, .make and .preprocess returns nil, err instead of throwing an error; can and canc error output should now be similar to Lua

This commit is contained in:
Étienne Fildadut 2020-04-06 21:30:57 +02:00
parent dc19ac56a9
commit 1de0aafa5b
9 changed files with 412 additions and 226 deletions

11
bin/can
View file

@ -1,4 +1,5 @@
#!/bin/lua
#!/usr/bin/env lua
local candran = require("candran")
local cmdline = require("candran.cmdline")
@ -29,7 +30,13 @@ if arg[#arg] == "-" then
f()
-- file
elseif #args >= 1 then
candran.dofile(args[1], args)
local f, err = candran.loadfile(args[1], nil, args)
if not f then
print("can: "..err)
os.exit(1)
else
f()
end
-- REPL
else
-- Setup linenoise