mirror of
https://github.com/roc-lang/roc.git
synced 2025-11-01 21:40:58 +00:00
Fix parsing of tuple accessors after an identifier - e.g. myIdent.2
This commit is contained in:
parent
53b1525139
commit
31a4eb2bfd
8 changed files with 150 additions and 59 deletions
|
|
@ -0,0 +1,50 @@
|
|||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
Index(2147483648),
|
||||
],
|
||||
regions: [
|
||||
@0-15,
|
||||
],
|
||||
space_before: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
space_after: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
spaces: [],
|
||||
type_defs: [],
|
||||
value_defs: [
|
||||
Body(
|
||||
@0-3 Identifier(
|
||||
"abc",
|
||||
),
|
||||
@6-15 Tuple(
|
||||
[
|
||||
@7-8 Num(
|
||||
"1",
|
||||
),
|
||||
@10-11 Num(
|
||||
"2",
|
||||
),
|
||||
@13-14 Num(
|
||||
"3",
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
},
|
||||
@16-21 SpaceBefore(
|
||||
TupleAccess(
|
||||
Var {
|
||||
module_name: "",
|
||||
ident: "abc",
|
||||
},
|
||||
"0",
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
)
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
abc = (1, 2, 3)
|
||||
abc.0
|
||||
|
|
@ -251,6 +251,7 @@ mod test_snapshots {
|
|||
malformed/malformed_ident_due_to_underscore.expr,
|
||||
malformed/malformed_pattern_field_access.expr, // See https://github.com/roc-lang/roc/issues/399
|
||||
malformed/malformed_pattern_module_name.expr, // See https://github.com/roc-lang/roc/issues/399
|
||||
malformed/qualified_tag.expr,
|
||||
malformed/underscore_expr_in_def.expr,
|
||||
pass/ability_demand_signature_is_multiline.expr,
|
||||
pass/ability_multi_line.expr,
|
||||
|
|
@ -405,7 +406,6 @@ mod test_snapshots {
|
|||
pass/positive_int.expr,
|
||||
pass/provides_type.header,
|
||||
pass/qualified_field.expr,
|
||||
malformed/qualified_tag.expr,
|
||||
pass/qualified_var.expr,
|
||||
pass/record_access_after_tuple.expr,
|
||||
pass/record_destructure_def.expr,
|
||||
|
|
@ -426,6 +426,7 @@ mod test_snapshots {
|
|||
pass/tag_pattern.expr,
|
||||
pass/ten_times_eleven.expr,
|
||||
pass/three_arg_closure.expr,
|
||||
pass/tuple_access_after_ident.expr,
|
||||
pass/tuple_access_after_record.expr,
|
||||
pass/tuple_accessor_function.expr,
|
||||
pass/tuple_type.expr,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue