diff options
author | Eduardo Julian | 2017-05-01 18:15:14 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-05-01 18:15:14 -0400 |
commit | 3175ae85d62ff6f692b8cc127f56c6569041d788 (patch) | |
tree | 83340fd6cb5c287f13080d7ead386b1d161b8e77 /new-luxc/source/program.lux | |
parent | 94cca1d49c0d3f6d328a81eaf6ce9660a6f149c1 (diff) |
- WIP: Some initial implementations for some re-written infrastructure.
Diffstat (limited to 'new-luxc/source/program.lux')
-rw-r--r-- | new-luxc/source/program.lux | 51 |
1 files changed, 13 insertions, 38 deletions
diff --git a/new-luxc/source/program.lux b/new-luxc/source/program.lux index b1619e830..07f21962b 100644 --- a/new-luxc/source/program.lux +++ b/new-luxc/source/program.lux @@ -3,27 +3,16 @@ (lux (control monad) [io #- run] [cli #+ program: CLI Monad<CLI>]) - (luxc ["&;" parser])) - -(type: Path Text) - -(type: Platform - #JVM - #JS) - -(type: Mode - #Release - #Debug) + (luxc ["&" base] + ["&;" parser] + ["&;" compiler] + (module (descriptor ["&;" type])) + )) (type: Compilation - {#mode Mode - #platform Platform - #program Path - #target Path}) - -(type: Inputs - {#resources (List Path) - #sources (List Path)}) + {#mode &;Mode + #program &;Path + #target &;Path}) (def: (marker tokens) (-> (List Text) (CLI Unit)) @@ -36,37 +25,23 @@ cli;any)) (def: mode^ - (CLI Mode) + (CLI &;Mode) ($_ cli;alt (marker (list "release")) (marker (list "debug")))) -(def: platform^ - (CLI Platform) - ($_ cli;alt - (marker (list "jvm")) - (marker (list "js")))) - (def: compilation^ (CLI Compilation) ($_ cli;seq mode^ - platform^ (tagged (list "-p" "--program")) (tagged (list "-t" "--target")))) -(def: inputs^ - (CLI Inputs) - ($_ cli;seq - (cli;some (tagged (list "-r" "--resource"))) - (cli;some (tagged (list "-s" "--source"))))) - -(program: ([[command [resources sources]] - (cli;seq (cli;opt compilation^) - inputs^)]) +(program: ([command (cli;opt compilation^)] + [sources (cli;some (tagged (list "-s" "--source")))]) (case command #;None (io (log! "Hello, REPL!")) - (#;Some [mode platform program target]) - (io (log! "Hello, compilation!")))) + (#;Some [mode program target]) + (&compiler;compile-program mode program target sources))) |