From d9a1d70ec04fd5796276aeb46038654ade4484f9 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Mon, 3 Oct 2022 20:14:08 -0400 Subject: Migrating default extensions to the new format [Part 1] --- lux-bootstrapper/src/lux/analyser.clj | 44 +++++++++++++++++------------------ 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'lux-bootstrapper') diff --git a/lux-bootstrapper/src/lux/analyser.clj b/lux-bootstrapper/src/lux/analyser.clj index 0a168b38b..cde1b762c 100644 --- a/lux-bootstrapper/src/lux/analyser.clj +++ b/lux-bootstrapper/src/lux/analyser.clj @@ -89,6 +89,28 @@ (&/$Form (&/$Item [command-meta command] parameters)) (|case command + (&/$Identifier "library/lux" "def#") + (|let [(&/$Item [_ (&/$Identifier "" ?name)] + (&/$Item ?value + (&/$Item exported? + (&/$End)) + )) parameters] + (&/with-location location + (&&lux/analyse-def analyse optimize eval! compile-def ?name ?value exported?))) + + (&/$Identifier "library/lux" "alias#") + (|let [(&/$Item [_ (&/$Identifier "" ?alias)] + (&/$Item [_ (&/$Identifier ?original)] + (&/$End) + )) parameters] + (&/with-location location + (&&lux/analyse-def-alias ?alias ?original))) + + (&/$Identifier "library/lux" "module#") + (|let [(&/$Item ?imports (&/$End)) parameters] + (&/with-location location + (&&lux/analyse-module analyse optimize eval! compile-module ?imports))) + (&/$Text ?procedure) (case ?procedure "lux type check" @@ -109,28 +131,6 @@ (&/with-analysis-meta location exo-type (&&lux/analyse-type-as analyse optimize eval! exo-type ?type ?value))) - "lux def" - (|let [(&/$Item [_ (&/$Identifier "" ?name)] - (&/$Item ?value - (&/$Item exported? - (&/$End)) - )) parameters] - (&/with-location location - (&&lux/analyse-def analyse optimize eval! compile-def ?name ?value exported?))) - - "lux def alias" - (|let [(&/$Item [_ (&/$Identifier "" ?alias)] - (&/$Item [_ (&/$Identifier ?original)] - (&/$End) - )) parameters] - (&/with-location location - (&&lux/analyse-def-alias ?alias ?original))) - - "lux def module" - (|let [(&/$Item ?imports (&/$End)) parameters] - (&/with-location location - (&&lux/analyse-module analyse optimize eval! compile-module ?imports))) - "lux in-module" (|let [(&/$Item [_ (&/$Text ?module)] (&/$Item ?expr (&/$End))) parameters] (&/with-location location -- cgit v1.2.3