Moved interpolate to str module.
h3rald h3rald@h3rald.com
Sun, 26 Mar 2017 10:51:57 +0200
4 files changed,
11 insertions(+),
11 deletions(-)
M
lib/min_lang.nim
→
lib/min_lang.nim
@@ -531,15 +531,6 @@ var d: MinValue
i.reqDictionary d i.push i.values(d) - .symbol("interpolate") do (i: In): - var s, q: MinValue - i.reqQuotationAndString q, s - var strings = newSeq[string](0) - for el in q.qVal: - strings.add $$el - let res = s.strVal % strings - i.push res.newVal - .symbol("version") do (i: In): i.push version.newVal
M
lib/min_str.nim
→
lib/min_str.nim
@@ -13,6 +13,15 @@
proc str_module*(i: In) = i.define() + .symbol("interpolate") do (i: In): + var s, q: MinValue + i.reqQuotationAndString q, s + var strings = newSeq[string](0) + for el in q.qVal: + strings.add $$el + let res = s.strVal % strings + i.push res.newVal + .symbol("strip") do (i: In): var s: MinValue i.reqStringLike s
M
tests/lang.min
→
tests/lang.min
@@ -164,8 +164,6 @@ (((a 1)(b 2)(c 3)) keys (a b c) ==) assert
(((a 1)(b 2)(c 3)) values (1 2 3) ==) assert - ("$1 - $2 - $3" (1 true "test") interpolate "1 - true - test" ==) assert - (((1 2 3)) :sym1 >sym1 stored-symbols "sym1" contains) assert (<sym1 symbols "sym1" contains) assert
M
tests/str.min
→
tests/str.min
@@ -3,6 +3,8 @@ 'test import
"str" describe + ("$1 - $2 - $3" (1 true "test") interpolate "1 - true - test" ==) assert + (" test " strip "test" ==) assert ("test" length 4 ==) assert