diff options
author | Eduardo Julian | 2017-05-07 14:30:48 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-05-07 14:30:48 -0400 |
commit | db697bb636e2341d26bb188cc1b9981a1ab505d7 (patch) | |
tree | a1de1c7b0e48df4496e0e9183f485de7c341286c /new-luxc/source/luxc | |
parent | 4744552df1f1285d600a13ed0a3cf8be2f336030 (diff) |
- Changed the name of "let%" to "with-expansions".
Diffstat (limited to '')
-rw-r--r-- | new-luxc/source/luxc/io.jvm.lux | 37 | ||||
-rw-r--r-- | new-luxc/source/luxc/module/descriptor/annotation.lux | 7 | ||||
-rw-r--r-- | new-luxc/source/luxc/module/descriptor/type.lux | 75 |
3 files changed, 61 insertions, 58 deletions
diff --git a/new-luxc/source/luxc/io.jvm.lux b/new-luxc/source/luxc/io.jvm.lux index ab62b8f43..18142e77a 100644 --- a/new-luxc/source/luxc/io.jvm.lux +++ b/new-luxc/source/luxc/io.jvm.lux @@ -67,24 +67,25 @@ (-> (List &;Path) Text (P;Promise (E;Error [&;Path Text]))) (let [host-path (format module-name host-extension ".lux") lux-path (format module-name ".lux")] - (let% [<tries> (do-template [<path>] - [(do P;Monad<Promise> - [?file (find-in-sources <path> source-dirs)]) - (case ?file - (#;Some file) - (do @ - [?code (read-source-code file)] - (case ?code - (#E;Error error) - (wrap (#E;Error error)) - - (#E;Success code) - (wrap (#E;Success [<path> code])))) - - #;None)] - - [host-path] - [lux-path])] + (with-expansions + [<tries> (do-template [<path>] + [(do P;Monad<Promise> + [?file (find-in-sources <path> source-dirs)]) + (case ?file + (#;Some file) + (do @ + [?code (read-source-code file)] + (case ?code + (#E;Error error) + (wrap (#E;Error error)) + + (#E;Success code) + (wrap (#E;Success [<path> code])))) + + #;None)] + + [host-path] + [lux-path])] (<| <tries> (wrap (#E;Error (format "Module cannot be found: " module-name))))))) diff --git a/new-luxc/source/luxc/module/descriptor/annotation.lux b/new-luxc/source/luxc/module/descriptor/annotation.lux index 9a687e02a..d5e0d8000 100644 --- a/new-luxc/source/luxc/module/descriptor/annotation.lux +++ b/new-luxc/source/luxc/module/descriptor/annotation.lux @@ -64,9 +64,10 @@ (def: ann-value-decoder (l;Lexer Ann-Value) - (let% [<simple> (do-template [<tag> <lexer> <signal>] - [(do l;Monad<Lexer> - [])])] + (with-expansions + [<simple> (do-template [<tag> <lexer> <signal>] + [(do l;Monad<Lexer> + [])])] ($_ l;either <simple> (|> ... (l;after (l;text bool-signal))) diff --git a/new-luxc/source/luxc/module/descriptor/type.lux b/new-luxc/source/luxc/module/descriptor/type.lux index d9079e893..d661aa385 100644 --- a/new-luxc/source/luxc/module/descriptor/type.lux +++ b/new-luxc/source/luxc/module/descriptor/type.lux @@ -76,43 +76,44 @@ (l;Lexer Type) (l;rec (function [type-decoder] - (let% [<simple> (do-template [<type> <signal>] - [(|> (l/wrap <type>) (l;after (l;text <signal>)))] - - [Type type-signal] - [#;Void void-signal] - [#;Unit unit-signal]) - <combinators> (do-template [<tag> <prefix>] - [(do l;Monad<Lexer> - [_ (l;text <prefix>) - left type-decoder - right type-decoder] - (wrap (<tag> left right)))] - - [#;Product product-signal] - [#;Sum sum-signal] - [#;Function function-signal] - [#;App application-signal]) - <abstractions> (do-template [<tag> <prefix>] - [(do l;Monad<Lexer> - [_ (l;text <prefix>) - env (&;decode-list type-decoder) - body type-decoder] - (wrap (<tag> env body)))] - - [#;UnivQ uq-signal] - [#;ExQ eq-signal]) - <wildcards> (do-template [<tag> <prefix>] - [(do l;Monad<Lexer> - [_ (l;text <prefix>) - id (l;codec number;Codec<Text,Int> - (l;some' l;digit)) - _ (l;text &;stop-signal)] - (wrap (<tag> (int-to-nat id))))] - - [#;Bound bound-signal] - [#;Ex ex-signal] - [#;Var var-signal])] + (with-expansions + [<simple> (do-template [<type> <signal>] + [(|> (l/wrap <type>) (l;after (l;text <signal>)))] + + [Type type-signal] + [#;Void void-signal] + [#;Unit unit-signal]) + <combinators> (do-template [<tag> <prefix>] + [(do l;Monad<Lexer> + [_ (l;text <prefix>) + left type-decoder + right type-decoder] + (wrap (<tag> left right)))] + + [#;Product product-signal] + [#;Sum sum-signal] + [#;Function function-signal] + [#;App application-signal]) + <abstractions> (do-template [<tag> <prefix>] + [(do l;Monad<Lexer> + [_ (l;text <prefix>) + env (&;decode-list type-decoder) + body type-decoder] + (wrap (<tag> env body)))] + + [#;UnivQ uq-signal] + [#;ExQ eq-signal]) + <wildcards> (do-template [<tag> <prefix>] + [(do l;Monad<Lexer> + [_ (l;text <prefix>) + id (l;codec number;Codec<Text,Int> + (l;some' l;digit)) + _ (l;text &;stop-signal)] + (wrap (<tag> (int-to-nat id))))] + + [#;Bound bound-signal] + [#;Ex ex-signal] + [#;Var var-signal])] ($_ l;either (do l;Monad<Lexer> [_ (l;text host-signal) |