refactor(scope) Removed disposable scopes.
h3rald h3rald@h3rald.com
Fri, 03 Jun 2016 10:13:49 +0200
4 files changed,
1 insertions(+),
24 deletions(-)
M
core/interpreter.nim
→
core/interpreter.nim
@@ -83,19 +83,6 @@ body
#i.debug "[scope] " & scope.fullname i.scope = scope -#template newDisposableScope*(i: In, id: string, body: stmt): stmt {.immediate.}= -# var q = MinValue(kind: minQuotation, qVal: newSeq[MinValue](0)) -# q.scope = new MinScope -# q.scope.name = id -# q.scope.parent = i.scope -# q.scope.disposable = true - #i.debug "[scope] " & q.scope.fullname -# let scope = i.scope -# i.scope = q.scope -# body - #i.debug "[scope] " & scope.fullname -# i.scope = scope - proc newMinInterpreter*(debugging = false): MinInterpreter = var st:MinStack = newSeq[MinValue](0) var pr:MinParser
M
core/types.nim
→
core/types.nim
@@ -23,7 +23,6 @@ MinScope* = object
symbols*: CritBitTree[MinOperator] sigils*: CritBitTree[MinOperator] parent*: ref MinScope - disposable*: bool name*: string stack*: MinStack MinValue* = object
M
core/utils.nim
→
core/utils.nim
@@ -55,15 +55,6 @@ return ROOT
else: return scope.parent -proc ancestor*(scope: ref MinScope): ref MinScope = - if scope.parent.isNil: - return ROOT - else: - if scope.parent.disposable: - return scope.parent.ancestor - else: - return scope.parent - proc define*(name: string): ref MinScope = var scope = new MinScope scope.name = name
M
lib/lang.nim
→
lib/lang.nim
@@ -109,7 +109,7 @@ let p = proc(i: In) =
i.evaluating = true i.push code i.evaluating = false - i.scope.ancestor.symbols[id] = p + i.scope.symbols[id] = p i.stack = stack .symbol("import") do (i: In):