Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run long array sequence test on CI. #1520

Merged
merged 2 commits into from
Mar 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/Fantomas.Tests/ListTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -403,8 +403,8 @@ let ``line comment inside array`` () =
|]
"""

#if RELEASE
nojaf marked this conversation as resolved.
Show resolved Hide resolved
[<Test>]
[<Ignore("fails on ci")>]
let ``long array sequence`` () =
formatSourceString
false
Expand Down Expand Up @@ -1482,6 +1482,7 @@ let input =

let sample = [| 0; 3; 0; 1; -3 |]
"""
#endif

[<Test>]
let ``F# 4.7 implicit yield in sequence`` () =
Expand Down
8 changes: 1 addition & 7 deletions src/Fantomas/AstTransformer.fs
Original file line number Diff line number Diff line change
Expand Up @@ -301,13 +301,7 @@ module private Ast =
mkNode SynExpr_Lazy range :: nodes
|> finalContinuation)
| SynExpr.Sequential (_, _, expr1, expr2, _) ->
let continuations : ((TriviaNodeAssigner list -> TriviaNodeAssigner list) -> TriviaNodeAssigner list) list =
[ visit expr1; visit expr2 ]

let finalContinuation (nodes: TriviaNodeAssigner list list) : TriviaNodeAssigner list =
(List.collect id nodes) |> finalContinuation

Continuation.sequence continuations finalContinuation
visit expr2 (fun nodes1 -> visit expr1 (fun nodes2 -> nodes1 @ nodes2 |> finalContinuation))
| SynExpr.SequentialOrImplicitYield (_, expr1, expr2, ifNotStmt, range) ->
let continuations : ((TriviaNodeAssigner list -> TriviaNodeAssigner list) -> TriviaNodeAssigner list) list =
[ visit expr1
Expand Down