aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/macro/code.lux
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/library/lux/macro/code.lux95
1 files changed, 44 insertions, 51 deletions
diff --git a/stdlib/source/library/lux/macro/code.lux b/stdlib/source/library/lux/macro/code.lux
index aaa054c96..b7c709482 100644
--- a/stdlib/source/library/lux/macro/code.lux
+++ b/stdlib/source/library/lux/macro/code.lux
@@ -20,17 +20,16 @@
["[0]" location]]]])
... (type: (Code' w)
-... {#.Bit Bit}
-... {#.Nat Nat}
-... {#.Int Int}
-... {#.Rev Rev}
-... {#.Frac Frac}
-... {#.Text Text}
-... {#.Identifier Name}
-... {#.Tag Name}
-... {#.Form (List (w (Code' w)))}
-... {#.Variant (List (w (Code' w)))}
-... {#.Tuple (List (w (Code' w)))})
+... {.#Bit Bit}
+... {.#Nat Nat}
+... {.#Int Int}
+... {.#Rev Rev}
+... {.#Frac Frac}
+... {.#Text Text}
+... {.#Identifier Name}
+... {.#Form (List (w (Code' w)))}
+... {.#Variant (List (w (Code' w)))}
+... {.#Tuple (List (w (Code' w)))})
... (type: Code
... (Ann Location (Code' (Ann Location))))
@@ -40,17 +39,16 @@
(-> <type> Code)
[location.dummy {<tag> x}])]
- [bit Bit #.Bit]
- [nat Nat #.Nat]
- [int Int #.Int]
- [rev Rev #.Rev]
- [frac Frac #.Frac]
- [text Text #.Text]
- [identifier Name #.Identifier]
- [tag Name #.Tag]
- [form (List Code) #.Form]
- [variant (List Code) #.Variant]
- [tuple (List Code) #.Tuple]
+ [bit Bit .#Bit]
+ [nat Nat .#Nat]
+ [int Int .#Int]
+ [rev Rev .#Rev]
+ [frac Frac .#Frac]
+ [text Text .#Text]
+ [identifier Name .#Identifier]
+ [form (List Code) .#Form]
+ [variant (List Code) .#Variant]
+ [tuple (List Code) .#Tuple]
)
(template [<name> <tag>]
@@ -58,8 +56,7 @@
(-> Text Code)
[location.dummy {<tag> ["" name]}])]
- [local_identifier #.Identifier]
- [local_tag #.Tag])
+ [local_identifier .#Identifier])
(implementation: .public equivalence
(Equivalence Code)
@@ -69,21 +66,20 @@
(^template [<tag> <eq>]
[[[_ {<tag> x'}] [_ {<tag> y'}]]
(\ <eq> = x' y')])
- ([#.Bit bit.equivalence]
- [#.Nat nat.equivalence]
- [#.Int int.equivalence]
- [#.Rev rev.equivalence]
- [#.Frac frac.equivalence]
- [#.Text text.equivalence]
- [#.Identifier name.equivalence]
- [#.Tag name.equivalence])
+ ([.#Bit bit.equivalence]
+ [.#Nat nat.equivalence]
+ [.#Int int.equivalence]
+ [.#Rev rev.equivalence]
+ [.#Frac frac.equivalence]
+ [.#Text text.equivalence]
+ [.#Identifier name.equivalence])
(^template [<tag>]
[[[_ {<tag> xs'}] [_ {<tag> ys'}]]
(\ (list.equivalence =) = xs' ys')])
- ([#.Form]
- [#.Variant]
- [#.Tuple])
+ ([.#Form]
+ [.#Variant]
+ [.#Tuple])
_
false)))
@@ -94,19 +90,16 @@
(^template [<tag> <struct>]
[[_ {<tag> value}]
(\ <struct> encoded value)])
- ([#.Bit bit.codec]
- [#.Nat nat.decimal]
- [#.Int int.decimal]
- [#.Rev rev.decimal]
- [#.Frac frac.decimal]
- [#.Identifier name.codec])
+ ([.#Bit bit.codec]
+ [.#Nat nat.decimal]
+ [.#Int int.decimal]
+ [.#Rev rev.decimal]
+ [.#Frac frac.decimal]
+ [.#Identifier name.codec])
- [_ {#.Text value}]
+ [_ {.#Text value}]
(text.format value)
- [_ {#.Tag name}]
- (text\composite "#" (\ name.codec encoded name))
-
(^template [<tag> <open> <close>]
[[_ {<tag> members}]
($_ text\composite
@@ -119,9 +112,9 @@
""
members)
<close>)])
- ([#.Form "(" ")"]
- [#.Variant "{" "}"]
- [#.Tuple "[" "]"])
+ ([.#Form "(" ")"]
+ [.#Variant "{" "}"]
+ [.#Tuple "[" "]"])
))
(def: .public (replaced original substitute ast)
@@ -132,9 +125,9 @@
(^template [<tag>]
[[location {<tag> parts}]
[location {<tag> (list\each (replaced original substitute) parts)}]])
- ([#.Form]
- [#.Variant]
- [#.Tuple])
+ ([.#Form]
+ [.#Variant]
+ [.#Tuple])
_
ast)))