aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux.lux
diff options
context:
space:
mode:
authorEduardo Julian2022-07-27 21:46:33 -0400
committerEduardo Julian2022-07-27 21:46:33 -0400
commitebfe1bbbe543299f8691e4862fbc899637ff8cfd (patch)
tree21c8142deb052fd17ef85809429b2fa41048f45d /stdlib/source/library/lux.lux
parent5da753fb0a4e220ea29fb3f45c92a69358901c20 (diff)
New flat format for documentation fragments.
Diffstat (limited to 'stdlib/source/library/lux.lux')
-rw-r--r--stdlib/source/library/lux.lux56
1 files changed, 29 insertions, 27 deletions
diff --git a/stdlib/source/library/lux.lux b/stdlib/source/library/lux.lux
index be2a9eb33..6fb5b2a9f 100644
--- a/stdlib/source/library/lux.lux
+++ b/stdlib/source/library/lux.lux
@@ -1148,7 +1148,7 @@
{#End}}]}
_
- {#Left "Wrong syntax for All"}}
+ {#Left (wrong_syntax_error [..prelude "All"])}}
tokens)))
(def' .public Ex
@@ -1182,7 +1182,7 @@
{#End}}]}
_
- {#Left "Wrong syntax for Ex"}}
+ {#Left (wrong_syntax_error [..prelude "Ex"])}}
tokens)))
(def' .public ->
@@ -1196,7 +1196,7 @@
{#End}})
_
- (failure "Wrong syntax for ->")}
+ (failure (wrong_syntax_error [..prelude "->"]))}
(list#reversed tokens))))
(def' .public list
@@ -1370,11 +1370,11 @@
(meta#in (list (list#mix (function#flipped (right_associativity op)) first nexts)))
_
- (failure "Wrong syntax for left")}
+ (failure (wrong_syntax_error [..prelude "left"]))}
tokens')
_
- (failure "Wrong syntax for left")}
+ (failure (wrong_syntax_error [..prelude "left"]))}
tokens)))
(def' .public right
@@ -1385,11 +1385,11 @@
(meta#in (list (list#mix (right_associativity op) last prevs)))
_
- (failure "Wrong syntax for right")}
+ (failure (wrong_syntax_error [..prelude "right"]))}
(list#reversed tokens'))
_
- (failure "Wrong syntax for right")}
+ (failure (wrong_syntax_error [..prelude "right"]))}
tokens)))
(def' .public all Macro ..right)
@@ -1523,7 +1523,7 @@
test))))
_
- (failure "Wrong syntax for if")}
+ (failure (wrong_syntax_error [..prelude "if"]))}
tokens)))
(def' .private Property_List
@@ -2231,6 +2231,16 @@
(-> ($' List ($' List a)) ($' List a)))
(list#mix list#composite {#End} (list#reversed xs)))
+(def' .public symbol
+ Macro
+ (macro (_ tokens)
+ ({{#Item [_ {#Symbol [module name]}] {#End}}
+ (meta#in (list (tuple$ (list (text$ module) (text$ name)))))
+
+ _
+ (failure (..wrong_syntax_error [..prelude "symbol"]))}
+ tokens)))
+
(def' .public with_template
Macro
(macro (_ tokens)
@@ -2245,15 +2255,15 @@
(list#each (function#composite apply (replacement_environment bindings')))
list#conjoint
meta#in)
- (failure (..wrong_syntax_error [..prelude "with_template"]))))
+ (failure (..wrong_syntax_error (symbol ..with_template)))))
_
- (failure (..wrong_syntax_error [..prelude "with_template"]))}
+ (failure (..wrong_syntax_error (symbol ..with_template)))}
[(monad#each maybe#monad symbol_short bindings)
(monad#each maybe#monad tuple_list data)])
_
- (failure (..wrong_syntax_error [..prelude "with_template"]))}
+ (failure (..wrong_syntax_error (symbol ..with_template)))}
tokens)))
(def' .private (n// param subject)
@@ -2735,7 +2745,7 @@
(in (list (..quantified it))))))
_
- (failure (wrong_syntax_error [..prelude "type_literal"]))}
+ (failure (..wrong_syntax_error (symbol ..type_literal)))}
tokens)))
(def' .public is
@@ -2747,7 +2757,7 @@
(, value)))))
_
- (failure (wrong_syntax_error [..prelude "is"]))}
+ (failure (..wrong_syntax_error (symbol ..is)))}
tokens)))
(def' .public as
@@ -2759,7 +2769,7 @@
(, value)))))
_
- (failure (wrong_syntax_error [..prelude "as"]))}
+ (failure (..wrong_syntax_error (symbol ..as)))}
tokens)))
(def' .private (empty? xs)
@@ -2806,7 +2816,7 @@
actions))))
_
- (failure "Wrong syntax for exec")}
+ (failure (..wrong_syntax_error (symbol ..exec)))}
(list#reversed tokens))))
(def' .public Pattern
@@ -2873,7 +2883,7 @@
(in (list (` ((, (variant$ expansion)) (, value))))))
_
- (failure "Wrong syntax for case")}
+ (failure (..wrong_syntax_error (symbol ..case)))}
tokens)))
(def' .private pattern#or
@@ -2894,16 +2904,6 @@
_
(failure "Wrong syntax for pattern#or")))))
-(def' .public symbol
- Macro
- (macro (_ tokens)
- (case tokens
- (list [_ {#Symbol [module name]}])
- (meta#in (list (` [(, (text$ module)) (, (text$ name))])))
-
- _
- (failure (..wrong_syntax_error [..prelude "symbol"])))))
-
(def' .private (symbol? code)
(type_literal (-> Code Bit))
(case code
@@ -4553,7 +4553,9 @@
(in referral)
_
- (failure (all text#composite "Wrong syntax for refer @ " current_module
+ (failure (all text#composite
+ (..wrong_syntax_error (symbol ..refer))
+ \n "@ " current_module
\n (|> extra
(list#each code#encoded)
(list#interposed " ")