diff options
author | Eduardo Julian | 2021-09-09 00:29:12 -0400 |
---|---|---|
committer | Eduardo Julian | 2021-09-09 00:29:12 -0400 |
commit | ef77466323f85a3d1b65b46a3deb93652ef22085 (patch) | |
tree | c2715b8cf6e7864fef87e22ee6e206c7c1758849 /stdlib/source/library/lux/tool/compiler | |
parent | 085c9a6ef151531cb01b842ed2f4366a49b78367 (diff) |
The old record syntax has been re-purposed as variant syntax.
Diffstat (limited to 'stdlib/source/library/lux/tool/compiler')
-rw-r--r-- | stdlib/source/library/lux/tool/compiler/language/lux/syntax.lux | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/syntax.lux b/stdlib/source/library/lux/tool/compiler/language/lux/syntax.lux index bd1aca3b3..ec444b003 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/syntax.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/syntax.lux @@ -117,14 +117,14 @@ ["(" open_form] [")" close_form] + ... Variant delimiters + ["{" open_variant] + ["}" close_variant] + ... Tuple delimiters ["[" open_tuple] ["]" close_tuple] - ... Record delimiters - ["{" open_record] - ["}" close_record] - ["#" sigil] ["," digit_separator] @@ -239,8 +239,9 @@ ... Form and tuple syntax is mostly the same, differing only in the ... delimiters involved. ... They may have an arbitrary number of arbitrary Code nodes as elements. - [form_parser ..close_form #.Form] - [tuple_parser ..close_tuple #.Tuple] + [form_parser ..close_form #.Form] + [variant_parser ..close_variant #.Variant] + [tuple_parser ..close_tuple #.Tuple] ) (inline: (record_parser parse where offset source_code) @@ -254,7 +255,7 @@ (recur sourceFV (#.Item [field value] stack))) (#.Left [source' error]) - (if (same? ..close_record error) + (if (same? ..close_variant error) (#.Right [source' [where (#.Record (list.reversed stack))]]) (#.Left [source' error]))))) @@ -292,8 +293,8 @@ [text.new_line] [text.carriage_return] [..name_separator] [..open_form] [..close_form] + [..open_variant] [..close_variant] [..open_tuple] [..close_tuple] - [..open_record] [..close_record] [..text_delimiter] [..sigil]) <digit_separator> (static ..digit_separator)] @@ -517,8 +518,8 @@ (!close <close>)] [..open_form ..close_form form_parser] + [..open_variant ..close_variant variant_parser] [..open_tuple ..close_tuple tuple_parser] - [..open_record ..close_record record_parser] )] (`` ("lux syntax char case!" char/0 [[(~~ (static text.space)) |