From 4433c9bcd6c6cac44c018aad2e21a5b4d7cc4896 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Wed, 29 Nov 2017 22:49:56 -0400 Subject: - Adapted main codebase to the latest syntatic changes. --- .../source/luxc/module/descriptor/annotation.lux | 42 ++++---- new-luxc/source/luxc/module/descriptor/common.lux | 14 +-- new-luxc/source/luxc/module/descriptor/type.lux | 120 ++++++++++----------- 3 files changed, 88 insertions(+), 88 deletions(-) (limited to 'new-luxc/source/luxc/module') diff --git a/new-luxc/source/luxc/module/descriptor/annotation.lux b/new-luxc/source/luxc/module/descriptor/annotation.lux index 2ed106545..8ac220d0f 100644 --- a/new-luxc/source/luxc/module/descriptor/annotation.lux +++ b/new-luxc/source/luxc/module/descriptor/annotation.lux @@ -1,4 +1,4 @@ -(;module: +(.module: lux (lux (control codec monad) @@ -9,12 +9,12 @@ error (coll [list "L/" Functor]))) ["&" ../common] - [luxc ["&;" parser]]) + [luxc ["&." parser]]) (def: dummy-cursor Cursor ["" +1 +0]) (do-template [ ] - [(def: &;Signal )] + [(def: &.Signal )] [ident-signal "@"] [bool-signal "B"] @@ -30,14 +30,14 @@ (def: (encode-ident [module name]) (-> Ident Text) (format ident-signal - module &;ident-separator name - &;stop-signal)) + module &.ident-separator name + &.stop-signal)) (def: (encode-text value) (-> Text Text) (format text-signal (%t value) - &;stop-signal)) + &.stop-signal)) (def: (encode-ann-value value) (-> Ann-Value Text) @@ -46,33 +46,33 @@ ( value) (format ( value) - &;stop-signal)) - ([#;BoolA bool-signal %b] - [#;NatA nat-signal %n] - [#;IntA int-signal %i] - [#;DegA deg-signal %d] - [#;FracA frac-signal %r] - [#;TextA text-signal %t] - [#;IdentA ident-signal %ident] - [#;ListA list-signal (&;encode-list encode-ann-value)] - [#;DictA dict-signal (&;encode-list (function [[k v]] + &.stop-signal)) + ([#.BoolA bool-signal %b] + [#.NatA nat-signal %n] + [#.IntA int-signal %i] + [#.DegA deg-signal %d] + [#.FracA frac-signal %r] + [#.TextA text-signal %t] + [#.IdentA ident-signal %ident] + [#.ListA list-signal (&.encode-list encode-ann-value)] + [#.DictA dict-signal (&.encode-list (function [[k v]] (format (encode-text k) (encode-ann-value v))))]))) (def: ann-value-decoder - (l;Lexer Ann-Value) + (l.Lexer Ann-Value) (with-expansions [ (do-template [ ] - [(do l;Monad + [(do l.Monad [])])] - ($_ l;either + ($_ l.either - (|> ... (l;after (l;text bool-signal))) + (|> ... (l.after (l.text bool-signal))) ))) (def: encode-anns (-> Anns Text) - (&;encode-list (function [[ident value]] + (&.encode-list (function [[ident value]] (format (encode-ident ident) (encode-ann-value value))))) diff --git a/new-luxc/source/luxc/module/descriptor/common.lux b/new-luxc/source/luxc/module/descriptor/common.lux index aac438a6f..b123fe852 100644 --- a/new-luxc/source/luxc/module/descriptor/common.lux +++ b/new-luxc/source/luxc/module/descriptor/common.lux @@ -1,4 +1,4 @@ -(;module: +(.module: lux (lux (data [text] (text format @@ -18,20 +18,20 @@ (do-template [ ] [(def: #export Signal )] - [ident-separator ";"] + [ident-separator "."] ) (def: #export (encode-list encode-elem types) (All [a] (-> (-> a Text) (List a) Text)) (format (|> (L/map encode-elem types) - (text;join-with cons-signal)) + (text.join-with cons-signal)) nil-signal)) (def: #export (decode-list decode-elem) - (All [a] (-> (l;Lexer a) (l;Lexer (List a)))) - (l;alt (<| (l;after (l;text nil-signal)) + (All [a] (-> (l.Lexer a) (l.Lexer (List a)))) + (l.alt (<| (l.after (l.text nil-signal)) (l/wrap [])) - (<| (l;seq decode-elem) - (l;after (l;text cons-signal)) + (<| (l.seq decode-elem) + (l.after (l.text cons-signal)) (decode-list decode-elem)))) diff --git a/new-luxc/source/luxc/module/descriptor/type.lux b/new-luxc/source/luxc/module/descriptor/type.lux index 58e29c39e..d72229832 100644 --- a/new-luxc/source/luxc/module/descriptor/type.lux +++ b/new-luxc/source/luxc/module/descriptor/type.lux @@ -1,4 +1,4 @@ -(;module: +(.module: lux (lux (control codec monad) @@ -12,7 +12,7 @@ ["&" ../common]) (do-template [ ] - [(def: &;Signal )] + [(def: &.Signal )] [type-signal "T"] [primitive-signal "^"] @@ -36,109 +36,109 @@ (type/= Type type)) type-signal (case type - (#;Primitive name params) - (format primitive-signal name &;stop-signal (&;encode-list encode-type params)) + (#.Primitive name params) + (format primitive-signal name &.stop-signal (&.encode-list encode-type params)) - #;Void + #.Void void-signal - #;Unit + #.Unit unit-signal (^template [ ] ( left right) (format (encode-type left) (encode-type right))) - ([#;Product product-signal] - [#;Sum sum-signal] - [#;Function function-signal] - [#;App application-signal]) + ([#.Product product-signal] + [#.Sum sum-signal] + [#.Function function-signal] + [#.App application-signal]) (^template [ ] ( env body) - (format (&;encode-list encode-type env) (encode-type body))) - ([#;UnivQ uq-signal] - [#;ExQ eq-signal]) + (format (&.encode-list encode-type env) (encode-type body))) + ([#.UnivQ uq-signal] + [#.ExQ eq-signal]) (^template [ ] ( idx) - (format (%i (nat-to-int idx)) &;stop-signal)) - ([#;Bound bound-signal] - [#;Ex ex-signal] - [#;Var var-signal]) + (format (%i (nat-to-int idx)) &.stop-signal)) + ([#.Bound bound-signal] + [#.Ex ex-signal] + [#.Var var-signal]) - (#;Named [module name] type*) - (format named-signal module &;ident-separator name &;stop-signal (encode-type type*)) + (#.Named [module name] type*) + (format named-signal module &.ident-separator name &.stop-signal (encode-type type*)) ))) (def: type-decoder - (l;Lexer Type) - (l;rec + (l.Lexer Type) + (l.rec (function [type-decoder] (with-expansions [ (do-template [ ] - [(|> (l/wrap ) (l;after (l;text )))] + [(|> (l/wrap ) (l.after (l.text )))] [Type type-signal] - [#;Void void-signal] - [#;Unit unit-signal]) + [#.Void void-signal] + [#.Unit unit-signal]) (do-template [ ] - [(do l;Monad - [_ (l;text ) + [(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]) + [#.Product product-signal] + [#.Sum sum-signal] + [#.Function function-signal] + [#.App application-signal]) (do-template [ ] - [(do l;Monad - [_ (l;text ) - env (&;decode-list type-decoder) + [(do l.Monad + [_ (l.text ) + env (&.decode-list type-decoder) body type-decoder] (wrap ( env body)))] - [#;UnivQ uq-signal] - [#;ExQ eq-signal]) + [#.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)] + [(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 primitive-signal) - name (l;many' (l;none-of &;stop-signal)) - _ (l;text &;stop-signal) - params (&;decode-list type-decoder)] - (wrap (#;Primitive name params))) + [#.Bound bound-signal] + [#.Ex ex-signal] + [#.Var var-signal])] + ($_ l.either + (do l.Monad + [_ (l.text primitive-signal) + name (l.many' (l.none-of &.stop-signal)) + _ (l.text &.stop-signal) + params (&.decode-list type-decoder)] + (wrap (#.Primitive name params))) - (do l;Monad - [_ (l;text named-signal) - module (l;some' (l;none-of &;ident-separator)) - _ (l;text &;ident-separator) - name (l;many' (l;none-of &;stop-signal)) - _ (l;text &;stop-signal) + (do l.Monad + [_ (l.text named-signal) + module (l.some' (l.none-of &.ident-separator)) + _ (l.text &.ident-separator) + name (l.many' (l.none-of &.stop-signal)) + _ (l.text &.stop-signal) unnamed type-decoder] - (wrap (#;Named [module name] unnamed))) + (wrap (#.Named [module name] unnamed))) ))))) (def: (decode-type input) - (-> Text (e;Error Type)) + (-> Text (e.Error Type)) (|> type-decoder - (l;before l;end) - (l;run input))) + (l.before l.end) + (l.run input))) (struct: #export _ (Codec Text Type) (def: encode encode-type) -- cgit v1.2.3