diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2018-06-20 15:22:03 -0700 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2018-06-20 15:22:06 -0700 |
| commit | d73cbf0aa5c9081d965e06822f4958aa5c1871e6 (patch) | |
| tree | 776740bfa4b47bd7983efd3d332da3c14b97bb49 /error_handling.moon | |
| parent | c1cec2ac8487bf7486b1ab85d24252d6658b3dfc (diff) | |
Cleanups.
Diffstat (limited to 'error_handling.moon')
| -rw-r--r-- | error_handling.moon | 3 |
1 files changed, 2 insertions, 1 deletions
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 |
