aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/tool/compiler
diff options
context:
space:
mode:
authorEduardo Julian2021-08-14 03:09:58 -0400
committerEduardo Julian2021-08-14 03:09:58 -0400
commit6fd22846f21b8b70b7867e989109d14a366c0a3e (patch)
tree9086774968ad944133dc5cf29c546add6e13a4b6 /stdlib/source/library/lux/tool/compiler
parente53c1a090eb9cfac3cb23d10d981648d02518ed1 (diff)
Moved documentation-generation machinery to its own module.
Diffstat (limited to '')
-rw-r--r--stdlib/source/library/lux/tool/compiler/default/platform.lux18
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/case.lux6
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/inference.lux2
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/scope.lux9
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/jvm.lux2
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/extension.lux8
-rw-r--r--stdlib/source/library/lux/tool/compiler/meta/io/context.lux2
7 files changed, 25 insertions, 22 deletions
diff --git a/stdlib/source/library/lux/tool/compiler/default/platform.lux b/stdlib/source/library/lux/tool/compiler/default/platform.lux
index 174058fab..f19ec248c 100644
--- a/stdlib/source/library/lux/tool/compiler/default/platform.lux
+++ b/stdlib/source/library/lux/tool/compiler/default/platform.lux
@@ -328,10 +328,10 @@
(function (_ mapping)
(let [with_dependence+transitives
(|> mapping
- (dictionary.upsert source ..empty (set.has target))
+ (dictionary.revised' source ..empty (set.has target))
(dictionary.revised source (set.union forward)))]
(list\fold (function (_ previous)
- (dictionary.upsert previous ..empty (set.has target)))
+ (dictionary.revised' previous ..empty (set.has target)))
with_dependence+transitives
(set.list backward))))))]
(|> dependence
@@ -414,7 +414,7 @@
archive.ID
<Signal>])])
(:expected
- (stm.commit
+ (stm.commit!
(do {! stm.monad}
[dependence (if (text\= archive.runtime_module importer)
(stm.read dependence)
@@ -475,12 +475,12 @@
(in result)
(#try.Success [resulting_archive resulting_state])
- (stm.commit (do stm.monad
- [[_ [merged_archive _]] (stm.update (function (_ [archive state])
- [(archive.merged resulting_archive archive)
- state])
- current)]
- (in (#try.Success [merged_archive resulting_state])))))
+ (stm.commit! (do stm.monad
+ [[_ [merged_archive _]] (stm.update (function (_ [archive state])
+ [(archive.merged resulting_archive archive)
+ state])
+ current)]
+ (in (#try.Success [merged_archive resulting_state])))))
_ (async.future (resolver result))]
(in [])))]
return)))))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/case.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/case.lux
index 454704918..2188bb54a 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/case.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/case.lux
@@ -198,11 +198,11 @@
num_tags)
num_sub_patterns (list.size sub_patterns)
matches (cond (n.< num_subs num_sub_patterns)
- (let [[prefix suffix] (list.split (dec num_sub_patterns) subs)]
+ (let [[prefix suffix] (list.split_at (dec num_sub_patterns) subs)]
(list.zipped/2 (list\compose prefix (list (type.tuple suffix))) sub_patterns))
(n.> num_subs num_sub_patterns)
- (let [[prefix suffix] (list.split (dec num_subs) sub_patterns)]
+ (let [[prefix suffix] (list.split_at (dec num_subs) sub_patterns)]
(list.zipped/2 subs (list\compose prefix (list (code.tuple suffix)))))
... (n.= num_subs num_sub_patterns)
@@ -262,7 +262,7 @@
[[testP nextA] (if (and (n.> num_cases size_sum)
(n.= (dec num_cases) idx))
(analyse_pattern #.None
- (type.variant (list.drop (dec num_cases) flat_sum))
+ (type.variant (list.after (dec num_cases) flat_sum))
(` [(~+ values)])
next)
(analyse_pattern #.None caseT (` [(~+ values)]) next))]
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/inference.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/inference.lux
index 1a8d43477..af25a5856 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/inference.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/inference.lux
@@ -279,7 +279,7 @@
(/.except ..smaller_variant_than_expected [expected_size actual_size])
(n.= boundary tag)
- (let [caseT (type.variant (list.drop boundary cases))]
+ (let [caseT (type.variant (list.after boundary cases))]
(///\in (if (n.= 0 depth)
(type.function (list caseT) currentT)
(let [replace' (replace (|> depth dec (n.* 2)) inferT)]
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/scope.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/scope.lux
index ae6034b65..98c36ec05 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/scope.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/scope.lux
@@ -23,8 +23,11 @@
["." variable (#+ Register Variable)]]
["#" phase]]]])
-(type: Local (Bindings Text [Type Register]))
-(type: Foreign (Bindings Text [Type Variable]))
+(type: Local
+ (Bindings Text [Type Register]))
+
+(type: Foreign
+ (Bindings Text [Type Variable]))
(def: (local? name scope)
(-> Text Scope Bit)
@@ -79,7 +82,7 @@
(function (_ state)
(let [[inner outer] (|> state
(get@ #.scopes)
- (list.split_when (|>> (reference? name) not)))]
+ (list.split_when (|>> (reference? name))))]
(case outer
#.End
(#.Right [state #.None])
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/jvm.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/jvm.lux
index 4913607a6..6fc53dd20 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/jvm.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/jvm.lux
@@ -1169,7 +1169,7 @@
[name (index_parameter idx)]))
list.reversed)
num_owner_tvars (list.size owner_tvars)
- owner_tvarsT (|> lux_tvars (list.take num_owner_tvars) (list\map product.right))
+ owner_tvarsT (|> lux_tvars (list.first num_owner_tvars) (list\map product.right))
mapping (dictionary.of_list text.hash lux_tvars)]
[owner_tvarsT mapping]))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/extension.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/extension.lux
index b59e5ce37..6a5f40ef7 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/extension.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/extension.lux
@@ -5,7 +5,7 @@
["." monad (#+ do)]]
[control
[parser
- ["s" code]]]
+ ["<.>" code]]]
[data
[collection
["." list ("#\." functor)]]]
@@ -21,7 +21,7 @@
[///
["#" phase]]]])
-(syntax: (Vector [size s.nat
+(syntax: (Vector [size <code>.nat
elemT <code>.any])
(in (list (` [(~+ (list.repeated size elemT))]))))
@@ -31,8 +31,8 @@
(type: .public (Trinary of) (-> (Vector 3 of) of))
(type: .public (Variadic of) (-> (List of) of))
-(syntax: (arity: [arity s.nat
- name s.local_identifier
+(syntax: (arity: [arity <code>.nat
+ name <code>.local_identifier
type <code>.any])
(with_identifiers [g!_ g!extension g!name g!phase g!archive g!inputs g!of g!anchor g!expression g!directive]
(do {! meta.monad}
diff --git a/stdlib/source/library/lux/tool/compiler/meta/io/context.lux b/stdlib/source/library/lux/tool/compiler/meta/io/context.lux
index 3e797c325..0c7969507 100644
--- a/stdlib/source/library/lux/tool/compiler/meta/io/context.lux
+++ b/stdlib/source/library/lux/tool/compiler/meta/io/context.lux
@@ -147,7 +147,7 @@
(if (text.ends_with? ..lux_extension file)
(do !
[source_code (\ fs read file)]
- (async\in (dictionary.try_put (file.name fs file) source_code enumeration)))
+ (async\in (dictionary.has' (file.name fs file) source_code enumeration)))
(in enumeration)))
enumeration))
(\ ! join))]