diff options
author | Eduardo Julian | 2017-05-03 23:51:16 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-05-03 23:51:16 -0400 |
commit | c700bb87641d37b2db9f31cd8db157fce170f866 (patch) | |
tree | 5be5950a095451f0c08707deb3628ea6edfd5df5 /new-luxc/source | |
parent | 9849d179f644927be036ee66f32e219623a59021 (diff) |
- Removed the "S" suffix from AST tags.
Diffstat (limited to '')
-rw-r--r-- | new-luxc/source/luxc/analyser.lux | 38 | ||||
-rw-r--r-- | new-luxc/source/luxc/compiler.lux | 14 | ||||
-rw-r--r-- | new-luxc/source/luxc/parser.lux | 24 |
3 files changed, 38 insertions, 38 deletions
diff --git a/new-luxc/source/luxc/analyser.lux b/new-luxc/source/luxc/analyser.lux index 2a77d8bb5..7de7bab57 100644 --- a/new-luxc/source/luxc/analyser.lux +++ b/new-luxc/source/luxc/analyser.lux @@ -26,38 +26,38 @@ (^template [<tag> <analyser>] [cursor (<tag> value)] (<analyser> cursor value)) - ([#;BoolS &&lux;analyse-bool] - [#;NatS &&lux;analyse-nat] - [#;IntS &&lux;analyse-int] - [#;DegS &&lux;analyse-deg] - [#;RealS &&lux;analyse-real] - [#;CharS &&lux;analyse-char] - [#;TextS &&lux;analyse-text]) + ([#;Bool &&lux;analyse-bool] + [#;Nat &&lux;analyse-nat] + [#;Int &&lux;analyse-int] + [#;Deg &&lux;analyse-deg] + [#;Real &&lux;analyse-real] + [#;Char &&lux;analyse-char] + [#;Text &&lux;analyse-text]) - (^ [cursor (#;TupleS (list))]) + (^ [cursor (#;Tuple (list))]) (&&lux;analyse-unit cursor) - (^ [cursor (#;TupleS (list singleton))]) + (^ [cursor (#;Tuple (list singleton))]) (analyse eval singleton) - (^ [cursor (#;TupleS elems)]) + (^ [cursor (#;Tuple elems)]) (&&lux;analyse-tuple (analyse eval) cursor elems) - [cursor (#;SymbolS reference)] + [cursor (#;Symbol reference)] (&&lux;analyse-reference cursor reference) - (^ [cursor (#;FormS (list [_ (#;SymbolS ["" "_lux_check"])] - type - value))]) + (^ [cursor (#;Form (list [_ (#;Symbol ["" "_lux_check"])] + type + value))]) (&&lux;analyse-check analyse eval cursor type value) - (^ [cursor (#;FormS (list [_ (#;SymbolS ["" "_lux_coerce"])] - type - value))]) + (^ [cursor (#;Form (list [_ (#;Symbol ["" "_lux_coerce"])] + type + value))]) (&&lux;analyse-coerce analyse eval cursor type value) - (^ [cursor (#;FormS (list [_ (#;NatS tag)] - value))]) + (^ [cursor (#;Form (list [_ (#;Nat tag)] + value))]) (&&lux;analyse-variant (analyse eval) cursor tag value) _ diff --git a/new-luxc/source/luxc/compiler.lux b/new-luxc/source/luxc/compiler.lux index 4ac865786..12966ba00 100644 --- a/new-luxc/source/luxc/compiler.lux +++ b/new-luxc/source/luxc/compiler.lux @@ -17,15 +17,15 @@ (def: (compile ast) (-> AST (Lux Unit)) (case ast - (^ [_ (#;FormS (list [_ (#;SymbolS ["" "_lux_def"])] - [_ (#;SymbolS ["" def-name])] - def-value - def-meta))]) + (^ [_ (#;Form (list [_ (#;Symbol ["" "_lux_def"])] + [_ (#;Symbol ["" def-name])] + def-value + def-meta))]) (&&statement;compile-def def-name def-value def-meta) - (^ [_ (#;FormS (list [_ (#;SymbolS ["" "_lux_program"])] - [_ (#;SymbolS ["" prog-args])] - prog-body))]) + (^ [_ (#;Form (list [_ (#;Symbol ["" "_lux_program"])] + [_ (#;Symbol ["" prog-args])] + prog-body))]) (&&statement;compile-program prog-args prog-body) _ diff --git a/new-luxc/source/luxc/parser.lux b/new-luxc/source/luxc/parser.lux index 6565ba65f..0115d1924 100644 --- a/new-luxc/source/luxc/parser.lux +++ b/new-luxc/source/luxc/parser.lux @@ -219,20 +219,20 @@ (wrap [(update@ #;column (n.+ (text;size chunk)) where) [where (<tag> value)]]))))] - [parse-bool #;BoolS + [parse-bool #;Bool (l;either (l;text "true") (l;text "false")) bool;Codec<Text,Bool>] - [parse-nat #;NatS + [parse-nat #;Nat (l;seq' (l;text "+") (l;many' l;digit)) number;Codec<Text,Nat>] - [parse-int #;IntS + [parse-int #;Int (l;seq' (l;default "" (l;text "-")) (l;many' l;digit)) number;Codec<Text,Int>] - [parse-real #;RealS + [parse-real #;Real ($_ l;seq' (l;default "" (l;text "-")) (l;many' l;digit) @@ -240,7 +240,7 @@ (l;many' l;digit)) number;Codec<Text,Real>] - [parse-deg #;DegS + [parse-deg #;Deg (l;seq' (l;text ".") (l;many' l;digit)) number;Codec<Text,Deg>] @@ -254,7 +254,7 @@ [[chunk value] (l;enclosed ["#\"" "\""] raw-char^)] (wrap [(update@ #;column (|>. ($_ n.+ +3 (text;size chunk))) where) - [where (#;CharS value)]]))) + [where (#;Char value)]]))) ## This parser looks so complex because text in Lux can be multi-line ## and there are rules regarding how this is handled. @@ -342,7 +342,7 @@ (set@ #;column +0)) true)))))] (wrap [where' - [where (#;TextS text-read)]]))) + [where (#;Text text-read)]]))) ## Form and tuple syntax is mostly the same, differing only in the ## delimiters involved. @@ -374,8 +374,8 @@ (wrap [where' [where (<tag> elems)]])))] - [parse-form #;FormS "(" ")"] - [parse-tuple #;TupleS "[" "]"] + [parse-form #;Form "(" ")"] + [parse-tuple #;Tuple "[" "]"] ) ## Records are almost (syntactically) the same as forms and tuples, @@ -407,7 +407,7 @@ (wrap [(update@ #;column n.inc where') (V;to-list elems)]))))] (wrap [where' - [where (#;RecordS elems)]]))) + [where (#;Record elems)]]))) ## The parts of an identifier are separated by a single mark. ## E.g. module;name. @@ -504,8 +504,8 @@ (wrap [(update@ #;column (|>. ($_ n.+ <extra> length)) where) [where (<tag> value)]])))] - [parse-symbol #;SymbolS ident^ +0] - [parse-tag #;TagS (l;after (l;char #"#") ident^) +1] + [parse-symbol #;Symbol ident^ +0] + [parse-tag #;Tag (l;after (l;char #"#") ident^) +1] ) (def: (parse-ast where) |