From db697bb636e2341d26bb188cc1b9981a1ab505d7 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sun, 7 May 2017 14:30:48 -0400 Subject: - Changed the name of "let%" to "with-expansions". --- new-luxc/source/luxc/io.jvm.lux | 37 +++++------ .../source/luxc/module/descriptor/annotation.lux | 7 +- new-luxc/source/luxc/module/descriptor/type.lux | 75 +++++++++++----------- 3 files changed, 61 insertions(+), 58 deletions(-) (limited to 'new-luxc/source/luxc') 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% [ (do-template [] - [(do P;Monad - [?file (find-in-sources 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 [ code])))) - - #;None)] - - [host-path] - [lux-path])] + (with-expansions + [ (do-template [] + [(do P;Monad + [?file (find-in-sources 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 [ code])))) + + #;None)] + + [host-path] + [lux-path])] (<| (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% [ (do-template [ ] - [(do l;Monad - [])])] + (with-expansions + [ (do-template [ ] + [(do l;Monad + [])])] ($_ l;either (|> ... (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% [ (do-template [ ] - [(|> (l/wrap ) (l;after (l;text )))] - - [Type type-signal] - [#;Void void-signal] - [#;Unit unit-signal]) - (do-template [ ] - [(do l;Monad - [_ (l;text ) - left type-decoder - right type-decoder] - (wrap ( left right)))] - - [#;Product product-signal] - [#;Sum sum-signal] - [#;Function function-signal] - [#;App application-signal]) - (do-template [ ] - [(do l;Monad - [_ (l;text ) - env (&;decode-list type-decoder) - body type-decoder] - (wrap ( env body)))] - - [#;UnivQ uq-signal] - [#;ExQ eq-signal]) - (do-template [ ] - [(do l;Monad - [_ (l;text ) - id (l;codec number;Codec - (l;some' l;digit)) - _ (l;text &;stop-signal)] - (wrap ( (int-to-nat id))))] - - [#;Bound bound-signal] - [#;Ex ex-signal] - [#;Var var-signal])] + (with-expansions + [ (do-template [ ] + [(|> (l/wrap ) (l;after (l;text )))] + + [Type type-signal] + [#;Void void-signal] + [#;Unit unit-signal]) + (do-template [ ] + [(do l;Monad + [_ (l;text ) + left type-decoder + right type-decoder] + (wrap ( left right)))] + + [#;Product product-signal] + [#;Sum sum-signal] + [#;Function function-signal] + [#;App application-signal]) + (do-template [ ] + [(do l;Monad + [_ (l;text ) + env (&;decode-list type-decoder) + body type-decoder] + (wrap ( env body)))] + + [#;UnivQ uq-signal] + [#;ExQ eq-signal]) + (do-template [ ] + [(do l;Monad + [_ (l;text ) + id (l;codec number;Codec + (l;some' l;digit)) + _ (l;text &;stop-signal)] + (wrap ( (int-to-nat id))))] + + [#;Bound bound-signal] + [#;Ex ex-signal] + [#;Var var-signal])] ($_ l;either (do l;Monad [_ (l;text host-signal) -- cgit v1.2.3