aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/macro/code.lux
diff options
context:
space:
mode:
authorEduardo Julian2021-09-09 00:29:12 -0400
committerEduardo Julian2021-09-09 00:29:12 -0400
commitef77466323f85a3d1b65b46a3deb93652ef22085 (patch)
treec2715b8cf6e7864fef87e22ee6e206c7c1758849 /stdlib/source/library/lux/macro/code.lux
parent085c9a6ef151531cb01b842ed2f4366a49b78367 (diff)
The old record syntax has been re-purposed as variant syntax.
Diffstat (limited to '')
-rw-r--r--stdlib/source/library/lux/macro/code.lux31
1 files changed, 6 insertions, 25 deletions
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 [<name> <tag>]
@@ -82,11 +82,8 @@
[[[_ (<tag> xs')] [_ (<tag> ys')]]
(\ (list.equivalence =) = xs' ys')])
([#.Form]
+ [#.Variant]
[#.Tuple])
-
- [[_ (#.Record xs')] [_ (#.Record ys')]]
- (\ (list.equivalence (product.equivalence = =))
- = xs' ys')
_
false)))
@@ -123,19 +120,8 @@
members)
<close>)])
([#.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 (<tag> parts)]
[location (<tag> (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)))