diff options
Diffstat (limited to 'stdlib/source/lux/tool/compiler/statement.lux')
-rw-r--r-- | stdlib/source/lux/tool/compiler/statement.lux | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/stdlib/source/lux/tool/compiler/statement.lux b/stdlib/source/lux/tool/compiler/statement.lux index 7f251c42d..49fd51c7b 100644 --- a/stdlib/source/lux/tool/compiler/statement.lux +++ b/stdlib/source/lux/tool/compiler/statement.lux @@ -1,6 +1,14 @@ (.module: - [lux #*] + [lux (#- Module) + [data + [text + format] + [collection + ["." list ("#;." monoid)]]]] [// + [meta + [archive + [descriptor (#+ Module)]]] ["." analysis] ["." synthesis] ["." phase @@ -19,9 +27,27 @@ #generation (Component (generation.State+ anchor expression statement) (generation.Phase anchor expression statement))}) +(type: #export Import + {#module Module + #alias Text}) + +(type: #export Requirements + {#imports (List Import) + #referrals (List Code)}) + +(def: #export no-requirements + Requirements + {#imports (list) + #referrals (list)}) + +(def: #export (merge-requirements left right) + (-> Requirements Requirements Requirements) + {#imports (list;compose (get@ #imports left) (get@ #imports right)) + #referrals (list;compose (get@ #referrals left) (get@ #referrals right))}) + (do-template [<special> <general>] [(type: #export (<special> anchor expression statement) - (<general> (..State anchor expression statement) Code Any))] + (<general> (..State anchor expression statement) Code Requirements))] [State+ extension.State] [Operation extension.Operation] @@ -40,7 +66,7 @@ (set@ [<component> #..state])] operation)))] - [lift-analysis #..analysis analysis.Operation] - [lift-synthesis #..synthesis synthesis.Operation] + [lift-analysis #..analysis analysis.Operation] + [lift-synthesis #..synthesis synthesis.Operation] [lift-generation #..generation (generation.Operation anchor expression statement)] ) |