hashicorp / syntax

TextMate grammars for highlighting HCL, HCL-based languages and Sentinel.
Mozilla Public License 2.0
25 stars 11 forks source link

(TFECO-7531) fix(hcl): don't parse expressions containing an open curly brace as blocks #149

Closed ansgarm closed 2 weeks ago

ansgarm commented 2 weeks ago

This fixes the following problem in Terraform Test files (which use the HCL syntax instead of the more specialized Terraform one):

image

The grammar treats the opening brace that is part of the template string as a block and therefore breaks the following lines (mostly treated as a string).

This PR restricts parsing blocks as it only allows block labels to contain any character if that label is enclosed by double quotes. If it isn't only \w-_ are valid characters.