aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/base.lux
diff options
context:
space:
mode:
authorEduardo Julian2017-05-15 22:19:14 -0400
committerEduardo Julian2017-05-15 22:19:14 -0400
commit824482b2e8b13e42a524a5e4945ea3e172395c9e (patch)
tree959bb7684461318b1026cd773ae29ac76d426054 /new-luxc/source/luxc/base.lux
parent04c0a8d2fceae628099673e62527fc48e2afd7e7 (diff)
WIP
- Simplified the Analysis type, by removing all meta-data. - Added analysis of function calls. - Added analysis of common Lux procedures. - Lots of refactoring.
Diffstat (limited to 'new-luxc/source/luxc/base.lux')
-rw-r--r--new-luxc/source/luxc/base.lux10
1 files changed, 6 insertions, 4 deletions
diff --git a/new-luxc/source/luxc/base.lux b/new-luxc/source/luxc/base.lux
index 74e316b3c..ee2d4464d 100644
--- a/new-luxc/source/luxc/base.lux
+++ b/new-luxc/source/luxc/base.lux
@@ -12,7 +12,7 @@
(-> Type Code (Lux Top)))
(type: #export Analyser
- (-> Eval Code (Lux la;Analysis)))
+ (-> Code (Lux la;Analysis)))
(type: #export Path Text)
@@ -100,15 +100,17 @@
(#E;Success [(set@ #;source old-source compiler')
output])))))
-(def: #export (with-try handler action)
- (All [a] (-> (-> Text (Lux a)) (Lux a) (Lux a)))
+(def: #export (with-stacked-errors handler action)
+ (All [a] (-> (-> [] Text) (Lux a) (Lux a)))
(function [compiler]
(case (action compiler)
(#E;Success [compiler' output])
(#E;Success [compiler' output])
(#E;Error error)
- ((handler error) compiler))))
+ (#E;Error (if (T/= "" error)
+ (handler [])
+ (format error "\n-----------------------------------------\n" (handler [])))))))
(def: fresh-bindings
(All [k v] (Bindings k v))