From b6ef43d722d60bb82f939025f239ff7a8f160011 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sat, 7 Jul 2018 07:17:54 -0400 Subject: - Improved syntax for functions. --- luxc/src/lux/analyser.clj | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'luxc/src') 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]))] -- cgit v1.2.3