From d0e4ba8124345ce990de7fdf7497dd903de6c342 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Tue, 30 Aug 2022 19:33:36 -0400 Subject: Got rid of the superfluous "lux macro" extension. --- stdlib/source/library/lux.lux | 154 ++++++++++++++++++++++-------------------- 1 file changed, 81 insertions(+), 73 deletions(-) (limited to 'stdlib/source/library/lux.lux') diff --git a/stdlib/source/library/lux.lux b/stdlib/source/library/lux.lux index df7b4ef66..f35ba4250 100644 --- a/stdlib/source/library/lux.lux +++ b/stdlib/source/library/lux.lux @@ -732,52 +732,54 @@ #0) ("lux def" let'' - ("lux macro" - ([_ tokens] - ({{#Item lhs {#Item rhs {#Item body {#End}}}} - (meta#in {#Item (form$ {#Item (variant$ {#Item lhs {#Item body {#End}}}) - {#Item rhs {#End}}}) - {#End}}) - - _ - (failure "Wrong syntax for let''")} - tokens))) + ("lux type as" Macro + ("lux type check" Macro' + ([_ tokens] + ({{#Item lhs {#Item rhs {#Item body {#End}}}} + (meta#in {#Item (form$ {#Item (variant$ {#Item lhs {#Item body {#End}}}) + {#Item rhs {#End}}}) + {#End}}) + + _ + (failure "Wrong syntax for let''")} + tokens)))) #0) ("lux def" function'' - ("lux macro" - ([_ tokens] - ({{#Item [_ {#Tuple {#Item arg args'}}] {#Item body {#End}}} - (meta#in {#Item (_ann {#Form {#Item (_ann {#Tuple {#Item (_ann {#Symbol ["" ""]}) - {#Item arg {#End}}}}) - {#Item ({{#End} - body - - _ - (_ann {#Form {#Item (_ann {#Symbol [..prelude "function''"]}) - {#Item (_ann {#Tuple args'}) - {#Item body {#End}}}}})} - args') - {#End}}}}) - {#End}}) - - {#Item [_ {#Symbol ["" self]}] {#Item [_ {#Tuple {#Item arg args'}}] {#Item body {#End}}}} - (meta#in {#Item (_ann {#Form {#Item (_ann {#Tuple {#Item (_ann {#Symbol ["" self]}) - {#Item arg {#End}}}}) - {#Item ({{#End} - body - - _ - (_ann {#Form {#Item (_ann {#Symbol [..prelude "function''"]}) - {#Item (_ann {#Tuple args'}) - {#Item body {#End}}}}})} - args') - {#End}}}}) - {#End}}) - - _ - (failure "Wrong syntax for function''")} - tokens))) + ("lux type as" Macro + ("lux type check" Macro' + ([_ tokens] + ({{#Item [_ {#Tuple {#Item arg args'}}] {#Item body {#End}}} + (meta#in {#Item (_ann {#Form {#Item (_ann {#Tuple {#Item (_ann {#Symbol ["" ""]}) + {#Item arg {#End}}}}) + {#Item ({{#End} + body + + _ + (_ann {#Form {#Item (_ann {#Symbol [..prelude "function''"]}) + {#Item (_ann {#Tuple args'}) + {#Item body {#End}}}}})} + args') + {#End}}}}) + {#End}}) + + {#Item [_ {#Symbol ["" self]}] {#Item [_ {#Tuple {#Item arg args'}}] {#Item body {#End}}}} + (meta#in {#Item (_ann {#Form {#Item (_ann {#Tuple {#Item (_ann {#Symbol ["" self]}) + {#Item arg {#End}}}}) + {#Item ({{#End} + body + + _ + (_ann {#Form {#Item (_ann {#Symbol [..prelude "function''"]}) + {#Item (_ann {#Tuple args'}) + {#Item body {#End}}}}})} + args') + {#End}}}}) + {#End}}) + + _ + (failure "Wrong syntax for function''")} + tokens)))) #0) ("lux def" as_def @@ -808,42 +810,48 @@ ("lux def" as_macro ("lux type check" {#Function Code Code} (function'' [expression] - (form$ {#Item (text$ "lux macro") - {#Item expression - {#End}}}))) + (form$ {#Item (text$ "lux type as") + {#Item (symbol$ [..prelude "Macro"]) + {#Item (form$ {#Item (text$ "lux type check") + {#Item (symbol$ [..prelude "Macro'"]) + {#Item expression + {#End}}}}) + {#End}}}}))) #0) ("lux def" def' - ("lux macro" - (function'' [tokens] - ({{#Item [export_policy - {#Item [[_ {#Form {#Item [name args]}}] - {#Item [type {#Item [body {#End}]}]}]}]} - (meta#in {#Item [(as_def name - (as_checked type (as_function name args body)) - export_policy) - {#End}]}) - - {#Item [export_policy {#Item [name {#Item [type {#Item [body {#End}]}]}]}]} - (meta#in {#Item [(as_def name (as_checked type body) - export_policy) - {#End}]}) - - _ - (failure "Wrong syntax for def'")} - tokens))) + ("lux type as" Macro + ("lux type check" Macro' + (function'' [tokens] + ({{#Item [export_policy + {#Item [[_ {#Form {#Item [name args]}}] + {#Item [type {#Item [body {#End}]}]}]}]} + (meta#in {#Item [(as_def name + (as_checked type (as_function name args body)) + export_policy) + {#End}]}) + + {#Item [export_policy {#Item [name {#Item [type {#Item [body {#End}]}]}]}]} + (meta#in {#Item [(as_def name (as_checked type body) + export_policy) + {#End}]}) + + _ + (failure "Wrong syntax for def'")} + tokens)))) #0) ("lux def" macro - ("lux macro" - (function'' [tokens] - ({{#Item [_ {#Form {#Item name {#Item head tail}}}] {#Item body {#End}}} - (meta#in {#Item (as_macro (as_function name {#Item head tail} body)) - {#End}}) - - _ - (failure (wrong_syntax_error [..prelude "macro"]))} - tokens))) + ("lux type as" Macro + ("lux type check" Macro' + (function'' [tokens] + ({{#Item [_ {#Form {#Item name {#Item head tail}}}] {#Item body {#End}}} + (meta#in {#Item (as_macro (as_function name {#Item head tail} body)) + {#End}}) + + _ + (failure (wrong_syntax_error [..prelude "macro"]))} + tokens)))) #1) (def' .public comment -- cgit v1.2.3