hcl/hclsyntax: Fix token range reporting for invalid characters

This commit is contained in:
Radek Simko 2019-01-25 13:45:53 +00:00
parent 45accbc687
commit 4f47ee198a
1 changed files with 3 additions and 0 deletions

View File

@ -189,6 +189,9 @@ func checkInvalidTokens(tokens Tokens) hcl.Diagnostics {
toldBadUTF8 := 0
for _, tok := range tokens {
// copy token so it's safe to point to it
tok := tok
switch tok.Type {
case TokenBitwiseAnd, TokenBitwiseOr, TokenBitwiseXor, TokenBitwiseNot:
if toldBitwise < 4 {