diff options
Diffstat (limited to 'stdlib/source/lux/compiler/default/phase/statement/total.lux')
-rw-r--r-- | stdlib/source/lux/compiler/default/phase/statement/total.lux | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/stdlib/source/lux/compiler/default/phase/statement/total.lux b/stdlib/source/lux/compiler/default/phase/statement/total.lux new file mode 100644 index 000000000..d2b046f5f --- /dev/null +++ b/stdlib/source/lux/compiler/default/phase/statement/total.lux @@ -0,0 +1,27 @@ +(.module: + [lux #* + [control + [monad (#+ do)] + ["ex" exception (#+ exception:)]] + [data + [text + format]]] + ["." // (#+ Phase) + ["/." // + ["." extension]]]) + +(do-template [<name>] + [(exception: #export (<name> {code Code}) + (ex.report ["Statement" (%code code)]))] + + [unrecognized-statement] + ) + +(def: #export (phase code) + Phase + (case code + (^ [_ (#.Form (list& [_ (#.Text extension-name)] extension-args))]) + (extension.apply phase [extension-name extension-args]) + + _ + (///.throw unrecognized-statement code))) |