aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang/extension.lux
diff options
context:
space:
mode:
authorEduardo Julian2018-05-23 02:04:47 -0400
committerEduardo Julian2018-05-23 02:04:47 -0400
commit72950a540be3dc49a107700c77c0195db16a4f58 (patch)
tree0f36aa21abad840e1a4a29215a5bfb9bb85659a7 /new-luxc/source/luxc/lang/extension.lux
parent14e96f5e5dad439383d63e60a52169cc2e7aaa5c (diff)
- Migrated special-form analysis to stdlib.
Diffstat (limited to '')
-rw-r--r--stdlib/source/lux/lang/extension.lux (renamed from new-luxc/source/luxc/lang/extension.lux)59
1 files changed, 29 insertions, 30 deletions
diff --git a/new-luxc/source/luxc/lang/extension.lux b/stdlib/source/lux/lang/extension.lux
index 254dd18ca..03fd81d71 100644
--- a/new-luxc/source/luxc/lang/extension.lux
+++ b/stdlib/source/lux/lang/extension.lux
@@ -6,34 +6,30 @@
[text]
(coll (dictionary ["dict" unordered #+ Dict])))
[macro])
- [//]
- (// ["la" analysis]
- ["ls" synthesis]))
+ [// #+ Eval]
+ (// [".L" analysis #+ Analyser]
+ [".L" synthesis]))
(do-template [<name>]
[(exception: #export (<name> {message Text})
message)]
- [Unknown-Analysis]
- [Unknown-Synthesis]
- [Unknown-Translation]
- [Unknown-Statement]
+ [unknown-analysis]
+ [unknown-synthesis]
+ [unknown-translation]
+ [unknown-statement]
- [Cannot-Define-Analysis-More-Than-Once]
- [Cannot-Define-Synthesis-More-Than-Once]
- [Cannot-Define-Translation-More-Than-Once]
- [Cannot-Define-Statement-More-Than-Once]
+ [cannot-define-analysis-more-than-once]
+ [cannot-define-synthesis-more-than-once]
+ [cannot-define-translation-more-than-once]
+ [cannot-define-statement-more-than-once]
)
(type: #export Analysis
- (-> (-> Code (Meta Code))
- (-> Type Code (Meta Any))
- (List Code) (Meta Code)))
+ (-> Analyser Eval (List Code) (Meta analysisL.Analysis)))
(type: #export Synthesis
- (-> (-> la.Analysis ls.Synthesis) (List Code) Code))
-
-(type: #export Syntheses (Dict Text Synthesis))
+ (-> (-> analysisL.Analysis synthesisL.Synthesis) (List Code) Code))
(type: #export Translation
(-> (List Code) (Meta Code)))
@@ -41,11 +37,14 @@
(type: #export Statement
(-> (List Code) (Meta Any)))
+(type: #export (Extension e)
+ (Dict Text e))
+
(type: #export Extensions
- {#analysis (Dict Text Analysis)
- #synthesis Syntheses
- #translation (Dict Text Translation)
- #statement (Dict Text Statement)})
+ {#analysis (Extension Analysis)
+ #synthesis (Extension Synthesis)
+ #translation (Extension Translation)
+ #statement (Extension Statement)})
(def: #export fresh
Extensions
@@ -78,10 +77,10 @@
#.None
(//.throw <exception> name))))]
- [find-analysis Analysis #analysis Unknown-Analysis]
- [find-synthesis Synthesis #synthesis Unknown-Synthesis]
- [find-translation Translation #translation Unknown-Translation]
- [find-statement Statement #statement Unknown-Statement]
+ [find-analysis Analysis #analysis unknown-analysis]
+ [find-synthesis Synthesis #synthesis unknown-synthesis]
+ [find-translation Translation #translation unknown-translation]
+ [find-statement Statement #statement unknown-statement]
)
(do-template [<no> <all> <type> <category> <empty>]
@@ -94,7 +93,7 @@
(|> ..get
(:: macro.Monad<Meta> map (get@ <category>))))]
- [no-syntheses all-syntheses Syntheses #synthesis (dict.new text.Hash<Text>)]
+ [no-syntheses all-syntheses (Extension Synthesis) #synthesis (dict.new text.Hash<Text>)]
)
(do-template [<name> <type> <category> <exception>]
@@ -107,8 +106,8 @@
_ (..set (update@ <category> (dict.put name extension) extensions))]
(wrap [])))]
- [install-analysis Analysis #analysis Cannot-Define-Analysis-More-Than-Once]
- [install-synthesis Synthesis #synthesis Cannot-Define-Synthesis-More-Than-Once]
- [install-translation Translation #translation Cannot-Define-Translation-More-Than-Once]
- [install-statement Statement #statement Cannot-Define-Statement-More-Than-Once]
+ [install-analysis Analysis #analysis cannot-define-analysis-more-than-once]
+ [install-synthesis Synthesis #synthesis cannot-define-synthesis-more-than-once]
+ [install-translation Translation #translation cannot-define-translation-more-than-once]
+ [install-statement Statement #statement cannot-define-statement-more-than-once]
)