all repos — min @ 2915142ab891b5b87c0e9552c92c428b87b920b8

A small but practical concatenative programming language.

Added support for keys with spaces in dictionaries.
h3rald h3rald@h3rald.com
Sat, 12 Dec 2020 22:10:09 +0100
commit

2915142ab891b5b87c0e9552c92c428b87b920b8

parent

6215df859ae65bec4a69577ee39124f88e168463

1 files changed, 4 insertions(+), 1 deletions(-)

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

@@ -644,7 +644,10 @@ val = v

elif v.kind == minSymbol: let key = v.symVal if key[0] == ':': - scope.symbols[key[1 .. key.len-1]] = MinOperator(kind: minValOp, val: val, sealed: false) + var offset = 0 + if key[1] == '"': + offset = 1 + scope.symbols[key[1+offset .. key.len-1-offset]] = MinOperator(kind: minValOp, val: val, sealed: false) val = nil else: raiseInvalid("Invalid dictionary key: " & key)