From cd1cd1cb7d76234df816d53f5a2fbfbce95107a6 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 9 Dec 2016 12:40:34 -0500 Subject: [PATCH] vendor: update HIL --- .../github.com/hashicorp/hil/parser/parser.go | 21 +------------------ .../hashicorp/hil/scanner/scanner.go | 19 +++++++++++++++++ vendor/vendor.json | 20 +++++++++--------- 3 files changed, 30 insertions(+), 30 deletions(-) diff --git a/vendor/github.com/hashicorp/hil/parser/parser.go b/vendor/github.com/hashicorp/hil/parser/parser.go index d7a461323..376f1c49d 100644 --- a/vendor/github.com/hashicorp/hil/parser/parser.go +++ b/vendor/github.com/hashicorp/hil/parser/parser.go @@ -2,7 +2,6 @@ package parser import ( "strconv" - "strings" "unicode/utf8" "github.com/hashicorp/hil/ast" @@ -483,26 +482,8 @@ func (p *parser) ParseScopeInteraction() (ast.Node, error) { }, nil } - varParts := []string{first.Content} - for p.peeker.Peek().Type == scanner.PERIOD { - p.peeker.Read() // eat period - - // Read the next item, since variable access in HIL is composed - // of many things. For example: "var.0.bar" is the entire var access. - partTok := p.peeker.Read() - switch partTok.Type { - case scanner.IDENTIFIER: - case scanner.STAR: - case scanner.INTEGER: - default: - return nil, ExpectationError("identifier", partTok) - } - - varParts = append(varParts, partTok.Content) - } - varName := strings.Join(varParts, ".") varNode := &ast.VariableAccess{ - Name: varName, + Name: first.Content, Posx: startPos, } diff --git a/vendor/github.com/hashicorp/hil/scanner/scanner.go b/vendor/github.com/hashicorp/hil/scanner/scanner.go index e448f13bf..bab86c67a 100644 --- a/vendor/github.com/hashicorp/hil/scanner/scanner.go +++ b/vendor/github.com/hashicorp/hil/scanner/scanner.go @@ -479,12 +479,31 @@ func scanIdentifier(s string) (string, int) { nextRune, size := utf8.DecodeRuneInString(s[byteLen:]) if !(nextRune == '_' || nextRune == '-' || + nextRune == '.' || + nextRune == '*' || unicode.IsNumber(nextRune) || unicode.IsLetter(nextRune) || unicode.IsMark(nextRune)) { break } + // If we reach a star, it must be between periods to be part + // of the same identifier. + if nextRune == '*' && s[byteLen-1] != '.' { + break + } + + // If our previous character was a star, then the current must + // be period. Otherwise, undo that and exit. + if byteLen > 0 && s[byteLen-1] == '*' && nextRune != '.' { + byteLen-- + if s[byteLen-1] == '.' { + byteLen-- + } + + break + } + byteLen = byteLen + size runeLen = runeLen + 1 } diff --git a/vendor/vendor.json b/vendor/vendor.json index 6dadc7a0a..a6277563f 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -1588,26 +1588,26 @@ { "checksumSHA1": "xONRNgLDc5OqCUmyDN3iBRKmKB0=", "path": "github.com/hashicorp/hil", - "revision": "bf046eec69cc383b7f32c47990336409601c8116", - "revisionTime": "2016-12-04T02:32:26Z" + "revision": "60db937199ba6f67251aa038cec18ce36a951312", + "revisionTime": "2016-12-09T17:20:46Z" }, { "checksumSHA1": "oZ2a2x9qyHqvqJdv/Du3LGeaFdA=", "path": "github.com/hashicorp/hil/ast", - "revision": "bf046eec69cc383b7f32c47990336409601c8116", - "revisionTime": "2016-12-04T02:32:26Z" + "revision": "60db937199ba6f67251aa038cec18ce36a951312", + "revisionTime": "2016-12-09T17:20:46Z" }, { - "checksumSHA1": "p/zZysJW/AaPXXPCI20nM2arPnw=", + "checksumSHA1": "P5PZ3k7SmqWmxgJ8Q0gLzeNpGhE=", "path": "github.com/hashicorp/hil/parser", - "revision": "bf046eec69cc383b7f32c47990336409601c8116", - "revisionTime": "2016-12-04T02:32:26Z" + "revision": "60db937199ba6f67251aa038cec18ce36a951312", + "revisionTime": "2016-12-09T17:20:46Z" }, { - "checksumSHA1": "FlzgVCYqnODad4pKujXhSaGcrIo=", + "checksumSHA1": "DC1k5kOua4oFqmo+JRt0YzfP44o=", "path": "github.com/hashicorp/hil/scanner", - "revision": "bf046eec69cc383b7f32c47990336409601c8116", - "revisionTime": "2016-12-04T02:32:26Z" + "revision": "60db937199ba6f67251aa038cec18ce36a951312", + "revisionTime": "2016-12-09T17:20:46Z" }, { "path": "github.com/hashicorp/logutils",