Fix a couple minor parsing bugs

This commit is contained in:
Joshua Warner 2024-12-01 12:22:51 -08:00
parent d4301e86a3
commit 5cd38c969f
No known key found for this signature in database
GPG key ID: 89AD497003F93FDD
12 changed files with 90 additions and 1 deletions

View file

@ -0,0 +1,38 @@
SpaceAfter(
Defs(
Defs {
tags: [
EitherIndex(2147483648),
],
regions: [
@0-1,
],
space_before: [
Slice<roc_parse::ast::CommentOrNewline> { start: 0, length: 0 },
],
space_after: [
Slice<roc_parse::ast::CommentOrNewline> { start: 0, length: 0 },
],
spaces: [],
type_defs: [],
value_defs: [
Stmt(
@0-1 Tag(
"T",
),
),
],
},
@2-4 SpaceBefore(
RecordUpdater(
"n",
),
[
Newline,
],
),
),
[
Newline,
],
)

View file

@ -0,0 +1,22 @@
Apply(
@2-11 ParensAround(
SpaceBefore(
Return(
@2-11 Num(
"-3e",
),
None,
),
[
Newline,
],
),
),
[
@12-13 Var {
module_name: "",
ident: "g",
},
],
Space,
)

View file

@ -0,0 +1,2 @@
(
return-3e)g

View file

@ -0,0 +1,12 @@
BinOps(
[
(
@0-3 Try,
@3-4 Minus,
),
],
@4-5 Var {
module_name: "",
ident: "w",
},
)

View file

@ -477,6 +477,7 @@ mod test_snapshots {
pass/parens_apply_not_parens.expr,
pass/parens_empty_record_apply.expr,
pass/parens_in_type_def_apply.expr,
pass/parens_record_updater.expr,
pass/parenthesized_type_def.expr,
pass/parenthesized_type_def_space_before.expr,
pass/parenthetical_apply.expr,
@ -512,6 +513,7 @@ mod test_snapshots {
pass/record_updater_var_apply.expr,
pass/record_with_if.expr,
pass/requires_type.header,
pass/return_in_apply_func.expr,
pass/return_in_if.expr,
pass/return_in_static_def.expr,
pass/return_in_when.expr,
@ -545,6 +547,7 @@ mod test_snapshots {
pass/try_function_after_pipe.expr,
pass/try_pipe_suffix.expr,
pass/try_plain_prefix.expr,
pass/try_subtract.expr,
pass/tuple_access_after_ident.expr,
pass/tuple_access_after_record.expr,
pass/tuple_accessor_function.expr,