-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Includes everything that can go in a constructor: - Factory and redirecting constructors. - Initializing formals ("this." parameters). - Super parameters. - Constructor initializers. - Assert initializers. Constructors are tricky because there are some constraints between how the parameter list and initializer list are allowed to split. Up until now, aside from setAllowNewlines(), there aren't really any ways that pieces interact. To support this, I added a pretty simple API where when a piece calls CodeWriter.format() on a child piece, it can pass it what state the piece is required to be in. If the solution doesn't have the child in that state, it invalidates the solution. It seems to work pretty well. There is probably a more optimal way to implement that in the solver so that we test these constraints even before formatting and discard the solution more eagerly. I left a TODO comment about that and we can look into it later when we're benchmarking.
- Loading branch information
1 parent
6249194
commit 8cf67ef
Showing
15 changed files
with
1,176 additions
and
95 deletions.
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
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
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
Oops, something went wrong.