aboutsummaryrefslogtreecommitdiff
path: root/nomsu_compiler.lua
diff options
context:
space:
mode:
Diffstat (limited to 'nomsu_compiler.lua')
-rw-r--r--nomsu_compiler.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/nomsu_compiler.lua b/nomsu_compiler.lua
index af0636b..5495fde 100644
--- a/nomsu_compiler.lua
+++ b/nomsu_compiler.lua
@@ -36,6 +36,15 @@ fail_at = function(source, msg)
if source and not file then
file = Files.read(source.filename)
end
+ if not file then
+ if NOMSU_PREFIX then
+ local path = tostring(NOMSU_PREFIX) .. "/share/nomsu/" .. tostring(table.concat(NOMSU_VERSION, ".")) .. "/" .. tostring(source.filename)
+ file = Files.read(path)
+ end
+ end
+ if not file then
+ error("Can't find file: " .. tostring(source.filename))
+ end
local title, err_msg, hint = msg:match("([^:]*):[ \n]+(.*)[ \n]+Hint: (.*)")
if not err_msg then
err_msg, hint = msg:match("(.*)[ \n]+Hint:[ \n]+(.*)")