aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/loop.lux
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/loop.lux94
1 files changed, 47 insertions, 47 deletions
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/loop.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/loop.lux
index 7fc0e8c4d..1f2d6253c 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/loop.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/loop.lux
@@ -1,37 +1,37 @@
(.using
- [library
- [lux {"-" Scope}
- [abstract
- ["[0]" monad {"+" do}]]
- [data
- ["[0]" product]
- ["[0]" text
- ["%" format {"+" format}]]
- [collection
- ["[0]" list ("[1]#[0]" functor mix)]
- ["[0]" set {"+" Set}]]]
- [math
- [number
- ["n" nat]]]
- [target
- ["_" php {"+" Var Expression Label Statement}]]]]
- ["[0]" // "_"
- [runtime {"+" Operation Phase Phase! Generator Generator!}]
- ["[1][0]" case]
+ [library
+ [lux {"-" Scope}
+ [abstract
+ ["[0]" monad {"+" do}]]
+ [data
+ ["[0]" product]
+ ["[0]" text
+ ["%" format {"+" format}]]
+ [collection
+ ["[0]" list ("[1]#[0]" functor mix)]
+ ["[0]" set {"+" Set}]]]
+ [math
+ [number
+ ["n" nat]]]
+ [target
+ ["_" php {"+" Var Expression Label Statement}]]]]
+ ["[0]" // "_"
+ [runtime {"+" Operation Phase Phase! Generator Generator!}]
+ ["[1][0]" case]
+ ["/[1]" // "_"
+ ["[1][0]" reference]
["/[1]" // "_"
- ["[1][0]" reference]
+ [synthesis
+ ["[0]" case]]
["/[1]" // "_"
- [synthesis
- ["[0]" case]]
- ["/[1]" // "_"
- ["[0]"synthesis {"+" Scope Synthesis}]
- ["[1][0]" generation]
- ["//[1]" /// "_"
- ["[1][0]" phase]
- [meta
- [archive {"+" Archive}]]
- [reference
- [variable {"+" Register}]]]]]]])
+ ["[0]"synthesis {"+" Scope Synthesis}]
+ ["[1][0]" generation]
+ ["//[1]" /// "_"
+ ["[1][0]" phase]
+ [meta
+ [archive {"+" Archive}]]
+ [reference
+ [variable {"+" Register}]]]]]]])
(def: @scope
(-> Nat Label)
@@ -84,23 +84,23 @@
(list#each (|>> product.left (n.+ start) //case.register _.parameter)))
@loop (_.constant (///reference.artifact [loop_module loop_artifact]))
loop_variables (set.of_list _.hash (list#each product.right locals))
- referenced_variables (: (-> Synthesis (Set Var))
- (|>> synthesis.path/then
- //case.dependencies
- (set.of_list _.hash)))
- [directive instantiation] (: [Statement Expression]
- (case (|> (list#each referenced_variables initsS+)
- (list#mix set.union (referenced_variables bodyS))
- (set.difference loop_variables)
- set.list)
- {.#End}
- [(_.define_function @loop (list) scope!)
- @loop]
+ referenced_variables (is (-> Synthesis (Set Var))
+ (|>> synthesis.path/then
+ //case.dependencies
+ (set.of_list _.hash)))
+ [directive instantiation] (is [Statement Expression]
+ (case (|> (list#each referenced_variables initsS+)
+ (list#mix set.union (referenced_variables bodyS))
+ (set.difference loop_variables)
+ set.list)
+ {.#End}
+ [(_.define_function @loop (list) scope!)
+ @loop]
- foreigns
- [(<| (_.define_function @loop (list#each _.parameter foreigns))
- (_.return (_.closure (list#each _.parameter foreigns) (list) scope!)))
- (_.apply/* foreigns @loop)]))]
+ foreigns
+ [(<| (_.define_function @loop (list#each _.parameter foreigns))
+ (_.return (_.closure (list#each _.parameter foreigns) (list) scope!)))
+ (_.apply/* foreigns @loop)]))]
_ (/////generation.execute! directive)
_ (/////generation.save! loop_artifact directive)]
(in (_.apply/* (list) instantiation)))))