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

Only keep collecting line comments if they are not separate by a new line #923

Merged
merged 3 commits into from
Jun 19, 2020

Conversation

nojaf
Copy link
Contributor

@nojaf nojaf commented Jun 17, 2020

Fixes #920

I'm open to suggestions when it comes to using that mutable.
Had no immediate idea of how to do it without it.

@nojaf nojaf requested a review from jindraivanek June 17, 2020 19:38
@knocte
Copy link
Contributor

knocte commented Jun 18, 2020

I'm open to suggestions when it comes to using that mutable.

Use List.fold instead of List.takeWhile?

@nojaf
Copy link
Contributor Author

nojaf commented Jun 18, 2020

@knocte

rest
|> List.takeWhile

rest in this case are the remaining tokens of the entire file.
Doing a List.fold followed by a filter would go over way to many tokens.

@jindraivanek
Copy link
Contributor

jindraivanek commented Jun 18, 2020

I'm open to suggestions when it comes to using that mutable.

Something like

Seq.zip rest (headToken::rest |> List.map (fun x -> x.LineNumber)) 
|> Seq.takeWhile (fun (t, currentLineNumber) -> ...)

@nojaf
Copy link
Contributor Author

nojaf commented Jun 18, 2020

@jindraivanek thanks, I'll try it.

@nojaf
Copy link
Contributor Author

nojaf commented Jun 19, 2020

@jindraivanek ready for review.

@nojaf nojaf merged commit cb09c45 into fsprojects:master Jun 19, 2020
@nojaf nojaf deleted the fix-920 branch December 11, 2020 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Newline between comments should lead to individual comments
3 participants