Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
format: don't group iterable when one has defaulted location (#4260)
As mentioned in the comment, empty file names happen when the format package's Ast() function does a sweep of its input, and adds a "default location" to everything that has a nil location. During PE, when generated the pairs to save in saveUnify, we'll return Var Terms without locations. Fixing that seemed like a bigger hurdle, so I went this route. The new check is such that if any term has the default file in its location, such as would happen if we're formatting code that was created programmatically (not parsed), we'll group the terms' elements, but print them in one line. Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
- Loading branch information
Showing
2 changed files
with
67 additions
and
11 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