aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/analyser.lux
diff options
context:
space:
mode:
authorEduardo Julian2017-10-26 14:48:05 -0400
committerEduardo Julian2017-10-26 14:48:05 -0400
commit1fabe19f7eacb668ef26cccde681dce5e2f98072 (patch)
treead2ead4ae5d7f997353e7b8223aa29725df40111 /new-luxc/source/luxc/analyser.lux
parent40e9eae7468af9b03f6c684171d83a521dd90e82 (diff)
- WIP: Wiring everything to get the compiler to work fully.
- Fixed a bug when combining field/method/class modifiers.
Diffstat (limited to '')
-rw-r--r--new-luxc/source/luxc/analyser.lux21
1 files changed, 12 insertions, 9 deletions
diff --git a/new-luxc/source/luxc/analyser.lux b/new-luxc/source/luxc/analyser.lux
index 97312b805..b10f29369 100644
--- a/new-luxc/source/luxc/analyser.lux
+++ b/new-luxc/source/luxc/analyser.lux
@@ -67,28 +67,28 @@
(#;Symbol reference)
(&&reference;analyse-reference reference)
- (^ (#;Form (list [_ (#;Symbol ["" "_lux_function"])]
+ (^ (#;Form (list [_ (#;Text "lux function")]
[_ (#;Symbol ["" func-name])]
[_ (#;Symbol ["" arg-name])]
body)))
(&&function;analyse-function analyse func-name arg-name body)
- (^template [<proc> <analyser>]
- (^ (#;Form (list [_ (#;Symbol ["" <proc>])] type value)))
+ (^template [<special> <analyser>]
+ (^ (#;Form (list [_ (#;Text <special>)] type value)))
(<analyser> analyse eval type value))
- (["_lux_check" &&type;analyse-check]
- ["_lux_coerce" &&type;analyse-coerce])
+ (["lux check" &&type;analyse-check]
+ ["lux coerce" &&type;analyse-coerce])
- (^ (#;Form (list& [_ (#;Text proc-name)] proc-args)))
- (&&procedure;analyse-procedure analyse proc-name proc-args)
-
- (^ (#;Form (list& [_ (#;Symbol ["" "_lux_case"])]
+ (^ (#;Form (list& [_ (#;Text "lux case")]
input
branches)))
(do meta;Monad<Meta>
[paired (to-branches branches)]
(&&case;analyse-case analyse input paired))
+ (^ (#;Form (list& [_ (#;Text proc-name)] proc-args)))
+ (&&procedure;analyse-procedure analyse proc-name proc-args)
+
(^template [<tag> <analyser>]
(^ (#;Form (list& [_ (<tag> tag)]
values)))
@@ -101,6 +101,9 @@
([#;Nat &&structure;analyse-sum]
[#;Tag &&structure;analyse-tagged-sum])
+ (#;Tag tag)
+ (&&structure;analyse-tagged-sum analyse tag (' []))
+
(^ (#;Form (list& func args)))
(do meta;Monad<Meta>
[[funcT =func] (&&common;with-unknown-type