Fixed unhandled exception in withScope. * Closes #27.
h3rald h3rald@h3rald.com
Fri, 27 Apr 2018 11:42:30 +0200
2 files changed,
9 insertions(+),
5 deletions(-)
M
.gitignore
→
.gitignore
@@ -5,6 +5,8 @@ min
nakefile Min_DeveloperGuide.htm nimsuggest.log +libdyntools* +dyntools.nim *.zip packages/ site/output/
M
core/interpreter.nim
→
core/interpreter.nim
@@ -33,11 +33,13 @@ debug(value)
template withScope*(i: In, q: MinValue, res:ref MinScope, body: untyped): untyped = let origScope = i.scope - i.scope = q.scope.copy - i.scope.parent = origScope - body - res = i.scope - i.scope = origScope + try: + i.scope = q.scope.copy + i.scope.parent = origScope + body + res = i.scope + finally: + i.scope = origScope proc newMinInterpreter*(filename = "input", pwd = ""): MinInterpreter {.extern:"min_exported_symbol_$1".}= var path = pwd