aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/macro/syntax/check.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/lux/macro/syntax/check.lux')
-rw-r--r--stdlib/source/lux/macro/syntax/check.lux41
1 files changed, 41 insertions, 0 deletions
diff --git a/stdlib/source/lux/macro/syntax/check.lux b/stdlib/source/lux/macro/syntax/check.lux
new file mode 100644
index 000000000..081e394b0
--- /dev/null
+++ b/stdlib/source/lux/macro/syntax/check.lux
@@ -0,0 +1,41 @@
+(.module:
+ [lux #*
+ ["." meta]
+ [abstract
+ [equivalence (#+ Equivalence)]
+ [monad (#+ do)]]
+ [control
+ ["." exception (#+ exception:)]
+ ["<>" parser
+ ["<.>" code (#+ Parser)]]]
+ [data
+ ["." product]]
+ [macro
+ ["." code]]])
+
+(def: extension
+ "lux check")
+
+(type: #export Check
+ {#type Code
+ #value Code})
+
+(def: #export equivalence
+ (Equivalence Check)
+ ($_ product.equivalence
+ code.equivalence
+ code.equivalence
+ ))
+
+(def: #export (write (^slots [#type #value]))
+ (-> Check Code)
+ (` ((~ (code.text ..extension))
+ (~ type)
+ (~ value))))
+
+(def: #export parser
+ (Parser Check)
+ (<| <code>.form
+ (<>.after (<code>.text! ..extension))
+ (<>.and <code>.any
+ <code>.any)))