all repos — min @ c54da464f0b1d2eea3619b8cb6e75c9187322866

A small but practical concatenative programming language.

Minor changes.
h3rald h3rald@h3rald.com
Sat, 07 Jul 2018 13:37:45 +0200
commit

c54da464f0b1d2eea3619b8cb6e75c9187322866

parent

18e4f64a967347f5f01f1fa80581b969c9c7d5e8

2 files changed, 4 insertions(+), 6 deletions(-)

jump to
M core/interpreter.nimcore/interpreter.nim

@@ -124,12 +124,11 @@

proc push*(i: In, val: MinValue) {.gcsafe, extern:"min_exported_symbol_$1".} proc apply*(i: In, op: MinOperator) {.gcsafe, extern:"min_exported_symbol_$1".}= - var newscope = newScopeRef(i.scope) - case op.kind - of minProcOp: + if op.kind == minProcOp: op.prc(i) - of minValOp: + else: if op.val.kind == minQuotation: + var newscope = newScopeRef(i.scope) var q = op.val i.withScope(newscope): for e in q.quot:

@@ -200,8 +199,8 @@ raiseUndefined("Undefined symbol '$1'" % [val.symVal])

discard i.trace.pop else: if (val.kind == minDictionary): - var v = val if val.scope.symbols.len == 0: + var v = val i.dequote(v) # Clear the initial quotation; only used when parsing a dictionary for the first time v.quot = @[]
M core/utils.nimcore/utils.nim

@@ -217,7 +217,6 @@ if value.isTypedDictionary(split[1]):

return true return false - proc expect*(i: var MinInterpreter, elements: varargs[string]): seq[MinValue] {.extern:"min_exported_symbol_$1".}= let stack = elements.reverse.join(" ") let sym = i.currSym.getString