diff options
Diffstat (limited to 'stdlib/source/library/lux/macro/syntax/annotations.lux')
-rw-r--r-- | stdlib/source/library/lux/macro/syntax/annotations.lux | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/stdlib/source/library/lux/macro/syntax/annotations.lux b/stdlib/source/library/lux/macro/syntax/annotations.lux new file mode 100644 index 000000000..28f5a233e --- /dev/null +++ b/stdlib/source/library/lux/macro/syntax/annotations.lux @@ -0,0 +1,42 @@ +(.module: + [library + [lux #* + [abstract + [equivalence (#+ Equivalence)]] + [control + ["." function] + ["<>" parser + ["<.>" code (#+ Parser)]]] + [data + ["." product] + ["." name] + [collection + ["." list ("#\." functor)]]] + [macro + ["." code]]]]) + +(type: #export Annotations + (List [Name Code])) + +(def: #export equivalence + (Equivalence Annotations) + (list.equivalence + (product.equivalence name.equivalence + code.equivalence))) + +(def: #export empty + Annotations + (list)) + +(def: #export format + (-> Annotations Code) + (let [entry (product.apply code.tag function.identity)] + (|>> (list\map entry) + code.record))) + +(def: #export parser + (Parser Annotations) + (<code>.record + (<>.some + (<>.and <code>.tag + <code>.any)))) |