Implemented parent-scope (#117).
h3rald h3rald@h3rald.com
Mon, 01 Feb 2021 21:40:13 +0000
3 files changed,
16 insertions(+),
0 deletions(-)
M
minpkg/lib/min_lang.nim
→
minpkg/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.md
→
next-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.md
→
site/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}}. #}