all repos — min @ d4c7ab86d649d29407edde24f5bcb867102b6e0b

A small but practical concatenative programming language.

Fixed unhandled exception in withScope.
* Closes #27.
h3rald h3rald@h3rald.com
Fri, 27 Apr 2018 11:42:30 +0200
commit

d4c7ab86d649d29407edde24f5bcb867102b6e0b

parent

c561ef631bb892ee26e72c8a537ce04bb559ef7a

2 files changed, 9 insertions(+), 5 deletions(-)

jump to
M .gitignore.gitignore

@@ -5,6 +5,8 @@ min

nakefile Min_DeveloperGuide.htm nimsuggest.log +libdyntools* +dyntools.nim *.zip packages/ site/output/
M core/interpreter.nimcore/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