diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/lux/macro/syntax.lux | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/stdlib/source/lux/macro/syntax.lux b/stdlib/source/lux/macro/syntax.lux index 449194d54..7afc3a8a6 100644 --- a/stdlib/source/lux/macro/syntax.lux +++ b/stdlib/source/lux/macro/syntax.lux @@ -14,11 +14,11 @@ ["." int] ["." rev] ["." frac]] - ["." text ("#/." monoid)] + ["." text ("#;." monoid)] [collection - ["." list ("#/." functor)]]]] + ["." list ("#;." functor)]]]] ["." // (#+ with-gensyms) - ["." code ("#/." equivalence)]]) + ["." code ("#;." equivalence)]]) (def: (join-pairs pairs) (All [a] (-> (List [a a]) (List a))) @@ -32,8 +32,8 @@ (def: (remaining-inputs asts) (-> (List Code) Text) - ($_ text/compose text.new-line "Remaining input: " - (|> asts (list/map code.to-text) (list.interpose " ") (text.join-with "")))) + ($_ text;compose text.new-line "Remaining input: " + (|> asts (list;map code.to-text) (list.interpose " ") (text.join-with "")))) (def: #export any {#.doc "Just returns the next input without applying any logic."} @@ -45,7 +45,7 @@ (do-template [<get-name> <type> <tag> <eq> <desc>] [(def: #export <get-name> - {#.doc (code.text ($_ text/compose "Parses the next " <desc> " input Code."))} + {#.doc (code.text ($_ text;compose "Parses the next " <desc> " input Code."))} (Syntax <type>) (function (_ tokens) (case tokens @@ -53,7 +53,7 @@ (#error.Success [tokens' x]) _ - (#error.Failure ($_ text/compose "Cannot parse " <desc> (remaining-inputs tokens))))))] + (#error.Failure ($_ text;compose "Cannot parse " <desc> (remaining-inputs tokens))))))] [ bit Bit #.Bit bit.equivalence "bit"] [ nat Nat #.Nat nat.equivalence "nat"] @@ -71,7 +71,7 @@ (function (_ tokens) (case tokens (#.Cons [token tokens']) - (let [is-it? (code/= ast token) + (let [is-it? (code;= ast token) remaining (if is-it? tokens' tokens)] @@ -86,9 +86,9 @@ (function (_ tokens) (case tokens (#.Cons [token tokens']) - (if (code/= ast token) + (if (code;= ast token) (#error.Success [tokens' []]) - (#error.Failure ($_ text/compose "Expected a " (code.to-text ast) " but instead got " (code.to-text token) + (#error.Failure ($_ text;compose "Expected a " (code.to-text ast) " but instead got " (code.to-text token) (remaining-inputs tokens)))) _ @@ -96,7 +96,7 @@ (do-template [<name> <tag> <desc>] [(def: #export <name> - {#.doc (code.text ($_ text/compose "Parse a local " <desc> " (a " <desc> " that has no module prefix)."))} + {#.doc (code.text ($_ text;compose "Parse a local " <desc> " (a " <desc> " that has no module prefix)."))} (Syntax Text) (function (_ tokens) (case tokens @@ -104,7 +104,7 @@ (#error.Success [tokens' x]) _ - (#error.Failure ($_ text/compose "Cannot parse local " <desc> (remaining-inputs tokens))))))] + (#error.Failure ($_ text;compose "Cannot parse local " <desc> (remaining-inputs tokens))))))] [local-identifier #.Identifier "identifier"] [ local-tag #.Tag "tag"] @@ -112,7 +112,7 @@ (do-template [<name> <tag> <desc>] [(def: #export (<name> p) - {#.doc (code.text ($_ text/compose "Parse inside the contents of a " <desc> " as if they were the input Codes."))} + {#.doc (code.text ($_ text;compose "Parse inside the contents of a " <desc> " as if they were the input Codes."))} (All [a] (-> (Syntax a) (Syntax a))) (function (_ tokens) @@ -120,17 +120,17 @@ (#.Cons [[_ (<tag> members)] tokens']) (case (p members) (#error.Success [#.Nil x]) (#error.Success [tokens' x]) - _ (#error.Failure ($_ text/compose "Syntax was expected to fully consume " <desc> (remaining-inputs tokens)))) + _ (#error.Failure ($_ text;compose "Syntax was expected to fully consume " <desc> (remaining-inputs tokens)))) _ - (#error.Failure ($_ text/compose "Cannot parse " <desc> (remaining-inputs tokens))))))] + (#error.Failure ($_ text;compose "Cannot parse " <desc> (remaining-inputs tokens))))))] [ form #.Form "form"] [tuple #.Tuple "tuple"] ) (def: #export (record p) - {#.doc (code.text ($_ text/compose "Parse inside the contents of a record as if they were the input Codes."))} + {#.doc (code.text ($_ text;compose "Parse inside the contents of a record as if they were the input Codes."))} (All [a] (-> (Syntax a) (Syntax a))) (function (_ tokens) @@ -138,10 +138,10 @@ (#.Cons [[_ (#.Record pairs)] tokens']) (case (p (join-pairs pairs)) (#error.Success [#.Nil x]) (#error.Success [tokens' x]) - _ (#error.Failure ($_ text/compose "Syntax was expected to fully consume record" (remaining-inputs tokens)))) + _ (#error.Failure ($_ text;compose "Syntax was expected to fully consume record" (remaining-inputs tokens)))) _ - (#error.Failure ($_ text/compose "Cannot parse record" (remaining-inputs tokens)))))) + (#error.Failure ($_ text;compose "Cannot parse record" (remaining-inputs tokens)))))) (def: #export end! {#.doc "Ensures there are no more inputs."} @@ -149,7 +149,7 @@ (function (_ tokens) (case tokens #.Nil (#error.Success [tokens []]) - _ (#error.Failure ($_ text/compose "Expected list of tokens to be empty!" (remaining-inputs tokens)))))) + _ (#error.Failure ($_ text;compose "Expected list of tokens to be empty!" (remaining-inputs tokens)))))) (def: #export end? {#.doc "Checks whether there are no more inputs."} @@ -182,8 +182,8 @@ (#error.Success value) _ - (#error.Failure (text/compose "Unconsumed inputs: " - (|> (list/map code.to-text unconsumed) + (#error.Failure (text;compose "Unconsumed inputs: " + (|> (list;map code.to-text unconsumed) (text.join-with ", "))))))) (def: #export (local inputs syntax) @@ -205,11 +205,11 @@ {interfaces (tuple (some (super-class-decl^ imports class-vars)))} {constructor-args (constructor-args^ imports class-vars)} {methods (some (overriden-method-def^ imports))}) - (let [def-code ($_ text/compose "anon-class:" + (let [def-code ($_ text;compose "anon-class:" (spaced (list (super-class-decl$ (maybe.default object-super-class super)) - (with-brackets (spaced (list/map super-class-decl$ interfaces))) - (with-brackets (spaced (list/map constructor-arg$ constructor-args))) - (with-brackets (spaced (list/map (method-def$ id) methods))))))] + (with-brackets (spaced (list;map super-class-decl$ interfaces))) + (with-brackets (spaced (list;map constructor-arg$ constructor-args))) + (with-brackets (spaced (list;map (method-def$ id) methods))))))] (wrap (list (` ((~ (code.text def-code)))))))))} (let [[exported? tokens] (: [Bit (List Code)] (case tokens |