Fix reference to undefined global in ./titanc
@@ -23,10 +23,10 @@ p:flag("--print-ast", "Print the AST.")
local args = p:parse()
-if not string.match(filename, "%.titan$") then
+if not string.match(args.source_file, "%.titan$") then
abort(titanc_err_prefix .. "filename should have a .titan extension")
end
-if not string.match(filename, "^[a-zA-Z0-9_/]+%.titan$") then
+if not string.match(args.source_file, "^[a-zA-Z0-9_/]+%.titan$") then
abort(titanc_err_prefix .. "filename must not include special characters")
end
local input, err = util.get_file_contents(args.source_file)
