forked from hashicorp/hcl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hclwrite: add space between "in" keyword and expr in for expression
Our normal ruleset thinks that the "in" keyword here is a variable reference and so writes it as "in[y]". Since there's never any reason for a variable to appear immediately after another variable, we can check for a preceding identifier as a heuristic to recognize whether in is probably being used as a keyword rather than as a variable. This is not exact, but the only time this should be a false positive is if there were a syntax error in the input, and we don't make any guarantees about the result in that case anyway. This fixes hashicorp#52.
- Loading branch information
1 parent
bafa0c5
commit 002296d
Showing
3 changed files
with
42 additions
and
1 deletion.
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