Please sign in to comment.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Currently, `handle_possible_chaining` is a bit of a misnomer--if there is no chaining, then an exception `Failure "Expected a chain of at least length 1"` is raised. This means that any time we want to make use of the behavior of `handle_possible_chaining`, for example, in `handle_function_call_expression`, we must first look at the receiver to confirm that it is a member selection expression, so that we know it is safe to invoke `handle_possible_chaining`. This seems a little silly. It would be much simpler if `handle_possible_chaining` performed chain-formatting when member selections were present, and simply formatted function calls normally otherwise (this is, after all, what the name `handle_possible_chaining` would seem to imply). This diff makes that change, and also does a bit of refactoring in an attempt to make `handle_possible_chaining` easier to follow. Reviewed By: pittsw Differential Revision: D13959285 fbshipit-source-id: 86cd90d4c8f82e3904d31641d045e16fea572e41
- Loading branch information
Showing with 84 additions and 146 deletions.
- +84 −146 hphp/hack/src/hackfmt/hack_format.ml
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