mirror of
https://github.com/roc-lang/roc.git
synced 2025-11-01 05:24:15 +00:00
Make parsing of conditionals consistent between stmts/exprs
This commit is contained in:
parent
e47d7924d3
commit
7eb9909ac5
6 changed files with 100 additions and 38 deletions
|
|
@ -0,0 +1,2 @@
|
|||
d when!
|
||||
s
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
EitherIndex(2147483648),
|
||||
],
|
||||
regions: [
|
||||
@0-11,
|
||||
],
|
||||
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: [
|
||||
Body(
|
||||
@0-3 RecordDestructure(
|
||||
Collection {
|
||||
items: [],
|
||||
final_comments: [
|
||||
Newline,
|
||||
],
|
||||
},
|
||||
),
|
||||
@4-11 Apply(
|
||||
@4-5 Var {
|
||||
module_name: "",
|
||||
ident: "d",
|
||||
},
|
||||
[
|
||||
@6-11 Var {
|
||||
module_name: "",
|
||||
ident: "when!",
|
||||
},
|
||||
],
|
||||
Space,
|
||||
),
|
||||
),
|
||||
],
|
||||
},
|
||||
@13-14 SpaceBefore(
|
||||
Var {
|
||||
module_name: "",
|
||||
ident: "s",
|
||||
},
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
)
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
}=d when!
|
||||
s
|
||||
|
|
@ -20,21 +20,21 @@ Defs(
|
|||
ident: "a",
|
||||
},
|
||||
@2-9 Apply(
|
||||
@2-3 SpaceAfter(
|
||||
Tag(
|
||||
"A",
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
@2-3 Tag(
|
||||
"A",
|
||||
),
|
||||
[
|
||||
@5-7 UnaryOp(
|
||||
@6-7 Var {
|
||||
module_name: "",
|
||||
ident: "g",
|
||||
},
|
||||
@5-6 Negate,
|
||||
@5-7 SpaceBefore(
|
||||
UnaryOp(
|
||||
@6-7 Var {
|
||||
module_name: "",
|
||||
ident: "g",
|
||||
},
|
||||
@5-6 Negate,
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
@8-9 Var {
|
||||
module_name: "",
|
||||
|
|
|
|||
|
|
@ -382,6 +382,7 @@ mod test_snapshots {
|
|||
pass/empty_record.expr,
|
||||
pass/empty_record_assign_tag.expr,
|
||||
pass/empty_record_assignment.expr,
|
||||
pass/empty_record_assignment_d_when_bang.expr,
|
||||
pass/empty_record_eq_dbg.expr,
|
||||
pass/empty_record_eq_newlines_doubleeq.expr,
|
||||
pass/empty_record_newline_assign.expr,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue