-
-
Notifications
You must be signed in to change notification settings - Fork 313
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6937 from joshuawarner32/fix-deprecated-interpola…
…ted-formatting Fix auto-fixing of deprecated interpolated strings
- Loading branch information
Showing
8 changed files
with
206 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...mpiler/test_syntax/tests/snapshots/pass/deprecated_interpolated_string.expr.formatted.roc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"$(e)" |
17 changes: 17 additions & 0 deletions
17
.../compiler/test_syntax/tests/snapshots/pass/deprecated_interpolated_string.expr.result-ast
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
SpaceAfter( | ||
Str( | ||
Line( | ||
[ | ||
DeprecatedInterpolated( | ||
@3-4 Var { | ||
module_name: "", | ||
ident: "e", | ||
}, | ||
), | ||
], | ||
), | ||
), | ||
[ | ||
Newline, | ||
], | ||
) |
1 change: 1 addition & 0 deletions
1
crates/compiler/test_syntax/tests/snapshots/pass/deprecated_interpolated_string.expr.roc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"\(e)" |
8 changes: 8 additions & 0 deletions
8
crates/compiler/test_syntax/tests/snapshots/pass/pizza_bang.moduledefs.formatted.roc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
main = | ||
Arg.list! {} | ||
|> List.dropFirst 1 | ||
|> List.mapTry Str.toU8 | ||
|> Task.fromResult! | ||
|> List.sum | ||
|> \total -> "Sum of numbers: $(Num.toStr total)" | ||
|> Stdout.line! |
168 changes: 168 additions & 0 deletions
168
crates/compiler/test_syntax/tests/snapshots/pass/pizza_bang.moduledefs.result-ast
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,168 @@ | ||
Defs { | ||
tags: [ | ||
Index(2147483648), | ||
], | ||
regions: [ | ||
@0-189, | ||
], | ||
space_before: [ | ||
Slice(start = 0, length = 0), | ||
], | ||
space_after: [ | ||
Slice(start = 0, length = 1), | ||
], | ||
spaces: [ | ||
Newline, | ||
], | ||
type_defs: [], | ||
value_defs: [ | ||
Body( | ||
@0-4 Identifier { | ||
ident: "main", | ||
}, | ||
@11-189 SpaceBefore( | ||
BinOps( | ||
[ | ||
( | ||
@11-23 SpaceAfter( | ||
Apply( | ||
@11-19 TaskAwaitBang( | ||
Var { | ||
module_name: "Arg", | ||
ident: "list", | ||
}, | ||
), | ||
[ | ||
@21-23 Record( | ||
[], | ||
), | ||
], | ||
Space, | ||
), | ||
[ | ||
Newline, | ||
], | ||
), | ||
@28-30 Pizza, | ||
), | ||
( | ||
@31-47 SpaceAfter( | ||
Apply( | ||
@31-45 Var { | ||
module_name: "List", | ||
ident: "dropFirst", | ||
}, | ||
[ | ||
@46-47 Num( | ||
"1", | ||
), | ||
], | ||
Space, | ||
), | ||
[ | ||
Newline, | ||
], | ||
), | ||
@52-54 Pizza, | ||
), | ||
( | ||
@55-75 SpaceAfter( | ||
Apply( | ||
@55-66 Var { | ||
module_name: "List", | ||
ident: "mapTry", | ||
}, | ||
[ | ||
@67-75 Var { | ||
module_name: "Str", | ||
ident: "toU8", | ||
}, | ||
], | ||
Space, | ||
), | ||
[ | ||
Newline, | ||
], | ||
), | ||
@80-82 Pizza, | ||
), | ||
( | ||
@83-98 SpaceAfter( | ||
TaskAwaitBang( | ||
Var { | ||
module_name: "Task", | ||
ident: "fromResult", | ||
}, | ||
), | ||
[ | ||
Newline, | ||
], | ||
), | ||
@104-106 Pizza, | ||
), | ||
( | ||
@107-115 SpaceAfter( | ||
Var { | ||
module_name: "List", | ||
ident: "sum", | ||
}, | ||
[ | ||
Newline, | ||
], | ||
), | ||
@120-122 Pizza, | ||
), | ||
( | ||
@123-169 SpaceAfter( | ||
Closure( | ||
[ | ||
@124-129 Identifier { | ||
ident: "total", | ||
}, | ||
], | ||
@133-169 Str( | ||
Line( | ||
[ | ||
Plaintext( | ||
"Sum of numbers: ", | ||
), | ||
Interpolated( | ||
@152-167 Apply( | ||
@152-161 Var { | ||
module_name: "Num", | ||
ident: "toStr", | ||
}, | ||
[ | ||
@162-167 Var { | ||
module_name: "", | ||
ident: "total", | ||
}, | ||
], | ||
Space, | ||
), | ||
), | ||
], | ||
), | ||
), | ||
), | ||
[ | ||
Newline, | ||
], | ||
), | ||
@174-176 Pizza, | ||
), | ||
], | ||
@177-188 TaskAwaitBang( | ||
Var { | ||
module_name: "Stdout", | ||
ident: "line", | ||
}, | ||
), | ||
), | ||
[ | ||
Newline, | ||
], | ||
), | ||
), | ||
], | ||
} |
8 changes: 8 additions & 0 deletions
8
crates/compiler/test_syntax/tests/snapshots/pass/pizza_bang.moduledefs.roc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
main = | ||
Arg.list! {} | ||
|> List.dropFirst 1 | ||
|> List.mapTry Str.toU8 | ||
|> Task.fromResult! | ||
|> List.sum | ||
|> \total -> "Sum of numbers: $(Num.toStr total)" | ||
|> Stdout.line! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters