From ef77466323f85a3d1b65b46a3deb93652ef22085 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Thu, 9 Sep 2021 00:29:12 -0400 Subject: The old record syntax has been re-purposed as variant syntax. --- stdlib/source/library/lux/macro/code.lux | 31 ++++++------------------------- 1 file changed, 6 insertions(+), 25 deletions(-) (limited to 'stdlib/source/library/lux/macro/code.lux') diff --git a/stdlib/source/library/lux/macro/code.lux b/stdlib/source/library/lux/macro/code.lux index f266c5642..b80a1a418 100644 --- a/stdlib/source/library/lux/macro/code.lux +++ b/stdlib/source/library/lux/macro/code.lux @@ -29,8 +29,8 @@ ... (#.Identifier Name) ... (#.Tag Name) ... (#.Form (List (w (Code' w)))) -... (#.Tuple (List (w (Code' w)))) -... (#.Record (List [(w (Code' w)) (w (Code' w))]))) +... (#.Variant (List (w (Code' w)))) +... (#.Tuple (List (w (Code' w))))) ... (type: Code ... (Ann Location (Code' (Ann Location)))) @@ -49,8 +49,8 @@ [identifier Name #.Identifier] [tag Name #.Tag] [form (List Code) #.Form] + [variant (List Code) #.Variant] [tuple (List Code) #.Tuple] - [record (List [Code Code]) #.Record] ) (template [ ] @@ -82,11 +82,8 @@ [[[_ ( xs')] [_ ( ys')]] (\ (list.equivalence =) = xs' ys')]) ([#.Form] + [#.Variant] [#.Tuple]) - - [[_ (#.Record xs')] [_ (#.Record ys')]] - (\ (list.equivalence (product.equivalence = =)) - = xs' ys') _ false))) @@ -123,19 +120,8 @@ members) )]) ([#.Form "(" ")"] + [#.Variant "{" "}"] [#.Tuple "[" "]"]) - - [_ (#.Record pairs)] - ($_ text\composite - "{" - (list\mix (function (_ [left right] prev) - (let [next ($_ text\composite (format left) " " (format right))] - (if (text\= "" prev) - next - ($_ text\composite prev " " next)))) - "" - pairs) - "}") )) (def: .public (replaced original substitute ast) @@ -147,13 +133,8 @@ [[location ( parts)] [location ( (list\each (replaced original substitute) parts))]]) ([#.Form] + [#.Variant] [#.Tuple]) - [location (#.Record parts)] - [location (#.Record (list\each (function (_ [left right]) - [(replaced original substitute left) - (replaced original substitute right)]) - parts))] - _ ast))) -- cgit v1.2.3