diff options
author | Hans Hagen <pragma@wxs.nl> | 2020-10-31 00:09:22 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2020-10-31 00:09:22 +0100 |
commit | 7043cd3b7046f6a11112a5d49c4ae5e2dc0c6896 (patch) | |
tree | 92ffcd258fb29e37b4a136eb071fbfd0717be29e /tex/context/base/mkiv/luat-run.lua | |
parent | a0270f13065d116355a953c6f246cbba26289fc2 (diff) | |
download | context-7043cd3b7046f6a11112a5d49c4ae5e2dc0c6896.tar.gz |
2020-10-30 22:27:00
Diffstat (limited to 'tex/context/base/mkiv/luat-run.lua')
-rw-r--r-- | tex/context/base/mkiv/luat-run.lua | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tex/context/base/mkiv/luat-run.lua b/tex/context/base/mkiv/luat-run.lua index cb947f318..cce6ab73b 100644 --- a/tex/context/base/mkiv/luat-run.lua +++ b/tex/context/base/mkiv/luat-run.lua @@ -293,6 +293,32 @@ end) -- end -- end) +local report = logs.reporter("csname overload") +local reported = { } + +callback.register("handle_overload", function(fatal,overload,csname,flags) + if not reported[csname] then + logs.newline() + local readstate = status.readstate + local filename = readstate.filename + local linenumber = readstate.linenumber + if filename and linenumber then + report("%s, protection level %i, control sequence %a, properties '% t', file %a, line %i", + fatal and "fatal error" or "warning",overload,csname,tokens.flags(csname),filename,linenumber) + else + report("%s, protection level %i, control sequence %a, properties '% t'", + fatal and "fatal error" or "warning",overload,csname,tokens.flags(csname)) + end + reported[csname] = true + logs.newline() + if fatal then + cleanup_run() + osexit(1) + end + end +end) + +-- bonus if environment.initex then |