MCPcopy
hub / github.com/hashicorp/hcl / TokensForIdentifier

Function TokensForIdentifier

hclwrite/generate.go:55–59  ·  view source on GitHub ↗

TokensForIdentifier returns a sequence of tokens representing just the given identifier. In practice this function can only ever generate exactly one token, because an identifier is always a leaf token in the syntax tree. This is similar to calling TokensForTraversal with a single-step absolute tr

(name string)

Source from the content-addressed store, hash-verified

53// for this simple common case. If you need to generate a multi-step traversal,
54// use TokensForTraversal instead.
55func TokensForIdentifier(name string) Tokens {
56 return Tokens{
57 newIdentToken(name),
58 }
59}
60
61// TokensForTuple returns a sequence of tokens that represents a tuple
62// constructor, with element expressions populated from the given list

Callers 3

TokensForFunctionCallFunction · 0.85

Calls 1

newIdentTokenFunction · 0.85

Tested by 2