mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 20:28:02 +00:00
Remove indented-else syntax from the formatter
This is step 1 in removing the syntax all together. The formatter will now seemlessly migrate everyone to the usual if/then/else syntax. After everyone has had a chance to upgrade, we can then remove this from the parser (in a future PR).
This commit is contained in:
parent
255a388c28
commit
20d092ea48
8 changed files with 121 additions and 50 deletions
|
@ -0,0 +1,5 @@
|
|||
if !a! then
|
||||
t
|
||||
else
|
||||
l
|
||||
5
|
|
@ -0,0 +1,72 @@
|
|||
@1-24 SpaceAfter(
|
||||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
EitherIndex(2147483648),
|
||||
],
|
||||
regions: [
|
||||
@1-22,
|
||||
],
|
||||
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(
|
||||
@1-22 If {
|
||||
if_thens: [
|
||||
(
|
||||
@3-6 UnaryOp(
|
||||
@4-6 Var {
|
||||
module_name: "",
|
||||
ident: "a!",
|
||||
},
|
||||
@3-4 Not,
|
||||
),
|
||||
@11-12 SpaceBefore(
|
||||
SpaceAfter(
|
||||
Var {
|
||||
module_name: "",
|
||||
ident: "t",
|
||||
},
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
final_else: @21-22 SpaceBefore(
|
||||
Var {
|
||||
module_name: "",
|
||||
ident: "l",
|
||||
},
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
indented_else: true,
|
||||
},
|
||||
),
|
||||
],
|
||||
},
|
||||
@23-24 SpaceBefore(
|
||||
Num(
|
||||
"5",
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
)
|
|
@ -0,0 +1,5 @@
|
|||
if!a!then
|
||||
t
|
||||
else
|
||||
l
|
||||
5
|
|
@ -2,7 +2,6 @@ if
|
|||
k
|
||||
then
|
||||
A
|
||||
else
|
||||
|
||||
e
|
||||
r
|
||||
else
|
||||
e
|
||||
r
|
Loading…
Add table
Add a link
Reference in a new issue