aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/tool/compiler
diff options
context:
space:
mode:
authorEduardo Julian2022-02-12 05:29:58 -0400
committerEduardo Julian2022-02-12 05:29:58 -0400
commit8b6d474dd5d2b323d1dba29359460af4708402ea (patch)
tree32a752dbced8f5620e9f4f57be5b36ef33860f31 /stdlib/source/library/lux/tool/compiler
parent105ab334201646be6b594d3d1215297e3b629a10 (diff)
Optimizations for the pure-Lux JVM compiler. [Part 2]
Diffstat (limited to 'stdlib/source/library/lux/tool/compiler')
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/analysis/type.lux3
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/lux.lux14
2 files changed, 9 insertions, 8 deletions
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/analysis/type.lux b/stdlib/source/library/lux/tool/compiler/language/lux/analysis/type.lux
index bd2c04844..db622ca0c 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/analysis/type.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/analysis/type.lux
@@ -117,8 +117,7 @@
[var (..check check.var)
.let [[@it :it:] var]
it (it var)
- ... _ (..check (check.forget! @it))
- ]
+ _ (..check (check.forget! @it))]
(in it)))
(def: .public (inferring action)
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/lux.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/lux.lux
index d747ff070..21cf02c95 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/lux.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/lux.lux
@@ -136,12 +136,14 @@
(function (_ extension_name analyse archive args)
(case args
(^ (list opC))
- (do ////.monad
- [[var_id varT] (typeA.check check.var)
- _ (typeA.inference (type (Either Text varT)))
- opA (<| (typeA.expecting (type (-> .Any varT)))
- (analyse archive opC))]
- (in {////analysis.#Extension extension_name (list opA)}))
+ (<| typeA.with_var
+ (function (_ [@var :var:]))
+ (do [! ////.monad]
+ [_ (typeA.inference (type (Either Text :var:)))]
+ (|> opC
+ (analyse archive)
+ (typeA.expecting (type (-> .Any :var:)))
+ (# ! each (|>> list {////analysis.#Extension extension_name})))))
_
(////analysis.except ///.incorrect_arity [extension_name 1 (list.size args)]))))