Skip to content

Commit

Permalink
Update spec.md to avoid suggesting ! is a binary operator
Browse files Browse the repository at this point in the history
The current spec appears to suggest that the bang is a binary operator, which would enable
expressions such as `foo ! bar`.

https://github.com/hashicorp/hcl/blob/main/hclsyntax/parser.go#L1070 seems to suggest this is only
a unary operator.
  • Loading branch information
ascopes authored Aug 28, 2022
1 parent 3186414 commit cf3ee0f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hclsyntax/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ binaryOp = ExprTerm binaryOperator ExprTerm;
binaryOperator = compareOperator | arithmeticOperator | logicOperator;
compareOperator = "==" | "!=" | "<" | ">" | "<=" | ">=";
arithmeticOperator = "+" | "-" | "*" | "/" | "%";
logicOperator = "&&" | "||" | "!";
logicOperator = "&&" | "||";
```

The unary operators have the highest precedence.
Expand Down

0 comments on commit cf3ee0f

Please sign in to comment.