You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Via SublimeText/Terraform#43, it was brought to my attention that apparently underscore characters (_ U+005F) are allowed to start an identifier, whereas the current spec does not say so.
Identifiers name entities such as blocks, attributes and expression variables.
Identifiers are interpreted as per [UAX #31][uax31] Section 2. Specifically,
their syntax is defined in terms of the `ID_Start` and `ID_Continue`
character properties as follows:
```ebnf
Identifier = ID_Start (ID_Continue | '-')*;
```
The Unicode specification provides the normative requirements for identifier
parsing. Non-normatively, the spirit of this specification is that `ID_Start`
consists of Unicode letter and certain unambiguous punctuation tokens, while
`ID_Continue` augments that set with Unicode digits, combining marks, etc.
The dash character `-` is additionally allowed in identifiers, even though
that is not part of the unicode `ID_Continue` definition. This is to allow
attribute names and block type names to contain dashes, although underscores
as word separators are considered the idiomatic usage.
[uax31]: http://unicode.org/reports/tr31/"Unicode Identifier and Pattern Syntax"
As cited, the spec specifically only allows characters in the ID_Start Unicode property, which is defined as:
ID_Start characters are derived from the Unicode General_Category of uppercase letters, lowercase letters, titlecase letters, modifier letters, other letters, letter numbers, plus Other_ID_Start, minus Pattern_Syntax and Pattern_White_Space code points.
In UnicodeSet notation: [\p{L}\p{Nl}\p{Other_ID_Start}-\p{Pattern_Syntax}-\p{Pattern_White_Space}]
None of these properties include the underscore character. (It is, however, included in ID_Continue through Pc.)
The text was updated successfully, but these errors were encountered:
Via SublimeText/Terraform#43, it was brought to my attention that apparently underscore characters (
_
U+005F) are allowed to start an identifier, whereas the current spec does not say so.hcl/hclsyntax/spec.md
Lines 90 to 111 in 360ae57
As cited, the spec specifically only allows characters in the
ID_Start
Unicode property, which is defined as:None of these properties include the underscore character. (It is, however, included in
ID_Continue
throughPc
.)The text was updated successfully, but these errors were encountered: