(.module: [lux #* [tool [compiler ["." synthesis] [phase ["." extension]]]]] [luxc [lang [host [jvm (#+ Phase)]]]] [// ["." common] ["." primitive] ["." structure] ["." reference] ["." case] ["." loop] ["." function]]) (def: #export (translate synthesis) Phase (case synthesis (^ (synthesis.bit value)) (primitive.bit value) (^ (synthesis.i64 value)) (primitive.i64 value) (^ (synthesis.f64 value)) (primitive.f64 value) (^ (synthesis.text value)) (primitive.text value) (^ (synthesis.variant [lefts right? value])) (structure.variant translate lefts right? value) (^ (synthesis.tuple members)) (structure.tuple translate members) (^ (synthesis.variable variable)) (reference.variable variable) (^ (synthesis.constant constant)) (reference.constant constant) (^ (synthesis.branch/let [input register expr])) (case.let translate input register expr) (^ (synthesis.branch/if [test then else])) (case.if translate test then else) (^ (synthesis.branch/case [input path])) (case.case translate input path) (^ (synthesis.loop/recur data)) (loop.recur translate data) (^ (synthesis.loop/scope data)) (loop.scope translate data) (^ (synthesis.function/apply apply)) (function.call translate apply) (^ (synthesis.function/abstraction abstraction)) (function.function translate abstraction) (#synthesis.Extension extension) (extension.apply translate extension)))