diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/lux.lux | 804 | ||||
-rw-r--r-- | stdlib/source/lux/control/comonad.lux | 8 | ||||
-rw-r--r-- | stdlib/source/lux/control/monad.lux | 10 | ||||
-rw-r--r-- | stdlib/source/lux/data/coll/list.lux | 6 | ||||
-rw-r--r-- | stdlib/source/lux/data/format/json.lux | 16 | ||||
-rw-r--r-- | stdlib/source/lux/data/number.lux | 10 | ||||
-rw-r--r-- | stdlib/source/lux/host.jvm.lux | 18 | ||||
-rw-r--r-- | stdlib/source/lux/io.lux | 2 | ||||
-rw-r--r-- | stdlib/source/lux/macro.lux | 16 | ||||
-rw-r--r-- | stdlib/source/lux/macro/ast.lux | 116 | ||||
-rw-r--r-- | stdlib/source/lux/macro/syntax.lux | 40 | ||||
-rw-r--r-- | stdlib/source/lux/type/auto.lux | 2 | ||||
-rw-r--r-- | stdlib/test/test/lux/macro/syntax.lux | 2 |
13 files changed, 525 insertions, 525 deletions
diff --git a/stdlib/source/lux.lux b/stdlib/source/lux.lux index cd547a517..b49d831b0 100644 --- a/stdlib/source/lux.lux +++ b/stdlib/source/lux.lux @@ -388,18 +388,18 @@ default-def-meta-exported)) ## (type: (AST' w) -## (#BoolS Bool) -## (#NatS Nat) -## (#IntS Int) -## (#DegS Deg) -## (#RealS Real) -## (#CharS Char) -## (#TextS Text) -## (#SymbolS Text Text) -## (#TagS Text Text) -## (#FormS (List (w (AST' w)))) -## (#TupleS (List (w (AST' w)))) -## (#RecordS (List [(w (AST' w)) (w (AST' w))]))) +## (#Bool Bool) +## (#Nat Nat) +## (#Int Int) +## (#Deg Deg) +## (#Real Real) +## (#Char Char) +## (#Text Text) +## (#Symbol Text Text) +## (#Tag Text Text) +## (#Form (List (w (AST' w)))) +## (#Tuple (List (w (AST' w)))) +## (#Record (List [(w (AST' w)) (w (AST' w))]))) (_lux_def AST' (#NamedT ["lux" "AST'"] (_lux_case (#AppT (#BoundT +1) @@ -409,44 +409,44 @@ (_lux_case (#AppT [List AST]) AST-List (#UnivQ #Nil - (#SumT ## "lux;BoolS" + (#SumT ## "lux;Bool" Bool - (#SumT ## "lux;NatS" + (#SumT ## "lux;Nat" Nat - (#SumT ## "lux;IntS" + (#SumT ## "lux;Int" Int - (#SumT ## "lux;DegS" + (#SumT ## "lux;Deg" Deg - (#SumT ## "lux;RealS" + (#SumT ## "lux;Real" Real - (#SumT ## "lux;CharS" + (#SumT ## "lux;Char" Char - (#SumT ## "lux;TextS" + (#SumT ## "lux;Text" Text - (#SumT ## "lux;SymbolS" + (#SumT ## "lux;Symbol" Ident - (#SumT ## "lux;TagS" + (#SumT ## "lux;Tag" Ident - (#SumT ## "lux;FormS" + (#SumT ## "lux;Form" AST-List - (#SumT ## "lux;TupleS" + (#SumT ## "lux;Tuple" AST-List - ## "lux;RecordS" + ## "lux;Record" (#AppT List (#ProdT AST AST)) ))))))))))) )))) - (#Cons [["lux" "tags"] (#ListA (#Cons (#TextA "BoolS") - (#Cons (#TextA "NatS") - (#Cons (#TextA "IntS") - (#Cons (#TextA "DegS") - (#Cons (#TextA "RealS") - (#Cons (#TextA "CharS") - (#Cons (#TextA "TextS") - (#Cons (#TextA "SymbolS") - (#Cons (#TextA "TagS") - (#Cons (#TextA "FormS") - (#Cons (#TextA "TupleS") - (#Cons (#TextA "RecordS") + (#Cons [["lux" "tags"] (#ListA (#Cons (#TextA "Bool") + (#Cons (#TextA "Nat") + (#Cons (#TextA "Int") + (#Cons (#TextA "Deg") + (#Cons (#TextA "Real") + (#Cons (#TextA "Char") + (#Cons (#TextA "Text") + (#Cons (#TextA "Symbol") + (#Cons (#TextA "Tag") + (#Cons (#TextA "Form") + (#Cons (#TextA "Tuple") + (#Cons (#TextA "Record") #Nil)))))))))))))] (#Cons [["lux" "type-args"] (#ListA (#Cons (#TextA "w") #;Nil))] default-def-meta-exported))) @@ -730,62 +730,62 @@ (_lux_def bool$ (_lux_: (#FunctionT Bool AST) - (_lux_function _ value (_meta (#BoolS value)))) + (_lux_function _ value (_meta (#Bool value)))) #Nil) (_lux_def nat$ (_lux_: (#FunctionT Nat AST) - (_lux_function _ value (_meta (#NatS value)))) + (_lux_function _ value (_meta (#Nat value)))) #Nil) (_lux_def int$ (_lux_: (#FunctionT Int AST) - (_lux_function _ value (_meta (#IntS value)))) + (_lux_function _ value (_meta (#Int value)))) #Nil) (_lux_def deg$ (_lux_: (#FunctionT Deg AST) - (_lux_function _ value (_meta (#DegS value)))) + (_lux_function _ value (_meta (#Deg value)))) #Nil) (_lux_def real$ (_lux_: (#FunctionT Real AST) - (_lux_function _ value (_meta (#RealS value)))) + (_lux_function _ value (_meta (#Real value)))) #Nil) (_lux_def char$ (_lux_: (#FunctionT Char AST) - (_lux_function _ value (_meta (#CharS value)))) + (_lux_function _ value (_meta (#Char value)))) #Nil) (_lux_def text$ (_lux_: (#FunctionT Text AST) - (_lux_function _ text (_meta (#TextS text)))) + (_lux_function _ text (_meta (#Text text)))) #Nil) (_lux_def symbol$ (_lux_: (#FunctionT Ident AST) - (_lux_function _ ident (_meta (#SymbolS ident)))) + (_lux_function _ ident (_meta (#Symbol ident)))) #Nil) (_lux_def tag$ (_lux_: (#FunctionT Ident AST) - (_lux_function _ ident (_meta (#TagS ident)))) + (_lux_function _ ident (_meta (#Tag ident)))) #Nil) (_lux_def form$ (_lux_: (#FunctionT (#AppT List AST) AST) - (_lux_function _ tokens (_meta (#FormS tokens)))) + (_lux_function _ tokens (_meta (#Form tokens)))) #Nil) (_lux_def tuple$ (_lux_: (#FunctionT (#AppT List AST) AST) - (_lux_function _ tokens (_meta (#TupleS tokens)))) + (_lux_function _ tokens (_meta (#Tuple tokens)))) #Nil) (_lux_def record$ (_lux_: (#FunctionT (#AppT List (#ProdT AST AST)) AST) - (_lux_function _ tokens (_meta (#RecordS tokens)))) + (_lux_function _ tokens (_meta (#Record tokens)))) #Nil) (_lux_def default-macro-meta @@ -811,34 +811,34 @@ (_lux_: Macro (_lux_function _ tokens (_lux_case tokens - (#Cons [_ (#TupleS (#Cons arg args'))] (#Cons body #Nil)) - (return (#Cons (_meta (#FormS (#Cons (_meta (#SymbolS "" "_lux_function")) - (#Cons (_meta (#SymbolS "" "")) - (#Cons arg - (#Cons (_lux_case args' - #Nil - body - - _ - (_meta (#FormS (#Cons (_meta (#SymbolS "lux" "function''")) - (#Cons (_meta (#TupleS args')) - (#Cons body #Nil)))))) - #Nil)))))) + (#Cons [_ (#Tuple (#Cons arg args'))] (#Cons body #Nil)) + (return (#Cons (_meta (#Form (#Cons (_meta (#Symbol "" "_lux_function")) + (#Cons (_meta (#Symbol "" "")) + (#Cons arg + (#Cons (_lux_case args' + #Nil + body + + _ + (_meta (#Form (#Cons (_meta (#Symbol "lux" "function''")) + (#Cons (_meta (#Tuple args')) + (#Cons body #Nil)))))) + #Nil)))))) #Nil)) - (#Cons [_ (#SymbolS "" self)] (#Cons [_ (#TupleS (#Cons arg args'))] (#Cons body #Nil))) - (return (#Cons (_meta (#FormS (#Cons (_meta (#SymbolS "" "_lux_function")) - (#Cons (_meta (#SymbolS "" self)) - (#Cons arg - (#Cons (_lux_case args' - #Nil - body - - _ - (_meta (#FormS (#Cons (_meta (#SymbolS "lux" "function''")) - (#Cons (_meta (#TupleS args')) - (#Cons body #Nil)))))) - #Nil)))))) + (#Cons [_ (#Symbol "" self)] (#Cons [_ (#Tuple (#Cons arg args'))] (#Cons body #Nil))) + (return (#Cons (_meta (#Form (#Cons (_meta (#Symbol "" "_lux_function")) + (#Cons (_meta (#Symbol "" self)) + (#Cons arg + (#Cons (_lux_case args' + #Nil + body + + _ + (_meta (#Form (#Cons (_meta (#Symbol "lux" "function''")) + (#Cons (_meta (#Tuple args')) + (#Cons body #Nil)))))) + #Nil)))))) #Nil)) _ @@ -900,53 +900,53 @@ (_lux_: Macro (function'' [tokens] (_lux_case tokens - (#Cons [[_ (#TagS ["" "export"])] - (#Cons [[_ (#FormS (#Cons [name args]))] + (#Cons [[_ (#Tag ["" "export"])] + (#Cons [[_ (#Form (#Cons [name args]))] (#Cons [meta (#Cons [type (#Cons [body #Nil])])])])]) - (return (#Cons [(_meta (#FormS (#Cons [(_meta (#SymbolS ["" "_lux_def"])) - (#Cons [name - (#Cons [(_meta (#FormS (#Cons [(_meta (#SymbolS ["" "_lux_:"])) - (#Cons [type - (#Cons [(_meta (#FormS (#Cons [(_meta (#SymbolS ["lux" "function''"])) - (#Cons [name - (#Cons [(_meta (#TupleS args)) - (#Cons [body #Nil])])])]))) - #Nil])])]))) - (#Cons (with-export-meta meta) #Nil)])])]))) + (return (#Cons [(_meta (#Form (#Cons [(_meta (#Symbol ["" "_lux_def"])) + (#Cons [name + (#Cons [(_meta (#Form (#Cons [(_meta (#Symbol ["" "_lux_:"])) + (#Cons [type + (#Cons [(_meta (#Form (#Cons [(_meta (#Symbol ["lux" "function''"])) + (#Cons [name + (#Cons [(_meta (#Tuple args)) + (#Cons [body #Nil])])])]))) + #Nil])])]))) + (#Cons (with-export-meta meta) #Nil)])])]))) #Nil])) - (#Cons [[_ (#TagS ["" "export"])] (#Cons [name (#Cons [meta (#Cons [type (#Cons [body #Nil])])])])]) - (return (#Cons [(_meta (#FormS (#Cons [(_meta (#SymbolS ["" "_lux_def"])) - (#Cons [name - (#Cons [(_meta (#FormS (#Cons [(_meta (#SymbolS ["" "_lux_:"])) - (#Cons [type - (#Cons [body - #Nil])])]))) - (#Cons (with-export-meta meta) #Nil)])])]))) + (#Cons [[_ (#Tag ["" "export"])] (#Cons [name (#Cons [meta (#Cons [type (#Cons [body #Nil])])])])]) + (return (#Cons [(_meta (#Form (#Cons [(_meta (#Symbol ["" "_lux_def"])) + (#Cons [name + (#Cons [(_meta (#Form (#Cons [(_meta (#Symbol ["" "_lux_:"])) + (#Cons [type + (#Cons [body + #Nil])])]))) + (#Cons (with-export-meta meta) #Nil)])])]))) #Nil])) - (#Cons [[_ (#FormS (#Cons [name args]))] + (#Cons [[_ (#Form (#Cons [name args]))] (#Cons [meta (#Cons [type (#Cons [body #Nil])])])]) - (return (#Cons [(_meta (#FormS (#Cons [(_meta (#SymbolS ["" "_lux_def"])) - (#Cons [name - (#Cons [(_meta (#FormS (#Cons [(_meta (#SymbolS ["" "_lux_:"])) - (#Cons [type - (#Cons [(_meta (#FormS (#Cons [(_meta (#SymbolS ["lux" "function''"])) - (#Cons [name - (#Cons [(_meta (#TupleS args)) - (#Cons [body #Nil])])])]))) - #Nil])])]))) - (#Cons meta #Nil)])])]))) + (return (#Cons [(_meta (#Form (#Cons [(_meta (#Symbol ["" "_lux_def"])) + (#Cons [name + (#Cons [(_meta (#Form (#Cons [(_meta (#Symbol ["" "_lux_:"])) + (#Cons [type + (#Cons [(_meta (#Form (#Cons [(_meta (#Symbol ["lux" "function''"])) + (#Cons [name + (#Cons [(_meta (#Tuple args)) + (#Cons [body #Nil])])])]))) + #Nil])])]))) + (#Cons meta #Nil)])])]))) #Nil])) (#Cons [name (#Cons [meta (#Cons [type (#Cons [body #Nil])])])]) - (return (#Cons [(_meta (#FormS (#Cons [(_meta (#SymbolS ["" "_lux_def"])) - (#Cons [name - (#Cons [(_meta (#FormS (#Cons [(_meta (#SymbolS ["" "_lux_:"])) - (#Cons [type - (#Cons [body - #Nil])])]))) - (#Cons meta #Nil)])])]))) + (return (#Cons [(_meta (#Form (#Cons [(_meta (#Symbol ["" "_lux_def"])) + (#Cons [name + (#Cons [(_meta (#Form (#Cons [(_meta (#Symbol ["" "_lux_:"])) + (#Cons [type + (#Cons [body + #Nil])])]))) + (#Cons meta #Nil)])])]))) #Nil])) _ @@ -958,7 +958,7 @@ default-macro-meta Macro (_lux_case tokens - (#Cons [_ (#FormS (#Cons name args))] (#Cons body #Nil)) + (#Cons [_ (#Form (#Cons name args))] (#Cons body #Nil)) (return (#Cons (form$ (#Cons (symbol$ ["lux" "def:''"]) (#Cons (form$ (#Cons name args)) (#Cons (with-macro-meta (tag$ ["lux" "Nil"])) @@ -968,7 +968,7 @@ ))) #Nil)) - (#Cons [_ (#TagS ["" "export"])] (#Cons [_ (#FormS (#Cons name args))] (#Cons body #Nil))) + (#Cons [_ (#Tag ["" "export"])] (#Cons [_ (#Form (#Cons name args))] (#Cons body #Nil))) (return (#Cons (form$ (#Cons (symbol$ ["lux" "def:''"]) (#Cons (tag$ ["" "export"]) (#Cons (form$ (#Cons name args)) @@ -979,7 +979,7 @@ )))) #Nil)) - (#Cons [_ (#TagS ["" "export"])] (#Cons [_ (#FormS (#Cons name args))] (#Cons meta-data (#Cons body #Nil)))) + (#Cons [_ (#Tag ["" "export"])] (#Cons [_ (#Form (#Cons name args))] (#Cons meta-data (#Cons body #Nil)))) (return (#Cons (form$ (#Cons (symbol$ ["lux" "def:''"]) (#Cons (tag$ ["" "export"]) (#Cons (form$ (#Cons name args)) @@ -1068,7 +1068,7 @@ #Nil (#FunctionT RepEnv (#FunctionT AST AST)) (_lux_case syntax - [_ (#SymbolS "" name)] + [_ (#Symbol "" name)] (_lux_case (get-rep name reps) (#Some replacement) replacement @@ -1076,19 +1076,19 @@ #None syntax) - [meta (#FormS parts)] - [meta (#FormS (map (replace-syntax reps) parts))] + [meta (#Form parts)] + [meta (#Form (map (replace-syntax reps) parts))] - [meta (#TupleS members)] - [meta (#TupleS (map (replace-syntax reps) members))] + [meta (#Tuple members)] + [meta (#Tuple (map (replace-syntax reps) members))] - [meta (#RecordS slots)] - [meta (#RecordS (map (_lux_: (#FunctionT (#ProdT AST AST) (#ProdT AST AST)) - (function'' [slot] - (_lux_case slot - [k v] - [(replace-syntax reps k) (replace-syntax reps v)]))) - slots))] + [meta (#Record slots)] + [meta (#Record (map (_lux_: (#FunctionT (#ProdT AST AST) (#ProdT AST AST)) + (function'' [slot] + (_lux_case slot + [k v] + [(replace-syntax reps k) (replace-syntax reps v)]))) + slots))] _ syntax) @@ -1098,20 +1098,20 @@ #Nil (#FunctionT AST AST) (_lux_case ast - [_ (#TupleS members)] + [_ (#Tuple members)] (tuple$ (map update-bounds members)) - [_ (#RecordS pairs)] + [_ (#Record pairs)] (record$ (map (_lux_: (#FunctionT (#ProdT AST AST) (#ProdT AST AST)) (function'' [pair] (let'' [name val] pair [name (update-bounds val)]))) pairs)) - [_ (#FormS (#Cons [_ (#TagS "lux" "BoundT")] (#Cons [_ (#NatS idx)] #Nil)))] + [_ (#Form (#Cons [_ (#Tag "lux" "BoundT")] (#Cons [_ (#Nat idx)] #Nil)))] (form$ (#Cons (tag$ ["lux" "BoundT"]) (#Cons (nat$ (_lux_proc ["nat" "+"] [+2 idx])) #Nil))) - [_ (#FormS members)] + [_ (#Form members)] (form$ (map update-bounds members)) _ @@ -1128,7 +1128,7 @@ #Nil (next #Nil) - (#Cons [_ (#SymbolS "" arg-name)] args') + (#Cons [_ (#Symbol "" arg-name)] args') (parse-quantified-args args' (function'' [names] (next (#Cons arg-name names)))) _ @@ -1173,13 +1173,13 @@ [a (List a)]))")] #;Nil) (let'' [self-name tokens] (_lux_case tokens - (#Cons [_ (#SymbolS "" self-name)] tokens) + (#Cons [_ (#Symbol "" self-name)] tokens) [self-name tokens] _ ["" tokens]) (_lux_case tokens - (#Cons [_ (#TupleS args)] (#Cons body #Nil)) + (#Cons [_ (#Tuple args)] (#Cons body #Nil)) (parse-quantified-args args (function'' [names] (let'' body' (fold (_lux_: (#FunctionT Text (#FunctionT AST AST)) @@ -1224,13 +1224,13 @@ (List (Self a))])")] #;Nil) (let'' [self-name tokens] (_lux_case tokens - (#Cons [_ (#SymbolS "" self-name)] tokens) + (#Cons [_ (#Symbol "" self-name)] tokens) [self-name tokens] _ ["" tokens]) (_lux_case tokens - (#Cons [_ (#TupleS args)] (#Cons body #Nil)) + (#Cons [_ (#Tuple args)] (#Cons body #Nil)) (parse-quantified-args args (function'' [names] (let'' body' (fold (_lux_: (#FunctionT Text (#FunctionT AST AST)) @@ -1350,13 +1350,13 @@ (macro:' (function' tokens) (let'' [name tokens'] (_lux_case tokens - (#Cons [[_ (#SymbolS ["" name])] tokens']) + (#Cons [[_ (#Symbol ["" name])] tokens']) [name tokens'] _ ["" tokens]) (_lux_case tokens' - (#Cons [[_ (#TupleS args)] (#Cons [body #Nil])]) + (#Cons [[_ (#Tuple args)] (#Cons [body #Nil])]) (_lux_case args #Nil (fail "function' requires a non-empty arguments tuple.") @@ -1378,8 +1378,8 @@ (macro:' (def:''' tokens) (_lux_case tokens - (#Cons [[_ (#TagS ["" "export"])] - (#Cons [[_ (#FormS (#Cons [name args]))] + (#Cons [[_ (#Tag ["" "export"])] + (#Cons [[_ (#Form (#Cons [name args]))] (#Cons [meta (#Cons [type (#Cons [body #Nil])])])])]) (return (list (form$ (list (symbol$ ["" "_lux_def"]) name @@ -1391,7 +1391,7 @@ body)))) (with-export-meta meta))))) - (#Cons [[_ (#TagS ["" "export"])] (#Cons [name (#Cons [meta (#Cons [type (#Cons [body #Nil])])])])]) + (#Cons [[_ (#Tag ["" "export"])] (#Cons [name (#Cons [meta (#Cons [type (#Cons [body #Nil])])])])]) (return (list (form$ (list (symbol$ ["" "_lux_def"]) name (form$ (list (symbol$ ["" "_lux_:"]) @@ -1399,7 +1399,7 @@ body)) (with-export-meta meta))))) - (#Cons [[_ (#FormS (#Cons [name args]))] + (#Cons [[_ (#Form (#Cons [name args]))] (#Cons [meta (#Cons [type (#Cons [body #Nil])])])]) (return (list (form$ (list (symbol$ ["" "_lux_def"]) name @@ -1433,7 +1433,7 @@ (macro:' (let' tokens) (_lux_case tokens - (#Cons [[_ (#TupleS bindings)] (#Cons [body #Nil])]) + (#Cons [[_ (#Tuple bindings)] (#Cons [body #Nil])]) (return (list (fold (_lux_: (-> (& AST AST) AST AST) (function' [binding body] @@ -1463,7 +1463,7 @@ #Nil (-> AST Bool) (_lux_case token - [_ (#FormS (#Cons [[_ (#SymbolS ["" "~@"])] (#Cons [_ #Nil])]))] + [_ (#Form (#Cons [[_ (#Symbol ["" "~@"])] (#Cons [_ #Nil])]))] true _ @@ -1480,10 +1480,10 @@ (-> ($' List AST) AST) (_lux_case tokens #Nil - (_meta (#TagS ["lux" "Nil"])) + (_meta (#Tag ["lux" "Nil"])) (#Cons [token tokens']) - (_meta (#FormS (list (_meta (#TagS ["lux" "Cons"])) token (untemplate-list tokens')))))) + (_meta (#Form (list (_meta (#Tag ["lux" "Cons"])) token (untemplate-list tokens')))))) (def:''' (List/append xs ys) #Nil @@ -1596,14 +1596,14 @@ (macro:' (do tokens) (_lux_case tokens - (#Cons monad (#Cons [_ (#TupleS bindings)] (#Cons body #Nil))) + (#Cons monad (#Cons [_ (#Tuple bindings)] (#Cons body #Nil))) (let' [g!wrap (symbol$ ["" "wrap"]) g!bind (symbol$ ["" " bind "]) body' (fold (_lux_: (-> (& AST AST) AST AST) (function' [binding body'] (let' [[var value] binding] (_lux_case var - [_ (#TagS "" "let")] + [_ (#Tag "" "let")] (form$ (list (symbol$ ["lux" "let'"]) value body')) _ @@ -1759,7 +1759,7 @@ (_lux_: (-> AST ($' Lux AST)) (function' [elem] (_lux_case elem - [_ (#FormS (#Cons [[_ (#SymbolS ["" "~@"])] (#Cons [spliced #Nil])]))] + [_ (#Form (#Cons [[_ (#Symbol ["" "~@"])] (#Cons [spliced #Nil])]))] (wrap spliced) _ @@ -1787,40 +1787,40 @@ #Nil (-> Bool Text AST ($' Lux AST)) (_lux_case [replace? token] - [_ [_ (#BoolS value)]] - (return (wrap-meta (form$ (list (tag$ ["lux" "BoolS"]) (bool$ value))))) + [_ [_ (#Bool value)]] + (return (wrap-meta (form$ (list (tag$ ["lux" "Bool"]) (bool$ value))))) - [_ [_ (#NatS value)]] - (return (wrap-meta (form$ (list (tag$ ["lux" "NatS"]) (nat$ value))))) + [_ [_ (#Nat value)]] + (return (wrap-meta (form$ (list (tag$ ["lux" "Nat"]) (nat$ value))))) - [_ [_ (#IntS value)]] - (return (wrap-meta (form$ (list (tag$ ["lux" "IntS"]) (int$ value))))) + [_ [_ (#Int value)]] + (return (wrap-meta (form$ (list (tag$ ["lux" "Int"]) (int$ value))))) - [_ [_ (#DegS value)]] - (return (wrap-meta (form$ (list (tag$ ["lux" "DegS"]) (deg$ value))))) + [_ [_ (#Deg value)]] + (return (wrap-meta (form$ (list (tag$ ["lux" "Deg"]) (deg$ value))))) - [_ [_ (#RealS value)]] - (return (wrap-meta (form$ (list (tag$ ["lux" "RealS"]) (real$ value))))) + [_ [_ (#Real value)]] + (return (wrap-meta (form$ (list (tag$ ["lux" "Real"]) (real$ value))))) - [_ [_ (#CharS value)]] - (return (wrap-meta (form$ (list (tag$ ["lux" "CharS"]) (char$ value))))) + [_ [_ (#Char value)]] + (return (wrap-meta (form$ (list (tag$ ["lux" "Char"]) (char$ value))))) - [_ [_ (#TextS value)]] - (return (wrap-meta (form$ (list (tag$ ["lux" "TextS"]) (text$ value))))) + [_ [_ (#Text value)]] + (return (wrap-meta (form$ (list (tag$ ["lux" "Text"]) (text$ value))))) - [false [_ (#TagS [module name])]] - (return (wrap-meta (form$ (list (tag$ ["lux" "TagS"]) (tuple$ (list (text$ module) (text$ name))))))) + [false [_ (#Tag [module name])]] + (return (wrap-meta (form$ (list (tag$ ["lux" "Tag"]) (tuple$ (list (text$ module) (text$ name))))))) - [true [_ (#TagS [module name])]] + [true [_ (#Tag [module name])]] (let' [module' (_lux_case module "" subst _ module)] - (return (wrap-meta (form$ (list (tag$ ["lux" "TagS"]) (tuple$ (list (text$ module') (text$ name)))))))) + (return (wrap-meta (form$ (list (tag$ ["lux" "Tag"]) (tuple$ (list (text$ module') (text$ name)))))))) - [true [_ (#SymbolS [module name])]] + [true [_ (#Symbol [module name])]] (do Monad<Lux> [real-name (_lux_case module "" @@ -1831,27 +1831,27 @@ _ (wrap [module name])) #let [[module name] real-name]] - (return (wrap-meta (form$ (list (tag$ ["lux" "SymbolS"]) (tuple$ (list (text$ module) (text$ name)))))))) + (return (wrap-meta (form$ (list (tag$ ["lux" "Symbol"]) (tuple$ (list (text$ module) (text$ name)))))))) - [false [_ (#SymbolS [module name])]] - (return (wrap-meta (form$ (list (tag$ ["lux" "SymbolS"]) (tuple$ (list (text$ module) (text$ name))))))) + [false [_ (#Symbol [module name])]] + (return (wrap-meta (form$ (list (tag$ ["lux" "Symbol"]) (tuple$ (list (text$ module) (text$ name))))))) - [_ [_ (#TupleS elems)]] - (splice replace? (untemplate replace? subst) (tag$ ["lux" "TupleS"]) elems) + [_ [_ (#Tuple elems)]] + (splice replace? (untemplate replace? subst) (tag$ ["lux" "Tuple"]) elems) - [true [_ (#FormS (#Cons [[_ (#SymbolS ["" "~"])] (#Cons [unquoted #Nil])]))]] + [true [_ (#Form (#Cons [[_ (#Symbol ["" "~"])] (#Cons [unquoted #Nil])]))]] (return unquoted) - [true [_ (#FormS (#Cons [[_ (#SymbolS ["" "~'"])] (#Cons [keep-quoted #Nil])]))]] + [true [_ (#Form (#Cons [[_ (#Symbol ["" "~'"])] (#Cons [keep-quoted #Nil])]))]] (untemplate false subst keep-quoted) - [_ [meta (#FormS elems)]] + [_ [meta (#Form elems)]] (do Monad<Lux> - [output (splice replace? (untemplate replace? subst) (tag$ ["lux" "FormS"]) elems) + [output (splice replace? (untemplate replace? subst) (tag$ ["lux" "Form"]) elems) #let [[_ form'] output]] (return [meta form'])) - [_ [_ (#RecordS fields)]] + [_ [_ (#Record fields)]] (do Monad<Lux> [=fields (mapM Monad<Lux> (_lux_: (-> (& AST AST) ($' Lux AST)) @@ -1862,7 +1862,7 @@ =v (untemplate replace? subst v)] (wrap (tuple$ (list =k =v))))))) fields)] - (wrap (wrap-meta (form$ (list (tag$ ["lux" "RecordS"]) (untemplate-list =fields)))))) + (wrap (wrap-meta (form$ (list (tag$ ["lux" "Record"]) (untemplate-list =fields)))))) )) (macro:' #export (host tokens) @@ -1871,10 +1871,10 @@ (host java.util.List [java.lang.Long])")]) (_lux_case tokens - (#Cons [_ (#SymbolS "" class-name)] #Nil) + (#Cons [_ (#Symbol "" class-name)] #Nil) (return (list (form$ (list (tag$ ["lux" "HostT"]) (text$ class-name) (tag$ ["lux" "Nil"]))))) - (#Cons [_ (#SymbolS "" class-name)] (#Cons [_ (#TupleS params)] #Nil)) + (#Cons [_ (#Symbol "" class-name)] (#Cons [_ (#Tuple params)] #Nil)) (return (list (form$ (list (tag$ ["lux" "HostT"]) (text$ class-name) (untemplate-list params))))) _ @@ -1951,10 +1951,10 @@ (return (list (fold (_lux_: (-> AST AST AST) (function' [app acc] (_lux_case app - [_ (#TupleS parts)] + [_ (#Tuple parts)] (tuple$ (List/append parts (list acc))) - [_ (#FormS parts)] + [_ (#Form parts)] (form$ (List/append parts (list acc))) _ @@ -1978,10 +1978,10 @@ (return (list (fold (_lux_: (-> AST AST AST) (function' [app acc] (_lux_case app - [_ (#TupleS parts)] + [_ (#Tuple parts)] (tuple$ (List/append parts (list acc))) - [_ (#FormS parts)] + [_ (#Form parts)] (form$ (List/append parts (list acc))) _ @@ -2002,7 +2002,7 @@ #Nil (-> AST ($' Maybe Ident)) (_lux_case x - [_ (#SymbolS sname)] + [_ (#Symbol sname)] (#Some sname) _ @@ -2012,7 +2012,7 @@ #Nil (-> AST ($' Maybe Ident)) (_lux_case x - [_ (#TagS sname)] + [_ (#Tag sname)] (#Some sname) _ @@ -2022,7 +2022,7 @@ #Nil (-> AST ($' Maybe Text)) (_lux_case x - [_ (#SymbolS "" sname)] + [_ (#Symbol "" sname)] (#Some sname) _ @@ -2032,7 +2032,7 @@ #Nil (-> AST ($' Maybe ($' List AST))) (_lux_case tuple - [_ (#TupleS members)] + [_ (#Tuple members)] (#Some members) _ @@ -2042,7 +2042,7 @@ #Nil (-> RepEnv AST AST) (_lux_case template - [_ (#SymbolS "" sname)] + [_ (#Symbol "" sname)] (_lux_case (get-rep sname env) (#Some subst) subst @@ -2050,18 +2050,18 @@ _ template) - [meta (#TupleS elems)] - [meta (#TupleS (map (apply-template env) elems))] + [meta (#Tuple elems)] + [meta (#Tuple (map (apply-template env) elems))] - [meta (#FormS elems)] - [meta (#FormS (map (apply-template env) elems))] + [meta (#Form elems)] + [meta (#Form (map (apply-template env) elems))] - [meta (#RecordS members)] - [meta (#RecordS (map (_lux_: (-> (& AST AST) (& AST AST)) - (function' [kv] - (let' [[slot value] kv] - [(apply-template env slot) (apply-template env value)]))) - members))] + [meta (#Record members)] + [meta (#Record (map (_lux_: (-> (& AST AST) (& AST AST)) + (function' [kv] + (let' [[slot value] kv] + [(apply-template env slot) (apply-template env value)]))) + members))] _ template)) @@ -2093,7 +2093,7 @@ [i.inc 1] [i.dec -1])")]) (_lux_case tokens - (#Cons [[_ (#TupleS bindings)] (#Cons [[_ (#TupleS templates)] data])]) + (#Cons [[_ (#Tuple bindings)] (#Cons [[_ (#Tuple templates)] data])]) (_lux_case [(mapM Monad<Maybe> get-name bindings) (mapM Monad<Maybe> tuple->list data)] [(#Some bindings') (#Some data')] @@ -2407,7 +2407,7 @@ #Nil (-> AST ($' Lux ($' List AST))) (_lux_case token - [_ (#FormS (#Cons [_ (#SymbolS macro-name)] args))] + [_ (#Form (#Cons [_ (#Symbol macro-name)] args))] (do Monad<Lux> [macro-name' (normalize macro-name) ?macro (find-macro macro-name')] @@ -2425,7 +2425,7 @@ #Nil (-> AST ($' Lux ($' List AST))) (_lux_case token - [_ (#FormS (#Cons [_ (#SymbolS macro-name)] args))] + [_ (#Form (#Cons [_ (#Symbol macro-name)] args))] (do Monad<Lux> [macro-name' (normalize macro-name) ?macro (find-macro macro-name')] @@ -2446,7 +2446,7 @@ #Nil (-> AST ($' Lux ($' List AST))) (_lux_case syntax - [_ (#FormS (#Cons [_ (#SymbolS macro-name)] args))] + [_ (#Form (#Cons [_ (#Symbol macro-name)] args))] (do Monad<Lux> [macro-name' (normalize macro-name) ?macro (find-macro macro-name')] @@ -2462,17 +2462,17 @@ [args' (mapM Monad<Lux> macro-expand-all args)] (wrap (list (form$ (#Cons (symbol$ macro-name) (List/join args')))))))) - [_ (#FormS members)] + [_ (#Form members)] (do Monad<Lux> [members' (mapM Monad<Lux> macro-expand-all members)] (wrap (list (form$ (List/join members'))))) - [_ (#TupleS members)] + [_ (#Tuple members)] (do Monad<Lux> [members' (mapM Monad<Lux> macro-expand-all members)] (wrap (list (tuple$ (List/join members'))))) - [_ (#RecordS pairs)] + [_ (#Record pairs)] (do Monad<Lux> [pairs' (mapM Monad<Lux> (function' [kv] @@ -2495,13 +2495,13 @@ #Nil (-> AST AST) (_lux_case type - [_ (#FormS (#Cons [_ (#TagS tag)] parts))] + [_ (#Form (#Cons [_ (#Tag tag)] parts))] (form$ (#Cons [(tag$ tag) (map walk-type parts)])) - [_ (#TupleS members)] + [_ (#Tuple members)] (` (& (~@ (map walk-type members)))) - [_ (#FormS (#Cons type-fn args))] + [_ (#Form (#Cons type-fn args))] (fold (_lux_: (-> AST AST AST) (function' [arg type-fn] (` (#;AppT (~ type-fn) (~ arg))))) (walk-type type-fn) @@ -2567,13 +2567,13 @@ #Nil (-> ($' List AST) ($' Lux (& AST ($' Maybe ($' List Text))))) (_lux_case type-asts - (#Cons [_ (#RecordS pairs)] #;Nil) + (#Cons [_ (#Record pairs)] #;Nil) (do Monad<Lux> [members (mapM Monad<Lux> (: (-> [AST AST] (Lux [Text AST])) (function' [pair] (_lux_case pair - [[_ (#TagS "" member-name)] member-type] + [[_ (#Tag "" member-name)] member-type] (return [member-name member-type]) _ @@ -2584,10 +2584,10 @@ (#Cons type #Nil) (_lux_case type - [_ (#TagS "" member-name)] + [_ (#Tag "" member-name)] (return [(` #;UnitT) (#;Some (list member-name))]) - [_ (#FormS (#Cons [_ (#TagS "" member-name)] member-types))] + [_ (#Form (#Cons [_ (#Tag "" member-name)] member-types))] (return [(` (& (~@ member-types))) (#;Some (list member-name))]) _ @@ -2599,13 +2599,13 @@ (: (-> AST (Lux [Text AST])) (function' [case] (_lux_case case - [_ (#TagS "" member-name)] + [_ (#Tag "" member-name)] (return [member-name (` Unit)]) - [_ (#FormS (#Cons [_ (#TagS "" member-name)] (#Cons member-type #Nil)))] + [_ (#Form (#Cons [_ (#Tag "" member-name)] (#Cons member-type #Nil)))] (return [member-name member-type]) - [_ (#FormS (#Cons [_ (#TagS "" member-name)] member-types))] + [_ (#Form (#Cons [_ (#Tag "" member-name)] member-types))] (return [member-name (` (& (~@ member-types)))]) _ @@ -2639,7 +2639,7 @@ (Rec Self [Int (List Self)])")]) (_lux_case tokens - (#Cons [_ (#SymbolS "" name)] (#Cons body #Nil)) + (#Cons [_ (#Symbol "" name)] (#Cons body #Nil)) (let' [body' (replace-syntax (list [name (` (#AppT (~ (make-bound +0)) (~ (make-bound +1))))]) (update-bounds body))] (return (list (` (#AppT (#UnivQ #Nil (~ body')) Void))))) @@ -2667,20 +2667,20 @@ (macro:' (def:' tokens) (let' [[export? tokens'] (_lux_case tokens - (#Cons [_ (#TagS "" "export")] tokens') + (#Cons [_ (#Tag "" "export")] tokens') [true tokens'] _ [false tokens]) parts (: (Maybe [AST (List AST) (Maybe AST) AST]) (_lux_case tokens' - (#Cons [_ (#FormS (#Cons name args))] (#Cons type (#Cons body #Nil))) + (#Cons [_ (#Form (#Cons name args))] (#Cons type (#Cons body #Nil))) (#Some name args (#Some type) body) (#Cons name (#Cons type (#Cons body #Nil))) (#Some name #Nil (#Some type) body) - (#Cons [_ (#FormS (#Cons name args))] (#Cons body #Nil)) + (#Cons [_ (#Form (#Cons name args))] (#Cons body #Nil)) (#Some name args #None body) (#Cons name (#Cons body #Nil)) @@ -2718,52 +2718,52 @@ (def:' (ast-to-text ast) (-> AST Text) (_lux_case ast - [_ (#BoolS value)] + [_ (#Bool value)] (Bool/encode value) - [_ (#NatS value)] + [_ (#Nat value)] (Nat/encode value) - [_ (#IntS value)] + [_ (#Int value)] (Int/encode value) - [_ (#DegS value)] + [_ (#Deg value)] (Deg/encode value) - [_ (#RealS value)] + [_ (#Real value)] (Real/encode value) - [_ (#CharS value)] + [_ (#Char value)] ($_ Text/append "#" "\"" (Char/encode value) "\"") - [_ (#TextS value)] + [_ (#Text value)] ($_ Text/append "\"" value "\"") - [_ (#SymbolS [prefix name])] + [_ (#Symbol [prefix name])] (if (Text/= "" prefix) name ($_ Text/append prefix ";" name)) - [_ (#TagS [prefix name])] + [_ (#Tag [prefix name])] (if (Text/= "" prefix) ($_ Text/append "#" name) ($_ Text/append "#" prefix ";" name)) - [_ (#FormS xs)] + [_ (#Form xs)] ($_ Text/append "(" (|> xs (map ast-to-text) (interpose " ") reverse (fold Text/append "")) ")") - [_ (#TupleS xs)] + [_ (#Tuple xs)] ($_ Text/append "[" (|> xs (map ast-to-text) (interpose " ") reverse (fold Text/append "")) "]") - [_ (#RecordS kvs)] + [_ (#Record kvs)] ($_ Text/append "{" (|> kvs (map (function' [kv] (_lux_case kv [k v] ($_ Text/append (ast-to-text k) " " (ast-to-text v))))) (interpose " ") @@ -2774,7 +2774,7 @@ (def:' (expander branches) (-> (List AST) (Lux (List AST))) (_lux_case branches - (#;Cons [_ (#FormS (#Cons [_ (#SymbolS macro-name)] macro-args))] + (#;Cons [_ (#Form (#Cons [_ (#Symbol macro-name)] macro-args))] (#;Cons body branches')) (do Monad<Lux> @@ -2832,7 +2832,7 @@ _ #None)")]) (case tokens - (#Cons [_ (#FormS (#Cons pattern #Nil))] (#Cons body branches)) + (#Cons [_ (#Form (#Cons pattern #Nil))] (#Cons body branches)) (do Monad<Lux> [pattern+ (macro-expand-all pattern)] (case pattern+ @@ -2866,7 +2866,7 @@ _ false))")]) (case tokens - (^ (list& [_ (#FormS patterns)] body branches)) + (^ (list& [_ (#Form patterns)] body branches)) (case patterns #Nil (fail "^or cannot have 0 patterns") @@ -2882,7 +2882,7 @@ (def:' (symbol? ast) (-> AST Bool) (case ast - [_ (#SymbolS _)] + [_ (#Symbol _)] true _ @@ -2895,7 +2895,7 @@ y (baz quux)] (op x y))")]) (case tokens - (^ (list [_ (#TupleS bindings)] body)) + (^ (list [_ (#Tuple bindings)] body)) (if (multiple? 2 (length bindings)) (|> bindings as-pairs reverse (fold (: (-> [AST AST] AST AST) @@ -2922,10 +2922,10 @@ (function const [x y] x))")]) (case (: (Maybe [Ident AST (List AST) AST]) (case tokens - (^ (list [_ (#TupleS (#Cons head tail))] body)) + (^ (list [_ (#Tuple (#Cons head tail))] body)) (#Some ["" ""] head tail body) - (^ (list [_ (#SymbolS ["" name])] [_ (#TupleS (#Cons head tail))] body)) + (^ (list [_ (#Symbol ["" name])] [_ (#Tuple (#Cons head tail))] body)) (#Some ["" name] head tail body) _ @@ -2951,45 +2951,45 @@ (def:' (process-def-meta-value ast) (-> AST (Lux AST)) (case ast - [_ (#BoolS value)] + [_ (#Bool value)] (return (form$ (list (tag$ ["lux" "BoolA"]) (bool$ value)))) - [_ (#NatS value)] + [_ (#Nat value)] (return (form$ (list (tag$ ["lux" "NatA"]) (nat$ value)))) - [_ (#IntS value)] + [_ (#Int value)] (return (form$ (list (tag$ ["lux" "IntA"]) (int$ value)))) - [_ (#DegS value)] + [_ (#Deg value)] (return (form$ (list (tag$ ["lux" "DegA"]) (deg$ value)))) - [_ (#RealS value)] + [_ (#Real value)] (return (form$ (list (tag$ ["lux" "RealA"]) (real$ value)))) - [_ (#CharS value)] + [_ (#Char value)] (return (form$ (list (tag$ ["lux" "CharA"]) (char$ value)))) - [_ (#TextS value)] + [_ (#Text value)] (return (form$ (list (tag$ ["lux" "TextA"]) (text$ value)))) - [_ (#TagS [prefix name])] + [_ (#Tag [prefix name])] (return (form$ (list (tag$ ["lux" "IdentA"]) (tuple$ (list (text$ prefix) (text$ name)))))) - (^or [_ (#FormS _)] [_ (#SymbolS _)]) + (^or [_ (#Form _)] [_ (#Symbol _)]) (return ast) - [_ (#TupleS xs)] + [_ (#Tuple xs)] (do Monad<Lux> [=xs (mapM Monad<Lux> process-def-meta-value xs)] (wrap (form$ (list (tag$ ["lux" "ListA"]) (untemplate-list =xs))))) - [_ (#RecordS kvs)] + [_ (#Record kvs)] (do Monad<Lux> [=xs (mapM Monad<Lux> (: (-> [AST AST] (Lux AST)) (function [[k v]] (case k - [_ (#TextS =k)] + [_ (#Text =k)] (do Monad<Lux> [=v (process-def-meta-value v)] (wrap (tuple$ (list (text$ =k) =v)))) @@ -3003,13 +3003,13 @@ (def:' (process-def-meta ast) (-> AST (Lux AST)) (case ast - [_ (#RecordS kvs)] + [_ (#Record kvs)] (do Monad<Lux> [=kvs (mapM Monad<Lux> (: (-> [AST AST] (Lux AST)) (function [[k v]] (case k - [_ (#TagS [pk nk])] + [_ (#Tag [pk nk])] (do Monad<Lux> [=v (process-def-meta-value v)] (wrap (tuple$ (list (tuple$ (list (text$ pk) (text$ nk))) @@ -3052,10 +3052,10 @@ (def:' (export-level^ tokens) (-> (List AST) [(Maybe Export-Level) (List AST)]) (case tokens - (#Cons [_ (#TagS [_ "export"])] tokens') + (#Cons [_ (#Tag [_ "export"])] tokens') [(#;Some (#;Left [])) tokens'] - (#Cons [_ (#TagS [_ "hidden"])] tokens') + (#Cons [_ (#Tag [_ "hidden"])] tokens') [(#;Some (#;Right [])) tokens'] _ @@ -3086,25 +3086,25 @@ (let [[export? tokens'] (export-level^ tokens) parts (: (Maybe [AST (List AST) (Maybe AST) AST AST]) (case tokens' - (^ (list [_ (#FormS (#Cons name args))] meta type body)) + (^ (list [_ (#Form (#Cons name args))] meta type body)) (#Some [name args (#Some type) body meta]) (^ (list name meta type body)) (#Some [name #Nil (#Some type) body meta]) - (^ (list [_ (#FormS (#Cons name args))] [_ (#RecordS meta-kvs)] body)) + (^ (list [_ (#Form (#Cons name args))] [_ (#Record meta-kvs)] body)) (#Some [name args #None body (record$ meta-kvs)]) - (^ (list name [_ (#RecordS meta-kvs)] body)) + (^ (list name [_ (#Record meta-kvs)] body)) (#Some [name #Nil #None body (record$ meta-kvs)]) - (^ (list [_ (#FormS (#Cons name args))] type body)) + (^ (list [_ (#Form (#Cons name args))] type body)) (#Some [name args (#Some type) body (' {})]) (^ (list name type body)) (#Some [name #Nil (#Some type) body (' {})]) - (^ (list [_ (#FormS (#Cons name args))] body)) + (^ (list [_ (#Form (#Cons name args))] body)) (#Some [name args #None body (' {})]) (^ (list name body)) @@ -3148,8 +3148,8 @@ (def: (meta-ast-add addition meta) (-> [AST AST] AST AST) (case [addition meta] - [[name value] [cursor (#;RecordS pairs)]] - [cursor (#;RecordS (#;Cons [name value] pairs))] + [[name value] [cursor (#;Record pairs)]] + [cursor (#;Record (#;Cons [name value] pairs))] _ meta)) @@ -3157,7 +3157,7 @@ (def: (meta-ast-merge addition base) (-> AST AST AST) (case addition - [cursor (#;RecordS pairs)] + [cursor (#;Record pairs)] (fold meta-ast-add base pairs) _ @@ -3171,24 +3171,24 @@ (^template [<tag>] (^ (list [_ (<tag> [prefix name])])) (return (list (` [(~ (text$ prefix)) (~ (text$ name))])))) - ([#;SymbolS] [#;TagS]) + ([#;Symbol] [#;Tag]) _ (fail \"Wrong syntax for ident-for\")))")]) (let [[exported? tokens] (export-level^ tokens) name+args+meta+body?? (: (Maybe [Ident (List AST) AST AST]) (case tokens - (^ (list [_ (#;FormS (list& [_ (#SymbolS name)] args))] body)) + (^ (list [_ (#;Form (list& [_ (#Symbol name)] args))] body)) (#Some [name args (` {}) body]) - (^ (list [_ (#;SymbolS name)] body)) + (^ (list [_ (#;Symbol name)] body)) (#Some [name #Nil (` {}) body]) - (^ (list [_ (#;FormS (list& [_ (#SymbolS name)] args))] [meta-rec-cursor (#;RecordS meta-rec-parts)] body)) - (#Some [name args [meta-rec-cursor (#;RecordS meta-rec-parts)] body]) + (^ (list [_ (#;Form (list& [_ (#Symbol name)] args))] [meta-rec-cursor (#;Record meta-rec-parts)] body)) + (#Some [name args [meta-rec-cursor (#;Record meta-rec-parts)] body]) - (^ (list [_ (#;SymbolS name)] [meta-rec-cursor (#;RecordS meta-rec-parts)] body)) - (#Some [name #Nil [meta-rec-cursor (#;RecordS meta-rec-parts)] body]) + (^ (list [_ (#;Symbol name)] [meta-rec-cursor (#;Record meta-rec-parts)] body)) + (#Some [name #Nil [meta-rec-cursor (#;Record meta-rec-parts)] body]) _ #None))] @@ -3226,16 +3226,16 @@ (let [[exported? tokens'] (export-level^ tokens) ?parts (: (Maybe [Ident (List AST) AST (List AST)]) (case tokens' - (^ (list& [_ (#FormS (list& [_ (#SymbolS name)] args))] [meta-rec-cursor (#;RecordS meta-rec-parts)] sigs)) - (#Some name args [meta-rec-cursor (#;RecordS meta-rec-parts)] sigs) + (^ (list& [_ (#Form (list& [_ (#Symbol name)] args))] [meta-rec-cursor (#;Record meta-rec-parts)] sigs)) + (#Some name args [meta-rec-cursor (#;Record meta-rec-parts)] sigs) - (^ (list& [_ (#SymbolS name)] [meta-rec-cursor (#;RecordS meta-rec-parts)] sigs)) - (#Some name #Nil [meta-rec-cursor (#;RecordS meta-rec-parts)] sigs) + (^ (list& [_ (#Symbol name)] [meta-rec-cursor (#;Record meta-rec-parts)] sigs)) + (#Some name #Nil [meta-rec-cursor (#;Record meta-rec-parts)] sigs) - (^ (list& [_ (#FormS (list& [_ (#SymbolS name)] args))] sigs)) + (^ (list& [_ (#Form (list& [_ (#Symbol name)] args))] sigs)) (#Some name args (` {}) sigs) - (^ (list& [_ (#SymbolS name)] sigs)) + (^ (list& [_ (#Symbol name)] sigs)) (#Some name #Nil (` {}) sigs) _ @@ -3250,7 +3250,7 @@ (: (-> AST (Lux [Text AST])) (function [token] (case token - (^ [_ (#FormS (list [_ (#SymbolS _ "_lux_:")] type [_ (#SymbolS ["" name])]))]) + (^ [_ (#Form (list [_ (#Symbol _ "_lux_:")] type [_ (#Symbol ["" name])]))]) (wrap [name type]) _ @@ -3321,7 +3321,7 @@ (default 20 #;None) => 20"} (case tokens (^ (list else maybe)) - (let [g!temp (: AST [_cursor (#;SymbolS ["" ""])]) + (let [g!temp (: AST [_cursor (#;Symbol ["" ""])]) code (` (case (~ maybe) (#;Some (~ g!temp)) (~ g!temp) @@ -3586,7 +3586,7 @@ (: (-> AST (Lux [AST AST])) (function [token] (case token - (^ [_ (#FormS (list [_ (#SymbolS _ "_lux_def")] [_ (#SymbolS "" tag-name)] value meta))]) + (^ [_ (#Form (list [_ (#Symbol _ "_lux_def")] [_ (#Symbol "" tag-name)] value meta))]) (case (get tag-name tag-mappings) (#Some tag) (wrap [tag value]) @@ -3620,13 +3620,13 @@ (let [[exported? tokens'] (export-level^ tokens) ?parts (: (Maybe [AST (List AST) AST AST (List AST)]) (case tokens' - (^ (list& [_ (#FormS (list& name args))] [meta-rec-cursor (#;RecordS meta-rec-parts)] type defs)) - (#Some name args type [meta-rec-cursor (#;RecordS meta-rec-parts)] defs) + (^ (list& [_ (#Form (list& name args))] [meta-rec-cursor (#;Record meta-rec-parts)] type defs)) + (#Some name args type [meta-rec-cursor (#;Record meta-rec-parts)] defs) - (^ (list& name [meta-rec-cursor (#;RecordS meta-rec-parts)] type defs)) - (#Some name #Nil type [meta-rec-cursor (#;RecordS meta-rec-parts)] defs) + (^ (list& name [meta-rec-cursor (#;Record meta-rec-parts)] type defs)) + (#Some name #Nil type [meta-rec-cursor (#;Record meta-rec-parts)] defs) - (^ (list& [_ (#FormS (list& name args))] type defs)) + (^ (list& [_ (#Form (list& name args))] type defs)) (#Some name args type (` {}) defs) (^ (list& name type defs)) @@ -3637,14 +3637,14 @@ (case ?parts (#Some [name args type meta defs]) (case (case name - [_ (#;SymbolS ["" "_"])] + [_ (#;Symbol ["" "_"])] (case type - (^ [_ (#;FormS (list& [_ (#;SymbolS [_ sig-name])] sig-args))]) + (^ [_ (#;Form (list& [_ (#;Symbol [_ sig-name])] sig-args))]) (case (: (Maybe (List Text)) (mapM Monad<Maybe> (function [sa] (case sa - [_ (#;SymbolS [_ arg-name])] + [_ (#;Symbol [_ arg-name])] (#;Some arg-name) _ @@ -3711,29 +3711,29 @@ (#Cons a (List a)))"} (let [[exported? tokens'] (export-level^ tokens) [rec? tokens'] (case tokens' - (#Cons [_ (#TagS [_ "rec"])] tokens') + (#Cons [_ (#Tag [_ "rec"])] tokens') [true tokens'] _ [false tokens']) parts (: (Maybe [Text (List AST) AST (List AST)]) (case tokens' - (^ (list [_ (#SymbolS "" name)] [meta-cursor (#;RecordS meta-parts)] [type-cursor (#;RecordS type-parts)])) - (#Some [name #Nil [meta-cursor (#;RecordS meta-parts)] (list [type-cursor (#;RecordS type-parts)])]) + (^ (list [_ (#Symbol "" name)] [meta-cursor (#;Record meta-parts)] [type-cursor (#;Record type-parts)])) + (#Some [name #Nil [meta-cursor (#;Record meta-parts)] (list [type-cursor (#;Record type-parts)])]) - (^ (list& [_ (#SymbolS "" name)] [meta-cursor (#;RecordS meta-parts)] type-ast1 type-asts)) - (#Some [name #Nil [meta-cursor (#;RecordS meta-parts)] (#;Cons type-ast1 type-asts)]) + (^ (list& [_ (#Symbol "" name)] [meta-cursor (#;Record meta-parts)] type-ast1 type-asts)) + (#Some [name #Nil [meta-cursor (#;Record meta-parts)] (#;Cons type-ast1 type-asts)]) - (^ (list& [_ (#SymbolS "" name)] type-asts)) + (^ (list& [_ (#Symbol "" name)] type-asts)) (#Some [name #Nil (` {}) type-asts]) - (^ (list [_ (#FormS (#Cons [_ (#SymbolS "" name)] args))] [meta-cursor (#;RecordS meta-parts)] [type-cursor (#;RecordS type-parts)])) - (#Some [name args [meta-cursor (#;RecordS meta-parts)] (list [type-cursor (#;RecordS type-parts)])]) + (^ (list [_ (#Form (#Cons [_ (#Symbol "" name)] args))] [meta-cursor (#;Record meta-parts)] [type-cursor (#;Record type-parts)])) + (#Some [name args [meta-cursor (#;Record meta-parts)] (list [type-cursor (#;Record type-parts)])]) - (^ (list& [_ (#FormS (#Cons [_ (#SymbolS "" name)] args))] [meta-cursor (#;RecordS meta-parts)] type-ast1 type-asts)) - (#Some [name args [meta-cursor (#;RecordS meta-parts)] (#;Cons type-ast1 type-asts)]) + (^ (list& [_ (#Form (#Cons [_ (#Symbol "" name)] args))] [meta-cursor (#;Record meta-parts)] type-ast1 type-asts)) + (#Some [name args [meta-cursor (#;Record meta-parts)] (#;Cons type-ast1 type-asts)]) - (^ (list& [_ (#FormS (#Cons [_ (#SymbolS "" name)] args))] type-asts)) + (^ (list& [_ (#Form (#Cons [_ (#Symbol "" name)] args))] type-asts)) (#Some [name args (` {}) type-asts]) _ @@ -3815,7 +3815,7 @@ (: (-> AST (Lux Text)) (function [def] (case def - [_ (#SymbolS ["" name])] + [_ (#Symbol ["" name])] (return name) _ @@ -3825,7 +3825,7 @@ (def: (parse-alias tokens) (-> (List AST) (Lux [(Maybe Text) (List AST)])) (case tokens - (^ (list& [_ (#TagS "" "as")] [_ (#SymbolS "" alias)] tokens')) + (^ (list& [_ (#Tag "" "as")] [_ (#Symbol "" alias)] tokens')) (return [(#Some alias) tokens']) _ @@ -3834,17 +3834,17 @@ (def: (parse-referrals tokens) (-> (List AST) (Lux [Referrals (List AST)])) (case tokens - (^ (list& [_ (#TagS ["" "refer"])] referral tokens')) + (^ (list& [_ (#Tag ["" "refer"])] referral tokens')) (case referral - [_ (#TagS "" "all")] + [_ (#Tag "" "all")] (return [#All tokens']) - (^ [_ (#FormS (list& [_ (#TagS ["" "only"])] defs))]) + (^ [_ (#Form (list& [_ (#Tag ["" "only"])] defs))]) (do Monad<Lux> [defs' (extract-defs defs)] (return [(#Only defs') tokens'])) - (^ [_ (#FormS (list& [_ (#TagS ["" "exclude"])] defs))]) + (^ [_ (#Form (list& [_ (#Tag ["" "exclude"])] defs))]) (do Monad<Lux> [defs' (extract-defs defs)] (return [(#Exclude defs') tokens'])) @@ -3876,19 +3876,19 @@ (def: (parse-short-referrals tokens) (-> (List AST) (Lux [Referrals (List AST)])) (case tokens - (^ (list& [_ (#TagS "" "+")] tokens')) + (^ (list& [_ (#Tag "" "+")] tokens')) (let [[defs tokens'] (split-with symbol? tokens')] (do Monad<Lux> [defs' (extract-defs defs)] (return [(#Only defs') tokens']))) - (^ (list& [_ (#TagS "" "-")] tokens')) + (^ (list& [_ (#Tag "" "-")] tokens')) (let [[defs tokens'] (split-with symbol? tokens')] (do Monad<Lux> [defs' (extract-defs defs)] (return [(#Exclude defs') tokens']))) - (^ (list& [_ (#TagS "" "*")] tokens')) + (^ (list& [_ (#Tag "" "*")] tokens')) (return [#All tokens']) _ @@ -3897,7 +3897,7 @@ (def: (extract-symbol syntax) (-> AST (Lux Ident)) (case syntax - [_ (#SymbolS ident)] + [_ (#Symbol ident)] (return ident) _ @@ -3906,12 +3906,12 @@ (def: (parse-openings tokens) (-> (List AST) (Lux [(List Openings) (List AST)])) (case tokens - (^ (list& [_ (#TagS "" "open")] [_ (#FormS parts)] tokens')) + (^ (list& [_ (#Tag "" "open")] [_ (#Form parts)] tokens')) (if (|> parts (map (: (-> AST Bool) (function [part] (case part - (^or [_ (#TextS _)] [_ (#SymbolS _)]) + (^or [_ (#Text _)] [_ (#Symbol _)]) true _ @@ -3920,10 +3920,10 @@ (let [openings (fold (: (-> AST (List Openings) (List Openings)) (function [part openings] (case part - [_ (#TextS prefix)] + [_ (#Text prefix)] (list& [prefix (list)] openings) - [_ (#SymbolS struct-name)] + [_ (#Symbol struct-name)] (case openings #Nil (list ["" (list struct-name)]) @@ -3947,7 +3947,7 @@ (map (: (-> AST Bool) (function [part] (case part - (^or [_ (#TextS _)] [_ (#SymbolS _)]) + (^or [_ (#Text _)] [_ (#Symbol _)]) true _ @@ -3956,10 +3956,10 @@ (let [openings (fold (: (-> AST (List Openings) (List Openings)) (function [part openings] (case part - [_ (#TextS prefix)] + [_ (#Text prefix)] (list& [prefix (list)] openings) - [_ (#SymbolS struct-name)] + [_ (#Symbol struct-name)] (case openings #Nil (list ["" (list struct-name)]) @@ -4020,13 +4020,13 @@ (: (-> AST (Lux (List Importation))) (function [token] (case token - [_ (#SymbolS "" m-name)] + [_ (#Symbol "" m-name)] (do Monad<Lux> [m-name (clean-module m-name)] (wrap (list [m-name #None {#refer-defs #All #refer-open (list)}]))) - (^ [_ (#FormS (list& [_ (#SymbolS "" m-name)] extra))]) + (^ [_ (#Form (list& [_ (#Symbol "" m-name)] extra))]) (do Monad<Lux> [m-name (clean-module m-name) alias+extra (parse-alias extra) @@ -4045,7 +4045,7 @@ #refer-open openings}} sub-imports)))) - (^ [_ (#TupleS (list& [_ (#TextS alias)] [_ (#SymbolS "" m-name)] extra))]) + (^ [_ (#Tuple (list& [_ (#Text alias)] [_ (#Symbol "" m-name)] extra))]) (do Monad<Lux> [m-name (clean-module m-name) referral+extra (parse-short-referrals extra) @@ -4057,7 +4057,7 @@ #import-refer {#refer-defs referral #refer-open openings}}))) - (^ [_ (#TupleS (list& [_ (#SymbolS "" m-name)] extra))]) + (^ [_ (#Tuple (list& [_ (#Symbol "" m-name)] extra))]) (do Monad<Lux> [m-name (clean-module m-name) referral+extra (parse-short-referrals extra) @@ -4296,7 +4296,7 @@ (macro: #hidden (^open' tokens) (case tokens - (^ (list [_ (#SymbolS name)] [_ (#TextS prefix)] body)) + (^ (list [_ (#Symbol name)] [_ (#Text prefix)] body)) (do Monad<Lux> [init-type (find-type name) struct-evidence (resolve-type-tags init-type)] @@ -4341,12 +4341,12 @@ (All [a] (-> (Enum a) a a (List a))) (range' <= succ from to))"} (case tokens - (^ (list& [_ (#FormS (list [_ (#TextS prefix)]))] body branches)) + (^ (list& [_ (#Form (list [_ (#Text prefix)]))] body branches)) (do Monad<Lux> [g!temp (gensym "temp")] (return (list& g!temp (` (^open' (~ g!temp) (~ (text$ prefix)) (~ body))) branches))) - (^ (list& [_ (#FormS (list))] body branches)) + (^ (list& [_ (#Form (list))] body branches)) (return (list& (` (;;^open "")) body branches)) _ @@ -4397,7 +4397,7 @@ (let [getter (get@ [#foo #bar #baz])] (getter my-record))"} (case tokens - (^ (list [_ (#TagS slot')] record)) + (^ (list [_ (#Tag slot')] record)) (do Monad<Lux> [slot (normalize slot') output (resolve-tag slot) @@ -4417,7 +4417,7 @@ _ (fail "get@ can only use records."))) - (^ (list [_ (#TupleS slots)] record)) + (^ (list [_ (#Tuple slots)] record)) (return (list (fold (: (-> AST AST AST) (function [slot inner] (` (;;get@ (~ slot) (~ inner))))) @@ -4460,11 +4460,11 @@ (def: i:* (:: Number<Int> *)) ..."} (case tokens - (^ (list& [_ (#SymbolS struct-name)] tokens')) + (^ (list& [_ (#Symbol struct-name)] tokens')) (do Monad<Lux> [@module current-module-name #let [prefix (case tokens' - (^ (list [_ (#TextS prefix)])) + (^ (list [_ (#Text prefix)])) prefix _ @@ -4594,7 +4594,7 @@ (macro: #hidden (refer tokens) (case tokens - (^ (list& [_ (#TextS module-name)] options)) + (^ (list& [_ (#Text module-name)] options)) (do Monad<Lux> [=refer (read-refer module-name options)] (write-refer module-name =refer)) @@ -4656,7 +4656,7 @@ (do Monad<Lux> [#let [[_meta _imports] (: [(List [AST AST]) (List AST)] (case tokens - (^ (list& [_ (#RecordS _meta)] _imports)) + (^ (list& [_ (#Record _meta)] _imports)) [_meta _imports] _ @@ -4682,10 +4682,10 @@ ## Also allows using that value as a function. (:: Codec<Text,Int> encode 123)"} (case tokens - (^ (list struct [_ (#SymbolS member)])) + (^ (list struct [_ (#Symbol member)])) (return (list (` (let [(^open) (~ struct)] (~ (symbol$ member)))))) - (^ (list& struct [_ (#SymbolS member)] args)) + (^ (list& struct [_ (#Symbol member)] args)) (return (list (` ((let [(^open) (~ struct)] (~ (symbol$ member))) (~@ args))))) _ @@ -4706,7 +4706,7 @@ (let [setter (set@ [#foo #bar #baz])] (setter value my-record))"} (case tokens - (^ (list [_ (#TagS slot')] value record)) + (^ (list [_ (#Tag slot')] value record)) (do Monad<Lux> [slot (normalize slot') output (resolve-tag slot) @@ -4736,7 +4736,7 @@ _ (fail "set@ can only use records."))) - (^ (list [_ (#TupleS slots)] value record)) + (^ (list [_ (#Tuple slots)] value record)) (case slots #;Nil (fail "Wrong syntax for set@") @@ -4792,7 +4792,7 @@ (let [updater (update@ [#foo #bar #baz])] (updater func my-record))"} (case tokens - (^ (list [_ (#TagS slot')] fun record)) + (^ (list [_ (#Tag slot')] fun record)) (do Monad<Lux> [slot (normalize slot') output (resolve-tag slot) @@ -4822,7 +4822,7 @@ _ (fail "update@ can only use records."))) - (^ (list [_ (#TupleS slots)] fun record)) + (^ (list [_ (#Tuple slots)] fun record)) (case slots #;Nil (fail "Wrong syntax for update@") @@ -4886,8 +4886,8 @@ type ))"} (case tokens - (^ (list& [_ (#FormS (list& [_ (#TupleS bindings)] templates))] - [_ (#FormS data)] + (^ (list& [_ (#Form (list& [_ (#Tuple bindings)] templates))] + [_ (#Form data)] branches)) (case (: (Maybe (List AST)) (do Monad<Maybe> @@ -4924,23 +4924,23 @@ (^template [<tag>] [[_ _ column] (<tag> _)] column) - ([#BoolS] - [#NatS] - [#IntS] - [#DegS] - [#RealS] - [#CharS] - [#TextS] - [#SymbolS] - [#TagS]) + ([#Bool] + [#Nat] + [#Int] + [#Deg] + [#Real] + [#Char] + [#Text] + [#Symbol] + [#Tag]) (^template [<tag>] [[_ _ column] (<tag> parts)] (fold n.min column (map find-baseline-column parts))) - ([#FormS] - [#TupleS]) + ([#Form] + [#Tuple]) - [[_ _ column] (#RecordS pairs)] + [[_ _ column] (#Record pairs)] (fold n.min column (List/append (map (. find-baseline-column first) pairs) (map (. find-baseline-column second) pairs))) @@ -4953,7 +4953,7 @@ (def: (identify-doc-fragment ast) (-> AST Doc-Fragment) (case ast - [_ (#;TextS comment)] + [_ (#;Text comment)] (#Doc-Comment comment) _ @@ -5043,15 +5043,15 @@ [(update-cursor new-cursor as-text) (Text/append (cursor-padding baseline prev-cursor new-cursor) as-text)])) - ([#BoolS Bool/encode] - [#NatS Nat/encode] - [#IntS Int/encode] - [#DegS Deg/encode] - [#RealS Real/encode] - [#CharS Char/encode] - [#TextS Text/encode] - [#SymbolS Ident/encode] - [#TagS Tag/encode]) + ([#Bool Bool/encode] + [#Nat Nat/encode] + [#Int Int/encode] + [#Deg Deg/encode] + [#Real Real/encode] + [#Char Char/encode] + [#Text Text/encode] + [#Symbol Ident/encode] + [#Tag Tag/encode]) (^template [<tag> <open> <close> <prep>] [group-cursor (<tag> parts)] @@ -5065,9 +5065,9 @@ <open> parts-text <close>)])) - ([#FormS "(" ")" id] - [#TupleS "[" "]" id] - [#RecordS "{" "}" rejoin-all-pairs]) + ([#Form "(" ")" id] + [#Tuple "[" "]" id] + [#Record "{" "}" rejoin-all-pairs]) )) (def: (with-baseline baseline [file line column]) @@ -5173,7 +5173,7 @@ (recur (i.inc count) (f x)) x)))} (case tokens - (^ (list [_ (#TupleS bindings)] body)) + (^ (list [_ (#Tuple bindings)] body)) (let [pairs (as-pairs bindings) vars (map first pairs) inits (map second pairs)] @@ -5208,7 +5208,7 @@ (let [(^slots [#foo #bar #baz]) quux] (f foo bar baz)))} (case tokens - (^ (list& [_ (#FormS (list [_ (#TupleS (list& hslot' tslots'))]))] body branches)) + (^ (list& [_ (#Form (list [_ (#Tuple (list& hslot' tslots'))]))] body branches)) (do Monad<Lux> [slots (: (Lux [Ident (List Ident)]) (case (: (Maybe [Ident (List Ident)]) @@ -5245,10 +5245,10 @@ (def: (place-tokens label tokens target) (-> Text (List AST) AST (Maybe (List AST))) (case target - (^or [_ (#BoolS _)] [_ (#NatS _)] [_ (#IntS _)] [_ (#DegS _)] [_ (#RealS _)] [_ (#CharS _)] [_ (#TextS _)] [_ (#TagS _)]) + (^or [_ (#Bool _)] [_ (#Nat _)] [_ (#Int _)] [_ (#Deg _)] [_ (#Real _)] [_ (#Char _)] [_ (#Text _)] [_ (#Tag _)]) (#Some (list target)) - [_ (#SymbolS [prefix name])] + [_ (#Symbol [prefix name])] (if (and (Text/= "" prefix) (Text/= label name)) (#Some tokens) @@ -5259,10 +5259,10 @@ (do Monad<Maybe> [placements (mapM Monad<Maybe> (place-tokens label tokens) elems)] (wrap (list (<ctor> (List/join placements)))))) - ([#TupleS tuple$] - [#FormS form$]) + ([#Tuple tuple$] + [#Form form$]) - [_ (#RecordS pairs)] + [_ (#Record pairs)] (do Monad<Maybe> [=pairs (mapM Monad<Maybe> (: (-> [AST AST] (Maybe [AST AST])) @@ -5290,25 +5290,25 @@ (compare <text> (:: AST/encode show <expr>)) (compare true (:: Eq<AST> = <expr> <expr>))] - [(bool true) "true" [_ (#;BoolS true)]] - [(bool false) "false" [_ (#;BoolS false)]] - [(int 123) "123" [_ (#;IntS 123)]] - [(real 123.0) "123.0" [_ (#;RealS 123.0)]] - [(char #"\n") "#\"\\n\"" [_ (#;CharS #"\n")]] - [(text "\n") "\"\\n\"" [_ (#;TextS "\n")]] - [(tag ["yolo" "lol"]) "#yolo;lol" [_ (#;TagS ["yolo" "lol"])]] - [(symbol ["yolo" "lol"]) "yolo;lol" [_ (#;SymbolS ["yolo" "lol"])]] - [(form (list (bool true) (int 123))) "(true 123)" (^ [_ (#;FormS (list [_ (#;BoolS true)] [_ (#;IntS 123)]))])] - [(tuple (list (bool true) (int 123))) "[true 123]" (^ [_ (#;TupleS (list [_ (#;BoolS true)] [_ (#;IntS 123)]))])] - [(record (list [(bool true) (int 123)])) "{true 123}" (^ [_ (#;RecordS (list [[_ (#;BoolS true)] [_ (#;IntS 123)]]))])] - [(local-tag "lol") "#lol" [_ (#;TagS ["" "lol"])]] - [(local-symbol "lol") "lol" [_ (#;SymbolS ["" "lol"])]] + [(bool true) "true" [_ (#;Bool true)]] + [(bool false) "false" [_ (#;Bool false)]] + [(int 123) "123" [_ (#;Int 123)]] + [(real 123.0) "123.0" [_ (#;Real 123.0)]] + [(char #"\n") "#\"\\n\"" [_ (#;Char #"\n")]] + [(text "\n") "\"\\n\"" [_ (#;Text "\n")]] + [(tag ["yolo" "lol"]) "#yolo;lol" [_ (#;Tag ["yolo" "lol"])]] + [(symbol ["yolo" "lol"]) "yolo;lol" [_ (#;Symbol ["yolo" "lol"])]] + [(form (list (bool true) (int 123))) "(true 123)" (^ [_ (#;Form (list [_ (#;Bool true)] [_ (#;Int 123)]))])] + [(tuple (list (bool true) (int 123))) "[true 123]" (^ [_ (#;Tuple (list [_ (#;Bool true)] [_ (#;Int 123)]))])] + [(record (list [(bool true) (int 123)])) "{true 123}" (^ [_ (#;Record (list [[_ (#;Bool true)] [_ (#;Int 123)]]))])] + [(local-tag "lol") "#lol" [_ (#;Tag ["" "lol"])]] + [(local-symbol "lol") "lol" [_ (#;Symbol ["" "lol"])]] )] (test-all <tests>))))} (case tokens - (^ (list& [_ (#TupleS bindings)] bodies)) + (^ (list& [_ (#Tuple bindings)] bodies)) (case bindings - (^ (list& [_ (#SymbolS ["" var-name])] macro-expr bindings')) + (^ (list& [_ (#Symbol ["" var-name])] macro-expr bindings')) (do Monad<Lux> [expansion (macro-expand-once macro-expr)] (case (place-tokens var-name expansion (` (;let% [(~@ bindings')] (~@ bodies)))) @@ -5370,7 +5370,7 @@ (def: (anti-quote token) (-> AST (Lux AST)) (case token - [_ (#SymbolS [def-prefix def-name])] + [_ (#Symbol [def-prefix def-name])] (if (Text/= "" def-prefix) (:: Monad<Lux> return token) (anti-quote-def [def-prefix def-name])) @@ -5380,10 +5380,10 @@ (do Monad<Lux> [=parts (mapM Monad<Lux> anti-quote parts)] (wrap [meta (<tag> =parts)]))) - ([#FormS] - [#TupleS]) + ([#Form] + [#Tuple]) - [meta (#RecordS pairs)] + [meta (#Record pairs)] (do Monad<Lux> [=pairs (mapM Monad<Lux> (: (-> [AST AST] (Lux [AST AST])) @@ -5392,7 +5392,7 @@ [=value (anti-quote value)] (wrap [slot =value])))) pairs)] - (wrap [meta (#RecordS =pairs)])) + (wrap [meta (#Record =pairs)])) _ (:: Monad<Lux> return token) @@ -5410,7 +5410,7 @@ _ false)))} (case tokens - (^ (list& [_ (#FormS (list pattern))] body branches)) + (^ (list& [_ (#Form (list pattern))] body branches)) (do Monad<Lux> [module-name current-module-name pattern+ (macro-expand-all pattern)] @@ -5432,7 +5432,7 @@ (def: (case-level^ level) (-> AST (Lux [AST AST])) (case level - (^ [_ (#;TupleS (list expr binding))]) + (^ [_ (#;Tuple (list expr binding))]) (return [expr binding]) _ @@ -5483,7 +5483,7 @@ _ (#;Left (format "Static part " (%t static) " does not match URI: " uri))))} (case tokens - (^ (list& [_meta (#;FormS levels)] body next-branches)) + (^ (list& [_meta (#;Form levels)] body next-branches)) (do Monad<Lux> [mlc (multi-level-case^ levels) expected get-expected-type @@ -5515,7 +5515,7 @@ (^template [<tag>] (^ (list [_ (<tag> [prefix name])])) (return (list (` [(~ (text$ prefix)) (~ (text$ name))])))) - ([#;SymbolS] [#;TagS]) + ([#;Symbol] [#;Tag]) _ (fail "Wrong syntax for ident-for"))) @@ -5563,7 +5563,7 @@ empty) list)))} (case tokens - (^ (list [_ (#NatS idx)])) + (^ (list [_ (#Nat idx)])) (do Monad<Lux> [stvs get-scope-type-vars] (case (list-at idx (reverse stvs)) @@ -5594,7 +5594,7 @@ +0 (to-list set))))} (case tokens - (^ (list& [_meta (#;FormS (list [_ (#;SymbolS ["" name])] pattern))] body branches)) + (^ (list& [_meta (#;Form (list [_ (#;Symbol ["" name])] pattern))] body branches)) (let [g!whole (symbol$ ["" name])] (return (list& g!whole (` (case (~ g!whole) (~ pattern) (~ body))) @@ -5609,7 +5609,7 @@ (^|> value [n.inc (n.% +10) (n.max +1)]) (foo value)))} (case tokens - (^ (list& [_meta (#;FormS (list [_ (#;SymbolS ["" name])] [_ (#;TupleS steps)]))] body branches)) + (^ (list& [_meta (#;Form (list [_ (#;Symbol ["" name])] [_ (#;Tuple steps)]))] body branches)) (let [g!name (symbol$ ["" name])] (return (list& g!name (` (let [(~ g!name) (|> (~ g!name) (~@ steps))] @@ -5652,7 +5652,7 @@ "==" Int)} (case tokens - (^ (list [_ (#;SymbolS var-name)])) + (^ (list [_ (#;Symbol var-name)])) (do Monad<Lux> [var-type (find-type var-name)] (wrap (list (type-to-ast var-type)))) @@ -5667,10 +5667,10 @@ (def: (parse-export-level tokens) (-> (List AST) (Lux [(Maybe Export-Level') (List AST)])) (case tokens - (^ (list& [_ (#TagS ["" "export"])] tokens')) + (^ (list& [_ (#Tag ["" "export"])] tokens')) (:: Monad<Lux> wrap [(#;Some #Export) tokens']) - (^ (list& [_ (#TagS ["" "hidden"])] tokens')) + (^ (list& [_ (#Tag ["" "hidden"])] tokens')) (:: Monad<Lux> wrap [(#;Some #Hidden) tokens']) _ @@ -5693,12 +5693,12 @@ (def: (parse-complex-declaration tokens) (-> (List AST) (Lux [[Text (List Text)] (List AST)])) (case tokens - (^ (list& [_ (#FormS (list& [_ (#SymbolS ["" name])] args'))] tokens')) + (^ (list& [_ (#Form (list& [_ (#Symbol ["" name])] args'))] tokens')) (do Monad<Lux> [args (mapM Monad<Lux> (function [arg'] (case arg' - [_ (#SymbolS ["" arg-name])] + [_ (#Symbol ["" arg-name])] (wrap arg-name) _ @@ -5733,7 +5733,7 @@ (def: (parse-anns tokens) (-> (List AST) (Lux [AST (List AST)])) (case tokens - (^ (list& [_ (#RecordS _anns)] tokens')) + (^ (list& [_ (#Record _anns)] tokens')) (:: Monad<Lux> wrap [(record$ _anns) tokens']) _ diff --git a/stdlib/source/lux/control/comonad.lux b/stdlib/source/lux/control/comonad.lux index abf281a0a..12e16655e 100644 --- a/stdlib/source/lux/control/comonad.lux +++ b/stdlib/source/lux/control/comonad.lux @@ -32,14 +32,14 @@ [inputs (iterate i.inc 2)] (square (head inputs)))))} (case tokens - (#;Cons comonad (#;Cons [_ (#;TupleS bindings)] (#;Cons body #;Nil))) - (let [g!map (: AST [_cursor (#;SymbolS ["" " map "])]) - g!split (: AST [_cursor (#;SymbolS ["" " split "])]) + (#;Cons comonad (#;Cons [_ (#;Tuple bindings)] (#;Cons body #;Nil))) + (let [g!map (: AST [_cursor (#;Symbol ["" " map "])]) + g!split (: AST [_cursor (#;Symbol ["" " split "])]) body' (fold (: (-> [AST AST] AST AST) (function [binding body'] (let [[var value] binding] (case var - [_ (#;TagS ["" "let"])] + [_ (#;Tag ["" "let"])] (` (let (~ value) (~ body'))) _ diff --git a/stdlib/source/lux/control/monad.lux b/stdlib/source/lux/control/monad.lux index 22be3fcd5..0fce26db0 100644 --- a/stdlib/source/lux/control/monad.lux +++ b/stdlib/source/lux/control/monad.lux @@ -58,15 +58,15 @@ z (f2 z)] (wrap (f3 z))))} (case tokens - (#;Cons monad (#;Cons [_ (#;TupleS bindings)] (#;Cons body #;Nil))) - (let [g!map (: AST [_cursor (#;SymbolS ["" " map "])]) - g!join (: AST [_cursor (#;SymbolS ["" " join "])]) - g!apply (: AST [_cursor (#;SymbolS ["" " apply "])]) + (#;Cons monad (#;Cons [_ (#;Tuple bindings)] (#;Cons body #;Nil))) + (let [g!map (: AST [_cursor (#;Symbol ["" " map "])]) + g!join (: AST [_cursor (#;Symbol ["" " join "])]) + g!apply (: AST [_cursor (#;Symbol ["" " apply "])]) body' (fold (: (-> [AST AST] AST AST) (function [binding body'] (let [[var value] binding] (case var - [_ (#;TagS ["" "let"])] + [_ (#;Tag ["" "let"])] (` (let (~ value) (~ body'))) _ diff --git a/stdlib/source/lux/data/coll/list.lux b/stdlib/source/lux/data/coll/list.lux index 2aeb621d3..e4add4dec 100644 --- a/stdlib/source/lux/data/coll/list.lux +++ b/stdlib/source/lux/data/coll/list.lux @@ -334,7 +334,7 @@ ## [Syntax] (def: (symbol$ name) (-> Text AST) - [["" +0 +0] (#;SymbolS "" name)]) + [["" +0 +0] (#;Symbol "" name)]) (macro: #export (zip tokens state) {#;doc (doc "Create list zippers with the specified number of input lists." @@ -342,7 +342,7 @@ (def: #export zip3 (zip 3)) ((zip 3) xs ys zs))} (case tokens - (^ (list [_ (#;IntS num-lists)])) + (^ (list [_ (#;Int num-lists)])) (if (i.> 0 num-lists) (let [(^open) Functor<List> indices (i.range 0 (i.dec num-lists)) @@ -385,7 +385,7 @@ (def: #export zip3-with (zip-with 3)) ((zip-with 2) i.+ xs ys))} (case tokens - (^ (list [_ (#;IntS num-lists)])) + (^ (list [_ (#;Int num-lists)])) (if (i.> 0 num-lists) (let [(^open) Functor<List> indices (i.range 0 (i.dec num-lists)) diff --git a/stdlib/source/lux/data/format/json.lux b/stdlib/source/lux/data/format/json.lux index 41e5bfe5c..41654d93d 100644 --- a/stdlib/source/lux/data/format/json.lux +++ b/stdlib/source/lux/data/format/json.lux @@ -77,23 +77,23 @@ (^template [<ast-tag> <ctor> <json-tag>] [_ (<ast-tag> value)] (wrap (list (` (: JSON (<json-tag> (~ (<ctor> value)))))))) - ([#;BoolS ast;bool #Boolean] - [#;IntS (|>. int-to-real ast;real) #Number] - [#;RealS ast;real #Number] - [#;TextS ast;text #String]) + ([#;Bool ast;bool #Boolean] + [#;Int (|>. int-to-real ast;real) #Number] + [#;Real ast;real #Number] + [#;Text ast;text #String]) - [_ (#;TagS ["" "null"])] + [_ (#;Tag ["" "null"])] (wrap (list (` (: JSON #Null)))) - [_ (#;TupleS members)] + [_ (#;Tuple members)] (wrap (list (` (: JSON (#Array (vector (~@ (List/map wrapper members)))))))) - [_ (#;RecordS pairs)] + [_ (#;Record pairs)] (do Monad<Lux> [pairs' (mapM @ (function [[slot value]] (case slot - [_ (#;TextS key-name)] + [_ (#;Text key-name)] (wrap (` [(~ (ast;text key-name)) (~ (wrapper value))])) _ diff --git a/stdlib/source/lux/data/number.lux b/stdlib/source/lux/data/number.lux index cdc4d6035..0468a9f40 100644 --- a/stdlib/source/lux/data/number.lux +++ b/stdlib/source/lux/data/number.lux @@ -554,22 +554,22 @@ [(macro: #export (<macro> tokens state) {#;doc <doc>} (case tokens - (#;Cons [meta (#;TextS repr)] #;Nil) + (#;Cons [meta (#;Text repr)] #;Nil) (case (:: <nat> decode repr) (#;Right value) - (#;Right [state (list [meta (#;NatS value)])]) + (#;Right [state (list [meta (#;Nat value)])]) (^=> (#;Left _) [(:: <int> decode repr) (#;Right value)]) - (#;Right [state (list [meta (#;IntS value)])]) + (#;Right [state (list [meta (#;Int value)])]) (^=> (#;Left _) [(:: <deg> decode repr) (#;Right value)]) - (#;Right [state (list [meta (#;DegS value)])]) + (#;Right [state (list [meta (#;Deg value)])]) (^=> (#;Left _) [(:: <real> decode repr) (#;Right value)]) - (#;Right [state (list [meta (#;RealS value)])]) + (#;Right [state (list [meta (#;Real value)])]) _ (#;Left <error>)) diff --git a/stdlib/source/lux/host.jvm.lux b/stdlib/source/lux/host.jvm.lux index 0552df165..5efeb05c5 100644 --- a/stdlib/source/lux/host.jvm.lux +++ b/stdlib/source/lux/host.jvm.lux @@ -557,14 +557,14 @@ (^template [<tag>] [meta (<tag> parts)] [meta (<tag> (map (pre-walk-replace f) parts))]) - ([#;FormS] - [#;TupleS]) + ([#;Form] + [#;Tuple]) - [meta (#;RecordS pairs)] - [meta (#;RecordS (map (: (-> [AST AST] [AST AST]) - (function [[key val]] - [(pre-walk-replace f key) (pre-walk-replace f val)])) - pairs))] + [meta (#;Record pairs)] + [meta (#;Record (map (: (-> [AST AST] [AST AST]) + (function [[key val]] + [(pre-walk-replace f key) (pre-walk-replace f val)])) + pairs))] ast' ast')) @@ -2026,7 +2026,7 @@ {#;doc (doc "Loads an element from an array." (array-load 10 my-array))} (case array - [_ (#;SymbolS array-name)] + [_ (#;Symbol array-name)] (do Monad<Lux> [array-type (macro;find-type array-name) array-jvm-type (type->class-name array-type)] @@ -2055,7 +2055,7 @@ {#;doc (doc "Stores an element into an array." (array-store 10 my-object my-array))} (case array - [_ (#;SymbolS array-name)] + [_ (#;Symbol array-name)] (do Monad<Lux> [array-type (macro;find-type array-name) array-jvm-type (type->class-name array-type)] diff --git a/stdlib/source/lux/io.lux b/stdlib/source/lux/io.lux index d538fbfef..00f16afce 100644 --- a/stdlib/source/lux/io.lux +++ b/stdlib/source/lux/io.lux @@ -19,7 +19,7 @@ "Some value...")))} (case tokens (^ (list value)) - (let [blank (: AST [["" +0 +0] (#;SymbolS ["" ""])])] + (let [blank (: AST [["" +0 +0] (#;Symbol ["" ""])])] (#;Right [state (list (` (;_lux_function (~ blank) (~ blank) (~ value))))])) _ diff --git a/stdlib/source/lux/macro.lux b/stdlib/source/lux/macro.lux index 9965a0677..5ac4a524e 100644 --- a/stdlib/source/lux/macro.lux +++ b/stdlib/source/lux/macro.lux @@ -278,7 +278,7 @@ Otherwise, returns the code as-is."} (-> AST (Lux (List AST))) (case syntax - [_ (#;FormS (#;Cons [[_ (#;SymbolS macro-name)] args]))] + [_ (#;Form (#;Cons [[_ (#;Symbol macro-name)] args]))] (do Monad<Lux> [macro-name' (normalize macro-name) ?macro (find-macro macro-name')] @@ -298,7 +298,7 @@ Otherwise, returns the code as-is."} (-> AST (Lux (List AST))) (case syntax - [_ (#;FormS (#;Cons [[_ (#;SymbolS macro-name)] args]))] + [_ (#;Form (#;Cons [[_ (#;Symbol macro-name)] args]))] (do Monad<Lux> [macro-name' (normalize macro-name) ?macro (find-macro macro-name')] @@ -319,7 +319,7 @@ {#;doc "Expands all macro-calls everywhere recursively, until only primitive/base code remains."} (-> AST (Lux (List AST))) (case syntax - [_ (#;FormS (#;Cons [[_ (#;SymbolS macro-name)] args]))] + [_ (#;Form (#;Cons [[_ (#;Symbol macro-name)] args]))] (do Monad<Lux> [macro-name' (normalize macro-name) ?macro (find-macro macro-name')] @@ -335,13 +335,13 @@ [parts' (mapM Monad<Lux> macro-expand-all (list& (ast;symbol macro-name) args))] (wrap (list (ast;form (:: Monad<List> join parts'))))))) - [_ (#;FormS (#;Cons [harg targs]))] + [_ (#;Form (#;Cons [harg targs]))] (do Monad<Lux> [harg+ (macro-expand-all harg) targs+ (mapM Monad<Lux> macro-expand-all targs)] (wrap (list (ast;form (List/append harg+ (:: Monad<List> join (: (List (List AST)) targs+))))))) - [_ (#;TupleS members)] + [_ (#;Tuple members)] (do Monad<Lux> [members' (mapM Monad<Lux> macro-expand-all members)] (wrap (list (ast;tuple (:: Monad<List> join members'))))) @@ -361,7 +361,7 @@ (def: (get-local-symbol ast) (-> AST (Lux Text)) (case ast - [_ (#;SymbolS [_ name])] + [_ (#;Symbol [_ name])] (:: Monad<Lux> wrap name) _ @@ -378,7 +378,7 @@ (~ g!body))))) )))} (case tokens - (^ (list [_ (#;TupleS symbols)] body)) + (^ (list [_ (#;Tuple symbols)] body)) (do Monad<Lux> [symbol-names (mapM @ get-local-symbol symbols) #let [symbol-defs (List/join (List/map (: (-> Text (List AST)) @@ -628,7 +628,7 @@ (-> Int Int Int) (i.+ bar baz))))} (case tokens - (^ (list [_ (#;TagS ["" "omit"])] + (^ (list [_ (#;Tag ["" "omit"])] token)) (do Monad<Lux> [output (<func> token) diff --git a/stdlib/source/lux/macro/ast.lux b/stdlib/source/lux/macro/ast.lux index 4fd9c8b2c..ac65155e4 100644 --- a/stdlib/source/lux/macro/ast.lux +++ b/stdlib/source/lux/macro/ast.lux @@ -11,17 +11,17 @@ ## [Types] ## (type: (AST' w) -## (#;BoolS Bool) -## (#;NatS Nat) -## (#;IntS Int) -## (#;RealS Real) -## (#;CharS Char) -## (#;TextS Text) -## (#;SymbolS Text Text) -## (#;TagS Text Text) -## (#;FormS (List (w (AST' w)))) -## (#;TupleS (List (w (AST' w)))) -## (#;RecordS (List [(w (AST' w)) (w (AST' w))]))) +## (#;Bool Bool) +## (#;Nat Nat) +## (#;Int Int) +## (#;Real Real) +## (#;Char Char) +## (#;Text Text) +## (#;Symbol Text Text) +## (#;Tag Text Text) +## (#;Form (List (w (AST' w)))) +## (#;Tuple (List (w (AST' w)))) +## (#;Record (List [(w (AST' w)) (w (AST' w))]))) ## (type: AST ## (Meta Cursor (AST' (Meta Cursor)))) @@ -35,18 +35,18 @@ (-> <type> AST) [_cursor (<tag> x)])] - [bool Bool #;BoolS] - [nat Nat #;NatS] - [int Int #;IntS] - [deg Deg #;DegS] - [real Real #;RealS] - [char Char #;CharS] - [text Text #;TextS] - [symbol Ident #;SymbolS] - [tag Ident #;TagS] - [form (List AST) #;FormS] - [tuple (List AST) #;TupleS] - [record (List [AST AST]) #;RecordS] + [bool Bool #;Bool] + [nat Nat #;Nat] + [int Int #;Int] + [deg Deg #;Deg] + [real Real #;Real] + [char Char #;Char] + [text Text #;Text] + [symbol Ident #;Symbol] + [tag Ident #;Tag] + [form (List AST) #;Form] + [tuple (List AST) #;Tuple] + [record (List [AST AST]) #;Record] ) (do-template [<name> <tag> <doc>] @@ -55,8 +55,8 @@ (-> Text AST) [_cursor (<tag> ["" name])])] - [local-symbol #;SymbolS "Produces a local symbol (a symbol with no module prefix)."] - [local-tag #;TagS "Produces a local tag (a tag with no module prefix)."]) + [local-symbol #;Symbol "Produces a local symbol (a symbol with no module prefix)."] + [local-tag #;Tag "Produces a local tag (a tag with no module prefix)."]) ## [Structures] (struct: #export _ (Eq AST) @@ -65,15 +65,15 @@ (^template [<tag> <eq>] [[_ (<tag> x')] [_ (<tag> y')]] (:: <eq> = x' y')) - ([#;BoolS Eq<Bool>] - [#;NatS Eq<Nat>] - [#;IntS Eq<Int>] - [#;DegS Eq<Deg>] - [#;RealS Eq<Real>] - [#;CharS char;Eq<Char>] - [#;TextS Eq<Text>] - [#;SymbolS Eq<Ident>] - [#;TagS Eq<Ident>]) + ([#;Bool Eq<Bool>] + [#;Nat Eq<Nat>] + [#;Int Eq<Int>] + [#;Deg Eq<Deg>] + [#;Real Eq<Real>] + [#;Char char;Eq<Char>] + [#;Text Eq<Text>] + [#;Symbol Eq<Ident>] + [#;Tag Eq<Ident>]) (^template [<tag>] [[_ (<tag> xs')] [_ (<tag> ys')]] @@ -82,10 +82,10 @@ (and old (= x' y'))) true (zip2 xs' ys')))) - ([#;FormS] - [#;TupleS]) + ([#;Form] + [#;Tuple]) - [[_ (#;RecordS xs')] [_ (#;RecordS ys')]] + [[_ (#;Record xs')] [_ (#;Record ys')]] (and (:: Eq<Nat> = (size xs') (size ys')) (fold (function [[[xl' xr'] [yl' yr']] old] (and old (= xl' yl') (= xr' yr'))) @@ -102,25 +102,25 @@ (^template [<tag> <struct>] [_ (<tag> value)] (:: <struct> encode value)) - ([#;BoolS Codec<Text,Bool>] - [#;NatS Codec<Text,Nat>] - [#;IntS Codec<Text,Int>] - [#;DegS Codec<Text,Deg>] - [#;RealS Codec<Text,Real>] - [#;CharS char;Codec<Text,Char>] - [#;TextS text;Codec<Text,Text>] - [#;SymbolS Codec<Text,Ident>]) - - [_ (#;TagS ident)] + ([#;Bool Codec<Text,Bool>] + [#;Nat Codec<Text,Nat>] + [#;Int Codec<Text,Int>] + [#;Deg Codec<Text,Deg>] + [#;Real Codec<Text,Real>] + [#;Char char;Codec<Text,Char>] + [#;Text text;Codec<Text,Text>] + [#;Symbol Codec<Text,Ident>]) + + [_ (#;Tag ident)] (Text/append "#" (:: Codec<Text,Ident> encode ident)) (^template [<tag> <open> <close>] [_ (<tag> members)] ($_ Text/append <open> (|> members (map to-text) (interpose " ") (text;join-with "")) <close>)) - ([#;FormS "(" ")"] - [#;TupleS "[" "]"]) + ([#;Form "(" ")"] + [#;Tuple "[" "]"]) - [_ (#;RecordS pairs)] + [_ (#;Record pairs)] ($_ Text/append "{" (|> pairs (map (function [[left right]] ($_ Text/append (to-text left) " " (to-text right)))) (interpose " ") (text;join-with "")) "}") )) @@ -133,14 +133,14 @@ (^template [<tag>] [cursor (<tag> parts)] [cursor (<tag> (map (replace original substitute) parts))]) - ([#;FormS] - [#;TupleS]) - - [cursor (#;RecordS parts)] - [cursor (#;RecordS (map (function [[left right]] - [(replace original substitute left) - (replace original substitute right)]) - parts))] + ([#;Form] + [#;Tuple]) + + [cursor (#;Record parts)] + [cursor (#;Record (map (function [[left right]] + [(replace original substitute left) + (replace original substitute right)]) + parts))] _ ast))) diff --git a/stdlib/source/lux/macro/syntax.lux b/stdlib/source/lux/macro/syntax.lux index 652130b97..e2cbde491 100644 --- a/stdlib/source/lux/macro/syntax.lux +++ b/stdlib/source/lux/macro/syntax.lux @@ -97,15 +97,15 @@ _ (#;Left ($_ Text/append "Cannot parse " <desc> (remaining-inputs tokens))))))] - [ bool Bool #;BoolS bool;Eq<Bool> "bool"] - [ nat Nat #;NatS number;Eq<Nat> "nat"] - [ int Int #;IntS number;Eq<Int> "int"] - [ deg Deg #;DegS number;Eq<Deg> "deg"] - [ real Real #;RealS number;Eq<Real> "real"] - [ char Char #;CharS char;Eq<Char> "char"] - [ text Text #;TextS text;Eq<Text> "text"] - [symbol Ident #;SymbolS ident;Eq<Ident> "symbol"] - [ tag Ident #;TagS ident;Eq<Ident> "tag"] + [ bool Bool #;Bool bool;Eq<Bool> "bool"] + [ nat Nat #;Nat number;Eq<Nat> "nat"] + [ int Int #;Int number;Eq<Int> "int"] + [ deg Deg #;Deg number;Eq<Deg> "deg"] + [ real Real #;Real number;Eq<Real> "real"] + [ char Char #;Char char;Eq<Char> "char"] + [ text Text #;Text text;Eq<Text> "text"] + [symbol Ident #;Symbol ident;Eq<Ident> "symbol"] + [ tag Ident #;Tag ident;Eq<Ident> "tag"] ) (def: #export (this? ast) @@ -169,8 +169,8 @@ _ (#;Left ($_ Text/append "Cannot parse local " <desc> (remaining-inputs tokens))))))] - [local-symbol #;SymbolS "symbol"] - [ local-tag #;TagS "tag"] + [local-symbol #;Symbol "symbol"] + [ local-tag #;Tag "tag"] ) (do-template [<name> <tag> <desc>] @@ -188,8 +188,8 @@ _ (#;Left ($_ Text/append "Cannot parse " <desc> (remaining-inputs tokens))))))] - [ form #;FormS "form"] - [tuple #;TupleS "tuple"] + [ form #;Form "form"] + [tuple #;Tuple "tuple"] ) (def: #export (record p) @@ -198,7 +198,7 @@ (-> (Syntax a) (Syntax a))) (function [tokens] (case tokens - (#;Cons [[_ (#;RecordS pairs)] tokens']) + (#;Cons [[_ (#;Record pairs)] tokens']) (case (p (join-pairs pairs)) (#;Right [#;Nil x]) (#;Right [tokens' x]) _ (#;Left ($_ Text/append "Syntax was expected to fully consume record" (remaining-inputs tokens)))) @@ -431,21 +431,21 @@ (with-brackets (spaced (map (method-def$ id) methods))))))] (wrap (list (` (;_lux_proc ["jvm" (~ (ast;text def-code))] [])))))))} (let [[exported? tokens] (case tokens - (^ (list& [_ (#;TagS ["" "hidden"])] tokens')) + (^ (list& [_ (#;Tag ["" "hidden"])] tokens')) [(#;Some #;Left) tokens'] - (^ (list& [_ (#;TagS ["" "export"])] tokens')) + (^ (list& [_ (#;Tag ["" "export"])] tokens')) [(#;Some #;Right) tokens'] _ [#;None tokens]) ?parts (: (Maybe [Text (List AST) AST AST]) (case tokens - (^ (list [_ (#;FormS (list& [_ (#;SymbolS ["" name])] args))] + (^ (list [_ (#;Form (list& [_ (#;Symbol ["" name])] args))] body)) (#;Some name args (` {}) body) - (^ (list [_ (#;FormS (list& [_ (#;SymbolS ["" name])] args))] + (^ (list [_ (#;Form (list& [_ (#;Symbol ["" name])] args))] meta-data body)) (#;Some name args meta-data body) @@ -460,10 +460,10 @@ (: (-> AST (Lux [AST AST])) (function [arg] (case arg - (^ [_ (#;TupleS (list var parser))]) + (^ [_ (#;Tuple (list var parser))]) (wrap [var parser]) - [_ (#;SymbolS var-name)] + [_ (#;Symbol var-name)] (wrap [(ast;symbol var-name) (` any)]) _ diff --git a/stdlib/source/lux/type/auto.lux b/stdlib/source/lux/type/auto.lux index bb1ecc1c6..6a2991fa5 100644 --- a/stdlib/source/lux/type/auto.lux +++ b/stdlib/source/lux/type/auto.lux @@ -285,7 +285,7 @@ (def: (var? input) (-> AST Bool) (case input - [_ (#;SymbolS _)] + [_ (#;Symbol _)] true _ diff --git a/stdlib/test/test/lux/macro/syntax.lux b/stdlib/test/test/lux/macro/syntax.lux index 19607f16e..f523f227c 100644 --- a/stdlib/test/test/lux/macro/syntax.lux +++ b/stdlib/test/test/lux/macro/syntax.lux @@ -139,7 +139,7 @@ (test: "Combinators [Part 1]" ($_ seq (assert "Can parse any AST." - (match [_ (#;BoolS true)] + (match [_ (#;Bool true)] (s;run (list (ast;bool true) (ast;int 123)) s;any))) |