nimeval errorHook support (#15255)
This commit is contained in:
parent
0b74d26d0c
commit
098a8a7c52
3 changed files with 37 additions and 16 deletions
|
|
@ -10,9 +10,9 @@
|
|||
## exposes the Nim VM to clients.
|
||||
import
|
||||
ast, astalgo, modules, passes, condsyms,
|
||||
options, sem, semdata, llstream, vm, vmdef,
|
||||
modulegraphs, idents, os, pathutils, passaux,
|
||||
scriptconfig
|
||||
options, sem, semdata, llstream, lineinfos, vm,
|
||||
vmdef, modulegraphs, idents, os, pathutils,
|
||||
passaux, scriptconfig
|
||||
|
||||
type
|
||||
Interpreter* = ref object ## Use Nim as an interpreter with this object
|
||||
|
|
@ -134,6 +134,11 @@ proc destroyInterpreter*(i: Interpreter) =
|
|||
## destructor.
|
||||
discard "currently nothing to do."
|
||||
|
||||
proc registerErrorHook*(i: Interpreter, hook:
|
||||
proc (config: ConfigRef; info: TLineInfo; msg: string;
|
||||
severity: Severity) {.gcsafe.}) =
|
||||
i.graph.config.structuredErrorHook = hook
|
||||
|
||||
proc runRepl*(r: TLLRepl;
|
||||
searchPaths: openArray[string];
|
||||
supportNimscript: bool) =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue