diff options
-rw-r--r-- | stdlib/source/lux/compiler/default/phase/translation.lux | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/stdlib/source/lux/compiler/default/phase/translation.lux b/stdlib/source/lux/compiler/default/phase/translation.lux index f9d61c4af..c0242bd38 100644 --- a/stdlib/source/lux/compiler/default/phase/translation.lux +++ b/stdlib/source/lux/compiler/default/phase/translation.lux @@ -42,9 +42,9 @@ #inner-functions Nat}) (signature: #export (Host expression statement) - (: (-> expression (Error Any)) + (: (-> Text expression (Error Any)) evaluate!) - (: (-> statement (Error Any)) + (: (-> Text statement (Error Any)) execute!)) (type: #export (Buffer statement) (Row [Name statement])) @@ -157,12 +157,17 @@ [_ (extension.update (update@ #counter inc))] (extension.read (get@ #counter)))) +(def: (temp-label state) + (All [anchor expression statement] + (-> (State anchor expression statement) Text)) + (format (get@ [#context #scope-name] state) " " (%n (get@ #counter state)))) + (do-template [<name> <inputT>] [(def: #export (<name> code) (All [anchor expression statement] (-> <inputT> (Operation anchor expression statement Any))) (function (_ (^@ stateE [bundle state])) - (case (:: (get@ #host state) <name> code) + (case (:: (get@ #host state) <name> (temp-label state) code) (#error.Error error) (ex.throw cannot-interpret error) |