From cf3ee0f20516f34fb267ca83b68e646c8f5fb856 Mon Sep 17 00:00:00 2001 From: Ashley Scopes <73482956+ascopes@users.noreply.github.com> Date: Sun, 28 Aug 2022 12:30:33 +0100 Subject: [PATCH] Update spec.md to avoid suggesting ! is a binary operator 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. --- hclsyntax/spec.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hclsyntax/spec.md b/hclsyntax/spec.md index 33c152da..f4aa2d0f 100644 --- a/hclsyntax/spec.md +++ b/hclsyntax/spec.md @@ -635,7 +635,7 @@ binaryOp = ExprTerm binaryOperator ExprTerm; binaryOperator = compareOperator | arithmeticOperator | logicOperator; compareOperator = "==" | "!=" | "<" | ">" | "<=" | ">="; arithmeticOperator = "+" | "-" | "*" | "/" | "%"; -logicOperator = "&&" | "||" | "!"; +logicOperator = "&&" | "||"; ``` The unary operators have the highest precedence.