aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source')
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/analysis.lux15
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/analysis/evaluation.lux5
-rw-r--r--stdlib/source/library/lux/type.lux7
3 files changed, 21 insertions, 6 deletions
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/analysis.lux b/stdlib/source/library/lux/tool/compiler/language/lux/analysis.lux
index 772b0b04d..5522749e0 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/analysis.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/analysis.lux
@@ -447,6 +447,21 @@
(#try.Failure error)
(#try.Failure error))))
+(def: scope_reset
+ (List Scope)
+ (list fresh_scope))
+
+(def: .public (without_scopes action)
+ (All (_ a) (-> (Operation a) (Operation a)))
+ (function (_ [bundle state])
+ (case (action [bundle (with@ #.scopes ..scope_reset state)])
+ (#try.Success [[bundle' state'] output])
+ (#try.Success [[bundle' (with@ #.scopes (value@ #.scopes state) state')]
+ output])
+
+ (#try.Failure error)
+ (#try.Failure error))))
+
(def: .public (with_current_module name)
(All (_ a) (-> Text (Operation a) (Operation a)))
(extension.localized (value@ #.current_module)
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/analysis/evaluation.lux b/stdlib/source/library/lux/tool/compiler/language/lux/analysis/evaluation.lux
index a770d7798..94305f30a 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/analysis/evaluation.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/analysis/evaluation.lux
@@ -9,7 +9,7 @@
[math
[number
["n" nat]]]]]
- [// {"+" [Operation]}
+ ["." // {"+" [Operation]}
[macro {"+" [Expander]}]
[//
[phase
@@ -45,7 +45,8 @@
(function (eval archive type exprC)
(do phase.monad
[exprA (type.with_type type
- (analyze archive exprC))
+ (//.without_scopes
+ (analyze archive exprC)))
module (extensionP.lifted
meta.current_module_name)
count (extensionP.lifted
diff --git a/stdlib/source/library/lux/type.lux b/stdlib/source/library/lux/type.lux
index c6f57f52f..c60be0b73 100644
--- a/stdlib/source/library/lux/type.lux
+++ b/stdlib/source/library/lux/type.lux
@@ -445,10 +445,9 @@
exemplar ..typed
computation ..typed])
(macro.with_identifiers [g!_]
- (let [typeC (("lux in-module" "library/lux" .quantified)
- (` (All ((~ g!_) (~+ (list\each code.local_identifier type_vars)))
- (-> (~ (value@ #type exemplar))
- (~ (value@ #type computation))))))
+ (let [typeC (` (All ((~ g!_) (~+ (list\each code.local_identifier type_vars)))
+ (-> (~ (value@ #type exemplar))
+ (~ (value@ #type computation)))))
shareC (` (: (~ typeC)
(.function ((~ g!_) (~ g!_))
(~ (value@ #expression computation)))))]