From 2e86fefe6f15877e8c46a45411a9cbd04b26e2e3 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Tue, 5 Dec 2017 22:55:11 -0400 Subject: - WIP: Caching. --- .../source/luxc/module/descriptor/annotation.lux | 81 ---------------------- 1 file changed, 81 deletions(-) delete mode 100644 new-luxc/source/luxc/module/descriptor/annotation.lux (limited to 'new-luxc/source/luxc/module/descriptor/annotation.lux') diff --git a/new-luxc/source/luxc/module/descriptor/annotation.lux b/new-luxc/source/luxc/module/descriptor/annotation.lux deleted file mode 100644 index 8ac220d0f..000000000 --- a/new-luxc/source/luxc/module/descriptor/annotation.lux +++ /dev/null @@ -1,81 +0,0 @@ -(.module: - lux - (lux (control codec - monad) - (data [text] - (text format - ["l" lexer "l/" Monad]) - [number] - error - (coll [list "L/" Functor]))) - ["&" ../common] - [luxc ["&." parser]]) - -(def: dummy-cursor Cursor ["" +1 +0]) - -(do-template [ ] - [(def: &.Signal )] - - [ident-signal "@"] - [bool-signal "B"] - [nat-signal "N"] - [int-signal "I"] - [deg-signal "D"] - [frac-signal "R"] - [text-signal "T"] - [list-signal "%"] - [dict-signal "#"] - ) - -(def: (encode-ident [module name]) - (-> Ident Text) - (format ident-signal - module &.ident-separator name - &.stop-signal)) - -(def: (encode-text value) - (-> Text Text) - (format text-signal - (%t value) - &.stop-signal)) - -(def: (encode-ann-value value) - (-> Ann-Value Text) - (case value - (^template [ ] - ( 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]] - (format (encode-text k) - (encode-ann-value v))))]))) - -(def: ann-value-decoder - (l.Lexer Ann-Value) - (with-expansions - [ (do-template [ ] - [(do l.Monad - [])])] - ($_ l.either - - (|> ... (l.after (l.text bool-signal))) - ))) - -(def: encode-anns - (-> Anns Text) - (&.encode-list (function [[ident value]] - (format (encode-ident ident) - (encode-ann-value value))))) - -(struct: #export _ (Codec Text Anns) - (def: encode encode-anns) - (def: decode decode-anns)) -- cgit v1.2.3