Some tests passsing with namespaces symbols
h3rald h3rald@h3rald.com
Sun, 26 May 2024 06:26:19 +0000
2 files changed,
6 insertions(+),
6 deletions(-)
M
minpkg/core/interpreter.nim
→
minpkg/core/interpreter.nim
@@ -196,12 +196,10 @@
proc apply*(i: In, op: MinOperator, sym = "") {.effectsOf: op.} = if op.kind == minProcOp: if not op.mdl.isNil and not op.mdl.scope.isNil: + # Capture closures at module level let origScope = i.scope - let origMdlParentScope = op.mdl.scope.parent i.scope = op.mdl.scope - i.scope.parent = origScope op.prc(i) - i.scope.parent = origMdlParentScope i.scope = origScope else: op.prc(i)@@ -447,7 +445,10 @@ raiseInvalid("Module '$#' is polluting the stack -- $#" % [s, $d.newVal])
result = newDict(i2.scope) result.objType = "module" for key, value in i2.scope.symbols.pairs: - result.scope.symbols[key] = value + var v = value + if v.kind == minProcOp: + v.mdl = result + result.scope.symbols[key] = v CACHEDMODULES[s] = result proc parse*(i: In, s: string, name = "<parse>"): MinValue =
M
minpkg/core/scope.nim
→
minpkg/core/scope.nim
@@ -1,6 +1,5 @@
import - std/[strutils, - critbits] + std/[strutils, sequtils, critbits] import parser