all repos — min @ 008b3ae43a00069049356f201bf8193ca18702aa

A small but practical concatenative programming language.

Implemented parent-scope (#117).
h3rald h3rald@h3rald.com
Mon, 01 Feb 2021 21:40:13 +0000
commit

008b3ae43a00069049356f201bf8193ca18702aa

parent

7591c01a9ba1a01f93ce270a4ba3150aa9cd5dd7

3 files changed, 16 insertions(+), 0 deletions(-)

jump to
M minpkg/lib/min_lang.nimminpkg/lib/min_lang.nim

@@ -517,6 +517,18 @@ dict.filename = i.filename

dict.scope = i.scope i.push dict + def.symbol("parent-scope") do (i: In): + let vals = i.expect("dict") + let d = vals[0] + if d.scope.parent.isNil: + i.push newNull() + return + var dict = newDict(d.scope.parent) + dict.objType = "module" + dict.filename = i.filename + dict.scope = d.scope.parent + i.push dict + def.symbol("type") do (i: In): let vals = i.expect("a") i.push vals[0].typeName.newVal
M next-release.mdnext-release.md

@@ -1,1 +1,2 @@

* Added `===` at the end of integrated help descriptions (#127). +* New symbol: [parent-scope](https://min-lang.org/reference-lang/#op-parent-scope) (#117).
M site/contents/reference-lang.mdsite/contents/reference-lang.md

@@ -321,6 +321,9 @@

{#op||opts||{{none}}||{{d}}|| Returns a dictionary of all options passed to the current program, with their respective values.#} +{#op||parent-scope||{{d1}}||{{d2}}|| +Returns a dictionary {{d2}} holding a reference to the parent scope of {{d1}} or {{null}} if {{d1}} is ROOT.#} + {#op||parse||{{s}}||{{q}}|| Parses {{s}} and returns a quoted program {{q}}. #}