mirror of
https://github.com/Reuh/candran.git
synced 2025-10-27 09:59:29 +00:00
Fixed assignemnt operators priority bug
accidentaly added AST dumping to canc in the process
This commit is contained in:
parent
006099a57c
commit
025a55f708
5 changed files with 133 additions and 84 deletions
9
bin/canc
9
bin/canc
|
|
@ -1,10 +1,12 @@
|
|||
#!/bin/lua
|
||||
local candran = require("candran")
|
||||
local cmdline = require("lib.cmdline")
|
||||
local parse = require("lib.lua-parser.parser").parse
|
||||
local pp = require("lib.lua-parser.pp")
|
||||
|
||||
if #arg < 1 then
|
||||
print("Candran compiler version "..candran.VERSION.." by Reuh")
|
||||
print("Usage: "..arg[0].." [target=<target>] [dest=<destination directory>] [-print] [-preprocess] [-compile] [options] filename...")
|
||||
print("Usage: "..arg[0].." [target=<target>] [dest=<destination directory>] [-print] [-preprocess] [-compile] [-ast] [options] filename...")
|
||||
return
|
||||
end
|
||||
|
||||
|
|
@ -25,6 +27,11 @@ for _, file in ipairs(args) do
|
|||
local input = inputFile:read("*a")
|
||||
inputFile:close()
|
||||
|
||||
if args.ast then
|
||||
pp.dump(parse(input))
|
||||
return
|
||||
end
|
||||
|
||||
if args.chunkname == nil then
|
||||
args.chunkname = file
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue