aboutsummaryrefslogtreecommitdiff
path: root/luxc
diff options
context:
space:
mode:
authorEduardo Julian2018-07-07 07:17:54 -0400
committerEduardo Julian2018-07-07 07:17:54 -0400
commitb6ef43d722d60bb82f939025f239ff7a8f160011 (patch)
tree4f46e030be463cee0f361c3e6832a01d18012bd8 /luxc
parent758ed85b01de0a655ac4f91c3682111de220031d (diff)
- Improved syntax for functions.
Diffstat (limited to '')
-rw-r--r--luxc/src/lux/analyser.clj16
1 files changed, 8 insertions, 8 deletions
diff --git a/luxc/src/lux/analyser.clj b/luxc/src/lux/analyser.clj
index 0cc908e0e..9052e6f8f 100644
--- a/luxc/src/lux/analyser.clj
+++ b/luxc/src/lux/analyser.clj
@@ -141,14 +141,6 @@
(&/with-cursor cursor
(&&lux/analyse-program analyse optimize compile-program ?program)))
- "lux function"
- (|let [(&/$Cons [_ (&/$Symbol "" ?self)]
- (&/$Cons [_ (&/$Symbol "" ?arg)]
- (&/$Cons ?body
- (&/$Nil)))) parameters]
- (&/with-analysis-meta cursor exo-type
- (&&lux/analyse-function analyse exo-type ?self ?arg ?body)))
-
"lux module"
(|let [(&/$Cons ?meta (&/$Nil)) parameters]
(&/with-cursor cursor
@@ -177,11 +169,19 @@
(&/with-analysis-meta cursor exo-type
(analyse-variant+ analyse exo-type ?ident parameters))
+ ;; Pattern-matching syntax.
(&/$Record ?pattern-matching)
(|let [(&/$Cons ?input (&/$Nil)) parameters]
(&/with-analysis-meta cursor exo-type
(&&lux/analyse-case analyse exo-type ?input ?pattern-matching)))
+ ;; Function syntax.
+ (&/$Tuple (&/$Cons [_ (&/$Symbol "" ?self)]
+ (&/$Cons [_ (&/$Symbol "" ?arg)] (&/$Nil))))
+ (|let [(&/$Cons ?body (&/$Nil)) parameters]
+ (&/with-analysis-meta cursor exo-type
+ (&&lux/analyse-function analyse exo-type ?self ?arg ?body)))
+
_
(&/with-cursor cursor
(|do [=fn (just-analyse analyse (&/T [command-meta command]))]