From f0f3c7e0bb42f67868a840f19492c69e03b7cf17 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Fri, 22 Mar 2019 14:37:50 -0700 Subject: Fix for error reporting not finding core files --- nomsu_compiler.moon | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'nomsu_compiler.moon') diff --git a/nomsu_compiler.moon b/nomsu_compiler.moon index 6fa9ffd..4b684a4 100644 --- a/nomsu_compiler.moon +++ b/nomsu_compiler.moon @@ -30,6 +30,12 @@ fail_at = (source, msg)-> if source and not file file = Files.read(source.filename) + if not file + if NOMSU_PREFIX + path = "#{NOMSU_PREFIX}/share/nomsu/#{table.concat NOMSU_VERSION, "."}/#{source.filename}" + file = Files.read(path) + if not file + error("Can't find file: "..tostring(source.filename)) title, err_msg, hint = msg\match("([^:]*):[ \n]+(.*)[ \n]+Hint: (.*)") if not err_msg -- cgit v1.2.3