From d73cbf0aa5c9081d965e06822f4958aa5c1871e6 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Wed, 20 Jun 2018 15:22:03 -0700 Subject: Cleanups. --- error_handling.moon | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'error_handling.moon') diff --git a/error_handling.moon b/error_handling.moon index c95556b..8aa0a82 100644 --- a/error_handling.moon +++ b/error_handling.moon @@ -98,7 +98,8 @@ print_error = (error_message, stack_offset=3)-> name = "upvalue '#{varname}'" if not varname\match("%(") break - if file and calling_fn.short_src\match("%.moon$") and type(MOON_SOURCE_MAP[file]) == 'table' + + if file and (calling_fn.short_src\match("%.moon$") or file\match("^#![^\n]*moon\n")) and type(MOON_SOURCE_MAP[file]) == 'table' char = MOON_SOURCE_MAP[file][calling_fn.currentline] line_num = 1 for _ in file\sub(1,char)\gmatch("\n") do line_num += 1 -- cgit v1.2.3