diff options
author | Eduardo Julian | 2020-03-18 21:38:34 -0400 |
---|---|---|
committer | Eduardo Julian | 2020-03-18 21:38:34 -0400 |
commit | 30801bcf8fbb1be7ae8f193edfa71e6c4909a4c3 (patch) | |
tree | d6f4f9335664f4d25c6c037e848d0743d211ff74 /new-luxc/source/luxc/lang/translation/jvm/extension/common.lux | |
parent | 71c99d63a313d497c3881ab06752f05e3af33350 (diff) |
No passing the archive as a parameter to all phases.
Diffstat (limited to 'new-luxc/source/luxc/lang/translation/jvm/extension/common.lux')
-rw-r--r-- | new-luxc/source/luxc/lang/translation/jvm/extension/common.lux | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/new-luxc/source/luxc/lang/translation/jvm/extension/common.lux b/new-luxc/source/luxc/lang/translation/jvm/extension/common.lux index cc703f17d..6d3cbbd46 100644 --- a/new-luxc/source/luxc/lang/translation/jvm/extension/common.lux +++ b/new-luxc/source/luxc/lang/translation/jvm/extension/common.lux @@ -19,6 +19,8 @@ [tool [compiler ["." phase] + [meta + [archive (#+ Archive)]] [language [lux ["." synthesis (#+ Synthesis %synthesis)] @@ -40,12 +42,12 @@ (def: #export (custom [parser handler]) (All [s] (-> [(Parser s) - (-> Text Phase s (Operation Inst))] + (-> Text Phase Archive s (Operation Inst))] Handler)) - (function (_ extension-name phase input) + (function (_ extension-name phase archive input) (case (<s>.run parser input) (#try.Success input') - (handler extension-name phase input') + (handler extension-name phase archive input') (#try.Failure error) (phase.throw extension.invalid-syntax [extension-name %synthesis input])))) @@ -87,17 +89,17 @@ (<>.some (<s>.tuple ($_ <>.and (<s>.tuple (<>.many <s>.i64)) <s>.any)))) - (function (_ extension-name phase [input else conditionals]) + (function (_ extension-name phase archive [input else conditionals]) (<| _.with-label (function (_ @end)) _.with-label (function (_ @else)) (do phase.monad - [inputG (phase input) - elseG (phase else) + [inputG (phase archive input) + elseG (phase archive else) conditionalsG+ (: (Operation (List [(List [Int Label]) Inst])) (monad.map @ (function (_ [chars branch]) (do @ - [branchG (phase branch)] + [branchG (phase archive branch)] (wrap (<| _.with-label (function (_ @branch)) [(list@map (function (_ char) [(.int char) @branch]) |