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

Fix compiler directive on first line & compound directives #286

Merged

Conversation

vasily-kirichenko
Copy link
Contributor

@vasily-kirichenko vasily-kirichenko commented Jul 21, 2018

The bug was in that

#if FOO
let x = 1
#endif

was formatted as

#if FOOlet x = 1
#endif

This also fixes #280

@@ -450,7 +450,8 @@ let rec shrinkSynExpr = function
| SynExpr.MatchLambda(_, _, clauses, _, _) ->
seq { yield! Seq.collect collectSynMatchClause clauses }
| SynExpr.TryWith(expr, _, clauses, _, _, _, _)
| SynExpr.Match(_, expr, clauses, _, _) ->
| SynExpr.Match(_, expr, clauses, _, _)
| SynExpr.MatchBang(_, expr, clauses, _, _) ->
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also fix incomplete pattern match by adding a branch for match!.

Copy link
Contributor

@nojaf nojaf Jul 31, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps add this in another PR? Adding the pattern match does not mean that match! is supported right?

@vasily-kirichenko vasily-kirichenko changed the title Fix compiler directive on first line Fix compiler directive on first line & compound directives Jul 21, 2018
@nojaf nojaf merged commit bc75bf0 into fsprojects:master Sep 10, 2018
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.

#if FOO || BAR => #if FOO
2 participants