diff options
Diffstat (limited to 'stdlib/source/lux/type/abstract.lux')
-rw-r--r-- | stdlib/source/lux/type/abstract.lux | 52 |
1 files changed, 32 insertions, 20 deletions
diff --git a/stdlib/source/lux/type/abstract.lux b/stdlib/source/lux/type/abstract.lux index 70ec590da..70b742236 100644 --- a/stdlib/source/lux/type/abstract.lux +++ b/stdlib/source/lux/type/abstract.lux @@ -42,9 +42,13 @@ (undefined)))) (def: (peek-scopes-definition reference source) - (-> Text (List [Text Definition]) (Stack Scope)) + (-> Text (List [Text Global]) (Stack Scope)) (!peek source reference - (let [[exported? scope-type scope-anns scope-value] head] + (case head + (#.Left _) + (undefined) + + (#.Right [exported? scope-type scope-anns scope-value]) (:coerce (Stack Scope) scope-value)))) (def: (peek-scopes reference definition-reference source) @@ -88,13 +92,17 @@ (undefined)))) (def: (push-scope-definition reference scope source) - (-> Text Scope (List [Text Definition]) (List [Text Definition])) + (-> Text Scope (List [Text Global]) (List [Text Global])) (!push source reference - (let [[exported? scopes-type scopes-anns scopes-value] head] - [exported? - scopes-type - scopes-anns - (stack.push scope (:coerce (Stack Scope) scopes-value))]))) + (case head + (#.Left _) + (undefined) + + (#.Right [exported? scopes-type scopes-anns scopes-value]) + (#.Right [exported? + scopes-type + scopes-anns + (stack.push scope (:coerce (Stack Scope) scopes-value))])))) (def: (push-scope [module-reference definition-reference] scope source) (-> Name Scope (List [Text Module]) (List [Text Module])) @@ -110,19 +118,23 @@ []]))) (def: (pop-scope-definition reference source) - (-> Text (List [Text Definition]) (List [Text Definition])) + (-> Text (List [Text Global]) (List [Text Global])) (!push source reference - (let [[exported? scopes-type scopes-anns scopes-value] head] - [exported? - scopes-type - scopes-anns - (let [current-scopes (:coerce (Stack Scope) scopes-value)] - (case (stack.pop current-scopes) - (#.Some current-scopes') - current-scopes' - - #.None - current-scopes))]))) + (case head + (#.Left _) + (undefined) + + (#.Right [exported? scopes-type scopes-anns scopes-value]) + (#.Right [exported? + scopes-type + scopes-anns + (let [current-scopes (:coerce (Stack Scope) scopes-value)] + (case (stack.pop current-scopes) + (#.Some current-scopes') + current-scopes' + + #.None + current-scopes))])))) (def: (pop-scope [module-reference definition-reference] source) (-> Name (List [Text Module]) (List [Text Module])) |