From d23a20ac41349e5f1cc7b60e76d1408069db498b Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Thu, 9 Jun 2022 14:52:04 -0700 Subject: [PATCH 1/4] Run "stringer" using "go run" In the modern Go Modules-based toolchain we can avoid the need to globally install this tool first by running it this way. As a bonus, the toolchain will also install the version of the module we have specified in go.mod, thereby locking us in to a particular version until we intentionally upgrade. The other third-party generator tools we use here aren't written in Go and so we can't do the same for those right now, but maybe we'll find a nicer way to handle those later too. --- hclsyntax/generate.go | 2 +- json/scanner.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hclsyntax/generate.go b/hclsyntax/generate.go index 383ec6b8..66486074 100644 --- a/hclsyntax/generate.go +++ b/hclsyntax/generate.go @@ -9,4 +9,4 @@ package hclsyntax //go:generate gofmt -w scan_tokens.go //go:generate ragel -Z scan_string_lit.rl //go:generate gofmt -w scan_string_lit.go -//go:generate stringer -type TokenType -output token_type_string.go +//go:generate go run golang.org/x/tools/cmd/stringer -type TokenType -output token_type_string.go diff --git a/json/scanner.go b/json/scanner.go index cae84859..a5e21305 100644 --- a/json/scanner.go +++ b/json/scanner.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/hcl/v2" ) -//go:generate stringer -type tokenType scanner.go +//go:generate go run golang.org/x/tools/cmd/stringer -type tokenType scanner.go type tokenType rune const ( From 83c95d29eef525594a70dd05027d93ff2f8f7c55 Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Thu, 9 Jun 2022 16:29:19 -0700 Subject: [PATCH 2/4] hclsyntax: Initial work on namespaced functions This introduces a new syntax which allows function names to have namespace prefixes, with the different name parts separated by a double-colon "::" as is common in various other C-derived languages which need to distinguish between scope resolution and attribute/field traversal. Because HCL has separate namespaces for functions and variables, we need to use different punctuation for each to avoid creating parsing ambiguity that could be resolved only with infinite lookahead. We cannot retroactively change the representation of function names to be a slice of names without breaking the existing API, and so we instead adopt a convention of packing the multi-part names into single strings which the parser guarantees will always be a series of valid identifiers separated by the literal "::" sequence. That means that applications will make namespaced functions available in the EvalContext by naming them in a way that matches this convention. This is still a subtle compatibility break for any implementation of the syntax-agnostic HCL API against another syntax, because it may now encounter function names in the function table that are not entirely valid identifiers. However, that's okay in practice because a calling application is always in full control of both which syntaxes it supports and which functions it places in the function table, and so an application using some other syntax can simply avoid using namespaced functions until that syntax is updated to understand the new convention. This initial commit only includes the basic functionality and does not yet update the specification or specification test suite. It also has only minimal unit tests of the parser and evaluator. Before finalizing this in a release we would need to complete that work to make sure everything is consistent and that we have sufficient regression tests for this new capability. --- hclsyntax/expression.go | 62 ++ hclsyntax/expression_test.go | 20 + hclsyntax/parser.go | 53 +- hclsyntax/scan_tokens.go | 1086 ++++++++++++++++---------------- hclsyntax/scan_tokens.rl | 2 + hclsyntax/scan_tokens_test.go | 60 ++ hclsyntax/token.go | 5 +- hclsyntax/token_type_string.go | 67 +- 8 files changed, 744 insertions(+), 611 deletions(-) diff --git a/hclsyntax/expression.go b/hclsyntax/expression.go index e0de1c3d..e81553b3 100644 --- a/hclsyntax/expression.go +++ b/hclsyntax/expression.go @@ -6,6 +6,7 @@ package hclsyntax import ( "fmt" "sort" + "strings" "sync" "github.com/hashicorp/hcl/v2" @@ -251,6 +252,67 @@ func (e *FunctionCallExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnosti } } + // For historical reasons, we represent namespaced function names + // as strings with :: separating the names. If this was an attempt + // to call a namespaced function then we'll try to distinguish + // between an invalid namespace or an invalid name within a valid + // namespace in order to give the user better feedback about what + // is wrong. + // + // The parser guarantees that a function name will always + // be a series of valid identifiers separated by "::" with no + // other content, so we can be relatively unforgiving in our processing + // here. + if sepIdx := strings.LastIndex(e.Name, "::"); sepIdx != -1 { + namespace := e.Name[:sepIdx+2] + name := e.Name[sepIdx+2:] + + avail := make([]string, 0, len(ctx.Functions)) + for availName := range ctx.Functions { + if strings.HasPrefix(availName, namespace) { + avail = append(avail, availName) + } + } + + if len(avail) == 0 { + // TODO: Maybe use nameSuggestion for the other available + // namespaces? But that'd require us to go scan the function + // table again, so we'll wait to see if it's really warranted. + // For now, we're assuming people are more likely to misremember + // the function names than the namespaces, because in many + // applications there will be relatively few namespaces compared + // to the number of distinct functions. + return cty.DynamicVal, hcl.Diagnostics{ + { + Severity: hcl.DiagError, + Summary: "Call to unknown function", + Detail: fmt.Sprintf("There are no functions in namespace %q.", namespace), + Subject: &e.NameRange, + Context: e.Range().Ptr(), + Expression: e, + EvalContext: ctx, + }, + } + } else { + suggestion := nameSuggestion(name, avail) + if suggestion != "" { + suggestion = fmt.Sprintf(" Did you mean %s%s?", namespace, suggestion) + } + + return cty.DynamicVal, hcl.Diagnostics{ + { + Severity: hcl.DiagError, + Summary: "Call to unknown function", + Detail: fmt.Sprintf("There is no function named %q in namespace %s.%s", name, namespace, suggestion), + Subject: &e.NameRange, + Context: e.Range().Ptr(), + Expression: e, + EvalContext: ctx, + }, + } + } + } + avail := make([]string, 0, len(ctx.Functions)) for name := range ctx.Functions { avail = append(avail, name) diff --git a/hclsyntax/expression_test.go b/hclsyntax/expression_test.go index e71dd310..72ff1596 100644 --- a/hclsyntax/expression_test.go +++ b/hclsyntax/expression_test.go @@ -342,6 +342,26 @@ upper( cty.DynamicVal, 0, }, + { + `foo::upper("foo")`, + &hcl.EvalContext{ + Functions: map[string]function.Function{ + "foo::upper": stdlib.UpperFunc, + }, + }, + cty.StringVal("FOO"), + 0, + }, + { + `foo :: upper("foo")`, // spaces are non-idomatic, but valid + &hcl.EvalContext{ + Functions: map[string]function.Function{ + "foo::upper": stdlib.UpperFunc, + }, + }, + cty.StringVal("FOO"), + 0, + }, { `misbehave()`, &hcl.EvalContext{ diff --git a/hclsyntax/parser.go b/hclsyntax/parser.go index aa147afe..20fa1481 100644 --- a/hclsyntax/parser.go +++ b/hclsyntax/parser.go @@ -999,7 +999,7 @@ func (p *parser) parseExpressionTerm() (Expression, hcl.Diagnostics) { case TokenIdent: tok := p.Read() // eat identifier token - if p.Peek().Type == TokenOParen { + if p.Peek().Type == TokenOParen || p.Peek().Type == TokenDoubleColon { return p.finishParsingFunctionCall(tok) } @@ -1145,16 +1145,57 @@ func (p *parser) numberLitValue(tok Token) (cty.Value, hcl.Diagnostics) { // finishParsingFunctionCall parses a function call assuming that the function // name was already read, and so the peeker should be pointing at the opening -// parenthesis after the name. +// parenthesis after the name, or at the double-colon after the initial +// function scope name. func (p *parser) finishParsingFunctionCall(name Token) (Expression, hcl.Diagnostics) { + var diags hcl.Diagnostics + openTok := p.Read() - if openTok.Type != TokenOParen { + if openTok.Type != TokenOParen && openTok.Type != TokenDoubleColon { // should never happen if callers behave - panic("finishParsingFunctionCall called with non-parenthesis as next token") + panic("finishParsingFunctionCall called with unsupported next token") + } + + nameStr := string(name.Bytes) + for openTok.Type == TokenDoubleColon { + nextName := p.Read() + if nextName.Type != TokenIdent { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Missing function name", + Detail: "Function scope resolution symbol :: must be followed by a function name in this scope.", + Subject: &nextName.Range, + Context: hcl.RangeBetween(name.Range, nextName.Range).Ptr(), + }) + p.recoverOver(TokenOParen) + return nil, diags + } + + // Initial versions of HCLv2 didn't support function namespaces, and + // so for backward compatibility we just treat namespaced functions + // as weird names with "::" separators in them, saved as a string + // to keep the API unchanged. FunctionCallExpr also has some special + // handling of names containing :: when referring to a function that + // doesn't exist in EvalContext, to return better error messages + // when namespaces are used incorrectly. + nameStr = nameStr + "::" + string(nextName.Bytes) + + openTok = p.Read() + } + + if openTok.Type != TokenOParen { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Missing open parenthesis", + Detail: "Function selector must be followed by an open parenthesis to begin the function call.", + Subject: &openTok.Range, + Context: hcl.RangeBetween(name.Range, openTok.Range).Ptr(), + }) + p.recoverOver(TokenOParen) + return nil, diags } var args []Expression - var diags hcl.Diagnostics var expandFinal bool var closeTok Token @@ -1245,7 +1286,7 @@ Token: p.PopIncludeNewlines() return &FunctionCallExpr{ - Name: string(name.Bytes), + Name: nameStr, Args: args, ExpandFinal: expandFinal, diff --git a/hclsyntax/scan_tokens.go b/hclsyntax/scan_tokens.go index 1bbbb927..3691f115 100644 --- a/hclsyntax/scan_tokens.go +++ b/hclsyntax/scan_tokens.go @@ -33,13 +33,13 @@ var _hcltok_actions []byte = []byte{ 1, 71, 1, 72, 1, 73, 1, 74, 1, 75, 1, 76, 1, 77, 1, 78, 1, 79, 1, 80, 1, 81, 1, 82, - 1, 83, 1, 84, 1, 85, 2, 0, - 14, 2, 0, 25, 2, 0, 29, 2, - 0, 37, 2, 0, 41, 2, 1, 2, - 2, 4, 5, 2, 4, 6, 2, 4, - 21, 2, 4, 22, 2, 4, 33, 2, - 4, 34, 2, 4, 45, 2, 4, 46, - 2, 4, 54, 2, 4, 55, + 1, 83, 1, 84, 1, 85, 1, 86, + 2, 0, 14, 2, 0, 25, 2, 0, + 29, 2, 0, 37, 2, 0, 41, 2, + 1, 2, 2, 4, 5, 2, 4, 6, + 2, 4, 21, 2, 4, 22, 2, 4, + 33, 2, 4, 34, 2, 4, 45, 2, + 4, 46, 2, 4, 54, 2, 4, 55, } var _hcltok_key_offsets []int16 = []int16{ @@ -225,22 +225,22 @@ var _hcltok_key_offsets []int16 = []int16{ 9153, 9171, 9172, 9182, 9183, 9192, 9200, 9202, 9205, 9207, 9209, 9211, 9216, 9229, 9233, 9248, 9277, 9288, 9290, 9294, 9298, 9303, 9307, 9309, - 9316, 9320, 9328, 9332, 9407, 9409, 9410, 9411, - 9412, 9413, 9414, 9416, 9421, 9423, 9425, 9426, - 9470, 9471, 9472, 9474, 9479, 9483, 9483, 9485, - 9487, 9498, 9508, 9516, 9517, 9519, 9520, 9524, - 9528, 9538, 9542, 9549, 9560, 9567, 9571, 9577, - 9588, 9620, 9669, 9684, 9699, 9704, 9706, 9711, - 9743, 9751, 9753, 9775, 9797, 9799, 9815, 9831, - 9833, 9835, 9835, 9836, 9837, 9838, 9840, 9841, - 9853, 9855, 9857, 9859, 9873, 9887, 9889, 9892, - 9895, 9897, 9898, 9899, 9901, 9903, 9905, 9919, - 9933, 9935, 9938, 9941, 9943, 9944, 9945, 9947, - 9949, 9951, 10000, 10044, 10046, 10051, 10055, 10055, - 10057, 10059, 10070, 10080, 10088, 10089, 10091, 10092, - 10096, 10100, 10110, 10114, 10121, 10132, 10139, 10143, - 10149, 10160, 10192, 10241, 10256, 10271, 10276, 10278, - 10283, 10315, 10323, 10325, 10347, 10369, + 9316, 9320, 9328, 9332, 9408, 9410, 9411, 9412, + 9413, 9414, 9415, 9417, 9422, 9423, 9425, 9427, + 9428, 9472, 9473, 9474, 9476, 9481, 9485, 9485, + 9487, 9489, 9500, 9510, 9518, 9519, 9521, 9522, + 9526, 9530, 9540, 9544, 9551, 9562, 9569, 9573, + 9579, 9590, 9622, 9671, 9686, 9701, 9706, 9708, + 9713, 9745, 9753, 9755, 9777, 9799, 9801, 9817, + 9833, 9835, 9837, 9837, 9838, 9839, 9840, 9842, + 9843, 9855, 9857, 9859, 9861, 9875, 9889, 9891, + 9894, 9897, 9899, 9900, 9901, 9903, 9905, 9907, + 9921, 9935, 9937, 9940, 9943, 9945, 9946, 9947, + 9949, 9951, 9953, 10002, 10046, 10048, 10053, 10057, + 10057, 10059, 10061, 10072, 10082, 10090, 10091, 10093, + 10094, 10098, 10102, 10112, 10116, 10123, 10134, 10141, + 10145, 10151, 10162, 10194, 10243, 10258, 10273, 10278, + 10280, 10285, 10317, 10325, 10327, 10349, 10371, } var _hcltok_trans_keys []byte = []byte{ @@ -1411,136 +1411,136 @@ var _hcltok_trans_keys []byte = []byte{ 187, 191, 192, 255, 162, 191, 192, 255, 160, 168, 128, 159, 161, 167, 169, 191, 158, 191, 192, 255, 9, 10, 13, 32, - 33, 34, 35, 38, 46, 47, 60, 61, - 62, 64, 92, 95, 123, 124, 125, 126, - 127, 194, 195, 198, 199, 203, 204, 205, - 206, 207, 210, 212, 213, 214, 215, 216, - 217, 219, 220, 221, 222, 223, 224, 225, - 226, 227, 228, 233, 234, 237, 238, 239, - 240, 0, 36, 37, 45, 48, 57, 58, - 63, 65, 90, 91, 96, 97, 122, 192, - 193, 196, 218, 229, 236, 241, 247, 9, - 32, 10, 61, 10, 38, 46, 42, 47, - 46, 69, 101, 48, 57, 60, 61, 61, - 62, 61, 45, 95, 194, 195, 198, 199, - 203, 204, 205, 206, 207, 210, 212, 213, - 214, 215, 216, 217, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 233, 234, - 237, 239, 240, 243, 48, 57, 65, 90, - 97, 122, 196, 218, 229, 236, 124, 125, - 128, 191, 170, 181, 186, 128, 191, 151, - 183, 128, 255, 192, 255, 0, 127, 173, - 130, 133, 146, 159, 165, 171, 175, 191, - 192, 255, 181, 190, 128, 175, 176, 183, - 184, 185, 186, 191, 134, 139, 141, 162, - 128, 135, 136, 255, 182, 130, 137, 176, - 151, 152, 154, 160, 136, 191, 192, 255, - 128, 143, 144, 170, 171, 175, 176, 178, - 179, 191, 128, 159, 160, 191, 176, 128, - 138, 139, 173, 174, 255, 148, 150, 164, - 167, 173, 176, 185, 189, 190, 192, 255, - 144, 128, 145, 146, 175, 176, 191, 128, - 140, 141, 255, 166, 176, 178, 191, 192, - 255, 186, 128, 137, 138, 170, 171, 179, - 180, 181, 182, 191, 160, 161, 162, 164, - 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 128, 191, 128, 129, 130, 131, - 137, 138, 139, 140, 141, 142, 143, 144, - 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 182, 183, 184, 188, - 189, 190, 191, 132, 187, 129, 130, 132, - 133, 134, 176, 177, 178, 179, 180, 181, - 182, 183, 128, 191, 128, 129, 130, 131, - 132, 133, 134, 135, 144, 136, 143, 145, - 191, 192, 255, 182, 183, 184, 128, 191, - 128, 191, 191, 128, 190, 192, 255, 128, - 146, 147, 148, 152, 153, 154, 155, 156, - 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 172, 173, - 174, 175, 176, 129, 191, 192, 255, 158, - 159, 128, 157, 160, 191, 192, 255, 128, - 191, 164, 169, 171, 172, 173, 174, 175, - 180, 181, 182, 183, 184, 185, 187, 188, - 189, 190, 191, 128, 163, 165, 186, 144, - 145, 146, 147, 148, 150, 151, 152, 155, - 157, 158, 160, 170, 171, 172, 175, 128, - 159, 161, 169, 173, 191, 128, 191, 10, - 13, 34, 36, 37, 92, 128, 191, 192, - 223, 224, 239, 240, 247, 248, 255, 10, - 13, 34, 92, 36, 37, 128, 191, 192, - 223, 224, 239, 240, 247, 248, 255, 10, - 13, 36, 123, 123, 126, 126, 37, 123, - 126, 10, 13, 128, 191, 192, 223, 224, - 239, 240, 247, 248, 255, 128, 191, 128, + 33, 34, 35, 38, 46, 47, 58, 60, + 61, 62, 64, 92, 95, 123, 124, 125, + 126, 127, 194, 195, 198, 199, 203, 204, + 205, 206, 207, 210, 212, 213, 214, 215, + 216, 217, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 233, 234, 237, 238, + 239, 240, 0, 36, 37, 45, 48, 57, + 59, 63, 65, 90, 91, 96, 97, 122, + 192, 193, 196, 218, 229, 236, 241, 247, + 9, 32, 10, 61, 10, 38, 46, 42, + 47, 46, 69, 101, 48, 57, 58, 60, + 61, 61, 62, 61, 45, 95, 194, 195, + 198, 199, 203, 204, 205, 206, 207, 210, + 212, 213, 214, 215, 216, 217, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, + 233, 234, 237, 239, 240, 243, 48, 57, + 65, 90, 97, 122, 196, 218, 229, 236, + 124, 125, 128, 191, 170, 181, 186, 128, + 191, 151, 183, 128, 255, 192, 255, 0, + 127, 173, 130, 133, 146, 159, 165, 171, + 175, 191, 192, 255, 181, 190, 128, 175, + 176, 183, 184, 185, 186, 191, 134, 139, + 141, 162, 128, 135, 136, 255, 182, 130, + 137, 176, 151, 152, 154, 160, 136, 191, + 192, 255, 128, 143, 144, 170, 171, 175, + 176, 178, 179, 191, 128, 159, 160, 191, + 176, 128, 138, 139, 173, 174, 255, 148, + 150, 164, 167, 173, 176, 185, 189, 190, + 192, 255, 144, 128, 145, 146, 175, 176, + 191, 128, 140, 141, 255, 166, 176, 178, + 191, 192, 255, 186, 128, 137, 138, 170, + 171, 179, 180, 181, 182, 191, 160, 161, + 162, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 128, 191, 128, 129, + 130, 131, 137, 138, 139, 140, 141, 142, + 143, 144, 153, 154, 155, 156, 157, 158, + 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 182, 183, + 184, 188, 189, 190, 191, 132, 187, 129, + 130, 132, 133, 134, 176, 177, 178, 179, + 180, 181, 182, 183, 128, 191, 128, 129, + 130, 131, 132, 133, 134, 135, 144, 136, + 143, 145, 191, 192, 255, 182, 183, 184, + 128, 191, 128, 191, 191, 128, 190, 192, + 255, 128, 146, 147, 148, 152, 153, 154, + 155, 156, 158, 159, 160, 161, 162, 163, + 164, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 129, 191, 192, + 255, 158, 159, 128, 157, 160, 191, 192, + 255, 128, 191, 164, 169, 171, 172, 173, + 174, 175, 180, 181, 182, 183, 184, 185, + 187, 188, 189, 190, 191, 128, 163, 165, + 186, 144, 145, 146, 147, 148, 150, 151, + 152, 155, 157, 158, 160, 170, 171, 172, + 175, 128, 159, 161, 169, 173, 191, 128, + 191, 10, 13, 34, 36, 37, 92, 128, + 191, 192, 223, 224, 239, 240, 247, 248, + 255, 10, 13, 34, 92, 36, 37, 128, + 191, 192, 223, 224, 239, 240, 247, 248, + 255, 10, 13, 36, 123, 123, 126, 126, + 37, 123, 126, 10, 13, 128, 191, 192, + 223, 224, 239, 240, 247, 248, 255, 128, + 191, 128, 191, 128, 191, 10, 13, 36, + 37, 128, 191, 192, 223, 224, 239, 240, + 247, 248, 255, 10, 13, 36, 37, 128, + 191, 192, 223, 224, 239, 240, 247, 248, + 255, 10, 13, 10, 13, 123, 10, 13, + 126, 10, 13, 126, 126, 128, 191, 128, 191, 128, 191, 10, 13, 36, 37, 128, 191, 192, 223, 224, 239, 240, 247, 248, 255, 10, 13, 36, 37, 128, 191, 192, 223, 224, 239, 240, 247, 248, 255, 10, 13, 10, 13, 123, 10, 13, 126, 10, 13, 126, 126, 128, 191, 128, 191, 128, - 191, 10, 13, 36, 37, 128, 191, 192, - 223, 224, 239, 240, 247, 248, 255, 10, - 13, 36, 37, 128, 191, 192, 223, 224, - 239, 240, 247, 248, 255, 10, 13, 10, - 13, 123, 10, 13, 126, 10, 13, 126, - 126, 128, 191, 128, 191, 128, 191, 95, - 194, 195, 198, 199, 203, 204, 205, 206, - 207, 210, 212, 213, 214, 215, 216, 217, - 219, 220, 221, 222, 223, 224, 225, 226, - 227, 228, 233, 234, 237, 238, 239, 240, - 65, 90, 97, 122, 128, 191, 192, 193, - 196, 218, 229, 236, 241, 247, 248, 255, - 45, 95, 194, 195, 198, 199, 203, 204, + 191, 95, 194, 195, 198, 199, 203, 204, 205, 206, 207, 210, 212, 213, 214, 215, 216, 217, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 233, 234, 237, 239, - 240, 243, 48, 57, 65, 90, 97, 122, - 196, 218, 229, 236, 128, 191, 170, 181, - 186, 128, 191, 151, 183, 128, 255, 192, - 255, 0, 127, 173, 130, 133, 146, 159, - 165, 171, 175, 191, 192, 255, 181, 190, - 128, 175, 176, 183, 184, 185, 186, 191, - 134, 139, 141, 162, 128, 135, 136, 255, - 182, 130, 137, 176, 151, 152, 154, 160, - 136, 191, 192, 255, 128, 143, 144, 170, - 171, 175, 176, 178, 179, 191, 128, 159, - 160, 191, 176, 128, 138, 139, 173, 174, - 255, 148, 150, 164, 167, 173, 176, 185, - 189, 190, 192, 255, 144, 128, 145, 146, - 175, 176, 191, 128, 140, 141, 255, 166, - 176, 178, 191, 192, 255, 186, 128, 137, - 138, 170, 171, 179, 180, 181, 182, 191, - 160, 161, 162, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 128, 191, - 128, 129, 130, 131, 137, 138, 139, 140, - 141, 142, 143, 144, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, - 182, 183, 184, 188, 189, 190, 191, 132, - 187, 129, 130, 132, 133, 134, 176, 177, - 178, 179, 180, 181, 182, 183, 128, 191, - 128, 129, 130, 131, 132, 133, 134, 135, - 144, 136, 143, 145, 191, 192, 255, 182, - 183, 184, 128, 191, 128, 191, 191, 128, - 190, 192, 255, 128, 146, 147, 148, 152, - 153, 154, 155, 156, 158, 159, 160, 161, - 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 129, - 191, 192, 255, 158, 159, 128, 157, 160, - 191, 192, 255, 128, 191, 164, 169, 171, - 172, 173, 174, 175, 180, 181, 182, 183, - 184, 185, 187, 188, 189, 190, 191, 128, - 163, 165, 186, 144, 145, 146, 147, 148, - 150, 151, 152, 155, 157, 158, 160, 170, - 171, 172, 175, 128, 159, 161, 169, 173, - 191, 128, 191, + 225, 226, 227, 228, 233, 234, 237, 238, + 239, 240, 65, 90, 97, 122, 128, 191, + 192, 193, 196, 218, 229, 236, 241, 247, + 248, 255, 45, 95, 194, 195, 198, 199, + 203, 204, 205, 206, 207, 210, 212, 213, + 214, 215, 216, 217, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 233, 234, + 237, 239, 240, 243, 48, 57, 65, 90, + 97, 122, 196, 218, 229, 236, 128, 191, + 170, 181, 186, 128, 191, 151, 183, 128, + 255, 192, 255, 0, 127, 173, 130, 133, + 146, 159, 165, 171, 175, 191, 192, 255, + 181, 190, 128, 175, 176, 183, 184, 185, + 186, 191, 134, 139, 141, 162, 128, 135, + 136, 255, 182, 130, 137, 176, 151, 152, + 154, 160, 136, 191, 192, 255, 128, 143, + 144, 170, 171, 175, 176, 178, 179, 191, + 128, 159, 160, 191, 176, 128, 138, 139, + 173, 174, 255, 148, 150, 164, 167, 173, + 176, 185, 189, 190, 192, 255, 144, 128, + 145, 146, 175, 176, 191, 128, 140, 141, + 255, 166, 176, 178, 191, 192, 255, 186, + 128, 137, 138, 170, 171, 179, 180, 181, + 182, 191, 160, 161, 162, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, + 128, 191, 128, 129, 130, 131, 137, 138, + 139, 140, 141, 142, 143, 144, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 182, 183, 184, 188, 189, 190, + 191, 132, 187, 129, 130, 132, 133, 134, + 176, 177, 178, 179, 180, 181, 182, 183, + 128, 191, 128, 129, 130, 131, 132, 133, + 134, 135, 144, 136, 143, 145, 191, 192, + 255, 182, 183, 184, 128, 191, 128, 191, + 191, 128, 190, 192, 255, 128, 146, 147, + 148, 152, 153, 154, 155, 156, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, + 176, 129, 191, 192, 255, 158, 159, 128, + 157, 160, 191, 192, 255, 128, 191, 164, + 169, 171, 172, 173, 174, 175, 180, 181, + 182, 183, 184, 185, 187, 188, 189, 190, + 191, 128, 163, 165, 186, 144, 145, 146, + 147, 148, 150, 151, 152, 155, 157, 158, + 160, 170, 171, 172, 175, 128, 159, 161, + 169, 173, 191, 128, 191, } var _hcltok_single_lengths []byte = []byte{ @@ -1726,22 +1726,22 @@ var _hcltok_single_lengths []byte = []byte{ 12, 1, 4, 1, 5, 2, 0, 3, 2, 2, 2, 1, 7, 0, 7, 17, 3, 0, 2, 0, 3, 0, 0, 1, - 0, 2, 0, 53, 2, 1, 1, 1, - 1, 1, 2, 3, 2, 2, 1, 34, - 1, 1, 0, 3, 2, 0, 0, 0, - 1, 2, 4, 1, 0, 1, 0, 0, - 0, 0, 1, 1, 1, 0, 0, 1, - 30, 47, 13, 9, 3, 0, 1, 28, - 2, 0, 18, 16, 0, 6, 4, 2, - 2, 0, 1, 1, 1, 2, 1, 2, - 0, 0, 0, 4, 2, 2, 3, 3, - 2, 1, 1, 0, 0, 0, 4, 2, - 2, 3, 3, 2, 1, 1, 0, 0, - 0, 33, 34, 0, 3, 2, 0, 0, + 0, 2, 0, 54, 2, 1, 1, 1, + 1, 1, 2, 3, 1, 2, 2, 1, + 34, 1, 1, 0, 3, 2, 0, 0, 0, 1, 2, 4, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 30, 47, 13, 9, 3, 0, 1, - 28, 2, 0, 18, 16, 0, + 28, 2, 0, 18, 16, 0, 6, 4, + 2, 2, 0, 1, 1, 1, 2, 1, + 2, 0, 0, 0, 4, 2, 2, 3, + 3, 2, 1, 1, 0, 0, 0, 4, + 2, 2, 3, 3, 2, 1, 1, 0, + 0, 0, 33, 34, 0, 3, 2, 0, + 0, 0, 1, 2, 4, 1, 0, 1, + 0, 0, 0, 0, 1, 1, 1, 0, + 0, 1, 30, 47, 13, 9, 3, 0, + 1, 28, 2, 0, 18, 16, 0, } var _hcltok_range_lengths []byte = []byte{ @@ -1928,21 +1928,21 @@ var _hcltok_range_lengths []byte = []byte{ 0, 0, 0, 2, 3, 2, 4, 6, 4, 1, 1, 2, 1, 2, 1, 3, 2, 3, 2, 11, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 5, - 0, 0, 1, 1, 1, 0, 1, 1, - 5, 4, 2, 0, 1, 0, 2, 2, - 5, 2, 3, 5, 3, 2, 3, 5, - 1, 1, 1, 3, 1, 1, 2, 2, - 3, 1, 2, 3, 1, 5, 6, 0, - 0, 0, 0, 0, 0, 0, 0, 5, - 1, 1, 1, 5, 6, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 5, 6, - 0, 0, 0, 0, 0, 0, 1, 1, - 1, 8, 5, 1, 1, 1, 0, 1, + 0, 0, 0, 1, 0, 0, 0, 0, + 5, 0, 0, 1, 1, 1, 0, 1, 1, 5, 4, 2, 0, 1, 0, 2, 2, 5, 2, 3, 5, 3, 2, 3, 5, 1, 1, 1, 3, 1, 1, 2, - 2, 3, 1, 2, 3, 1, + 2, 3, 1, 2, 3, 1, 5, 6, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 1, 1, 1, 5, 6, 0, 0, + 0, 0, 0, 0, 1, 1, 1, 5, + 6, 0, 0, 0, 0, 0, 0, 1, + 1, 1, 8, 5, 1, 1, 1, 0, + 1, 1, 5, 4, 2, 0, 1, 0, + 2, 2, 5, 2, 3, 5, 3, 2, + 3, 5, 1, 1, 1, 3, 1, 1, + 2, 2, 3, 1, 2, 3, 1, } var _hcltok_index_offsets []int16 = []int16{ @@ -2128,22 +2128,22 @@ var _hcltok_index_offsets []int16 = []int16{ 7187, 7203, 7205, 7213, 7215, 7223, 7229, 7231, 7235, 7238, 7241, 7244, 7248, 7259, 7262, 7274, 7298, 7306, 7308, 7312, 7315, 7320, 7323, 7325, - 7330, 7333, 7339, 7342, 7407, 7410, 7412, 7414, - 7416, 7418, 7420, 7423, 7428, 7431, 7434, 7436, - 7476, 7478, 7480, 7482, 7487, 7491, 7492, 7494, - 7496, 7503, 7510, 7517, 7519, 7521, 7523, 7526, - 7529, 7535, 7538, 7543, 7550, 7555, 7558, 7562, - 7569, 7601, 7650, 7665, 7678, 7683, 7685, 7689, - 7720, 7726, 7728, 7749, 7769, 7771, 7783, 7794, - 7797, 7800, 7801, 7803, 7805, 7807, 7810, 7812, - 7820, 7822, 7824, 7826, 7836, 7845, 7848, 7852, - 7856, 7859, 7861, 7863, 7865, 7867, 7869, 7879, - 7888, 7891, 7895, 7899, 7902, 7904, 7906, 7908, - 7910, 7912, 7954, 7994, 7996, 8001, 8005, 8006, - 8008, 8010, 8017, 8024, 8031, 8033, 8035, 8037, - 8040, 8043, 8049, 8052, 8057, 8064, 8069, 8072, - 8076, 8083, 8115, 8164, 8179, 8192, 8197, 8199, - 8203, 8234, 8240, 8242, 8263, 8283, + 7330, 7333, 7339, 7342, 7408, 7411, 7413, 7415, + 7417, 7419, 7421, 7424, 7429, 7431, 7434, 7437, + 7439, 7479, 7481, 7483, 7485, 7490, 7494, 7495, + 7497, 7499, 7506, 7513, 7520, 7522, 7524, 7526, + 7529, 7532, 7538, 7541, 7546, 7553, 7558, 7561, + 7565, 7572, 7604, 7653, 7668, 7681, 7686, 7688, + 7692, 7723, 7729, 7731, 7752, 7772, 7774, 7786, + 7797, 7800, 7803, 7804, 7806, 7808, 7810, 7813, + 7815, 7823, 7825, 7827, 7829, 7839, 7848, 7851, + 7855, 7859, 7862, 7864, 7866, 7868, 7870, 7872, + 7882, 7891, 7894, 7898, 7902, 7905, 7907, 7909, + 7911, 7913, 7915, 7957, 7997, 7999, 8004, 8008, + 8009, 8011, 8013, 8020, 8027, 8034, 8036, 8038, + 8040, 8043, 8046, 8052, 8055, 8060, 8067, 8072, + 8075, 8079, 8086, 8118, 8167, 8182, 8195, 8200, + 8202, 8206, 8237, 8243, 8245, 8266, 8286, } var _hcltok_indicies []int16 = []int16{ @@ -3066,123 +3066,123 @@ var _hcltok_indicies []int16 = []int16{ 1045, 801, 1046, 1045, 795, 1050, 1141, 1047, 1059, 1047, 1045, 1046, 1045, 795, 1142, 1143, 1144, 1142, 1145, 1146, 1147, 1149, 1150, 1151, - 1152, 1153, 1154, 670, 670, 419, 1155, 1156, - 1157, 1158, 670, 1161, 1162, 1164, 1165, 1166, - 1160, 1167, 1168, 1169, 1170, 1171, 1172, 1173, + 1152, 1153, 1154, 1155, 670, 670, 419, 1156, + 1157, 1158, 1159, 670, 1162, 1163, 1165, 1166, + 1167, 1161, 1168, 1169, 1170, 1171, 1172, 1173, 1174, 1175, 1176, 1177, 1178, 1179, 1180, 1181, - 1182, 1183, 1184, 1185, 1186, 1188, 1189, 1190, - 1191, 1192, 1193, 670, 1148, 7, 1148, 419, - 1148, 419, 1160, 1163, 1187, 1194, 1159, 1142, - 1142, 1195, 1143, 1196, 1198, 1197, 4, 1147, - 1200, 1197, 1201, 1197, 2, 1147, 1197, 6, - 8, 8, 7, 1202, 1203, 1204, 1197, 1205, - 1206, 1197, 1207, 1197, 419, 419, 1209, 1210, - 489, 470, 1211, 470, 1212, 1213, 1214, 1215, - 1216, 1217, 1218, 1219, 1220, 1221, 1222, 544, - 1223, 520, 1224, 1225, 1226, 1227, 1228, 1229, - 1230, 1231, 1232, 1233, 1234, 1235, 419, 419, - 419, 425, 565, 1208, 1236, 1197, 1237, 1197, - 670, 1238, 419, 419, 419, 670, 1238, 670, - 670, 419, 1238, 419, 1238, 419, 1238, 419, - 670, 670, 670, 670, 670, 1238, 419, 670, - 670, 670, 419, 670, 419, 1238, 419, 670, - 670, 670, 670, 419, 1238, 670, 419, 670, - 419, 670, 419, 670, 670, 419, 670, 1238, - 419, 670, 419, 670, 419, 670, 1238, 670, - 419, 1238, 670, 419, 670, 419, 1238, 670, - 670, 670, 670, 670, 1238, 419, 419, 670, - 419, 670, 1238, 670, 419, 1238, 670, 670, - 1238, 419, 419, 670, 419, 670, 419, 670, - 1238, 1239, 1240, 1241, 1242, 1243, 1244, 1245, - 1246, 1247, 1248, 1249, 715, 1250, 1251, 1252, - 1253, 1254, 1255, 1256, 1257, 1258, 1259, 1260, - 1261, 1260, 1262, 1263, 1264, 1265, 1266, 671, - 1238, 1267, 1268, 1269, 1270, 1271, 1272, 1273, - 1274, 1275, 1276, 1277, 1278, 1279, 1280, 1281, - 1282, 1283, 1284, 1285, 725, 1286, 1287, 1288, - 692, 1289, 1290, 1291, 1292, 1293, 1294, 671, - 1295, 1296, 1297, 1298, 1299, 1300, 1301, 1302, - 674, 1303, 671, 674, 1304, 1305, 1306, 1307, - 683, 1238, 1308, 1309, 1310, 1311, 703, 1312, - 1313, 683, 1314, 1315, 1316, 1317, 1318, 671, - 1238, 1319, 1278, 1320, 1321, 1322, 683, 1323, - 1324, 674, 671, 683, 425, 1238, 1288, 671, - 674, 683, 425, 683, 425, 1325, 683, 1238, - 425, 674, 1326, 1327, 674, 1328, 1329, 681, - 1330, 1331, 1332, 1333, 1334, 1284, 1335, 1336, - 1337, 1338, 1339, 1340, 1341, 1342, 1343, 1344, - 1345, 1346, 1303, 1347, 674, 683, 425, 1238, - 1348, 1349, 683, 671, 1238, 425, 671, 1238, - 674, 1350, 731, 1351, 1352, 1353, 1354, 1355, - 1356, 1357, 1358, 671, 1359, 1360, 1361, 1362, - 1363, 1364, 671, 683, 1238, 1366, 1367, 1368, - 1369, 1370, 1371, 1372, 1373, 1374, 1375, 1376, - 1372, 1378, 1379, 1380, 1381, 1365, 1377, 1365, - 1238, 1365, 1238, 1382, 1382, 1383, 1384, 1385, - 1386, 1387, 1388, 1389, 1390, 1387, 767, 1391, - 1391, 1391, 1392, 1391, 1391, 768, 769, 770, - 1391, 767, 1382, 1382, 1393, 1396, 1397, 1395, - 1398, 1399, 1398, 1400, 1391, 1402, 1401, 1396, - 1403, 1395, 1405, 1404, 1394, 1394, 1394, 768, - 769, 770, 1394, 767, 767, 1406, 773, 1406, - 1407, 1406, 775, 1408, 1409, 1410, 1411, 1412, - 1413, 1414, 1411, 776, 775, 1408, 1415, 1415, - 777, 779, 1416, 1415, 776, 1418, 1419, 1417, - 1418, 1419, 1420, 1417, 775, 1408, 1421, 1415, - 775, 1408, 1415, 1423, 1422, 1425, 1424, 776, - 1426, 777, 1426, 779, 1426, 785, 1427, 1428, - 1429, 1430, 1431, 1432, 1433, 1430, 786, 785, - 1427, 1434, 1434, 787, 789, 1435, 1434, 786, - 1437, 1438, 1436, 1437, 1438, 1439, 1436, 785, - 1427, 1440, 1434, 785, 1427, 1434, 1442, 1441, - 1444, 1443, 786, 1445, 787, 1445, 789, 1445, - 795, 1448, 1449, 1451, 1452, 1453, 1447, 1454, - 1455, 1456, 1457, 1458, 1459, 1460, 1461, 1462, - 1463, 1464, 1465, 1466, 1467, 1468, 1469, 1470, - 1471, 1472, 1473, 1475, 1476, 1477, 1478, 1479, - 1480, 795, 795, 1446, 1447, 1450, 1474, 1481, - 1446, 1046, 795, 795, 1483, 1484, 865, 846, - 1485, 846, 1486, 1487, 1488, 1489, 1490, 1491, - 1492, 1493, 1494, 1495, 1496, 920, 1497, 896, - 1498, 1499, 1500, 1501, 1502, 1503, 1504, 1505, - 1506, 1507, 1508, 1509, 795, 795, 795, 801, - 941, 1482, 1046, 1510, 795, 795, 795, 1046, - 1510, 1046, 1046, 795, 1510, 795, 1510, 795, - 1510, 795, 1046, 1046, 1046, 1046, 1046, 1510, - 795, 1046, 1046, 1046, 795, 1046, 795, 1510, - 795, 1046, 1046, 1046, 1046, 795, 1510, 1046, - 795, 1046, 795, 1046, 795, 1046, 1046, 795, - 1046, 1510, 795, 1046, 795, 1046, 795, 1046, - 1510, 1046, 795, 1510, 1046, 795, 1046, 795, - 1510, 1046, 1046, 1046, 1046, 1046, 1510, 795, - 795, 1046, 795, 1046, 1510, 1046, 795, 1510, - 1046, 1046, 1510, 795, 795, 1046, 795, 1046, - 795, 1046, 1510, 1511, 1512, 1513, 1514, 1515, - 1516, 1517, 1518, 1519, 1520, 1521, 1091, 1522, - 1523, 1524, 1525, 1526, 1527, 1528, 1529, 1530, - 1531, 1532, 1533, 1532, 1534, 1535, 1536, 1537, - 1538, 1047, 1510, 1539, 1540, 1541, 1542, 1543, - 1544, 1545, 1546, 1547, 1548, 1549, 1550, 1551, - 1552, 1553, 1554, 1555, 1556, 1557, 1101, 1558, - 1559, 1560, 1068, 1561, 1562, 1563, 1564, 1565, - 1566, 1047, 1567, 1568, 1569, 1570, 1571, 1572, - 1573, 1574, 1050, 1575, 1047, 1050, 1576, 1577, - 1578, 1579, 1059, 1510, 1580, 1581, 1582, 1583, - 1079, 1584, 1585, 1059, 1586, 1587, 1588, 1589, - 1590, 1047, 1510, 1591, 1550, 1592, 1593, 1594, - 1059, 1595, 1596, 1050, 1047, 1059, 801, 1510, - 1560, 1047, 1050, 1059, 801, 1059, 801, 1597, - 1059, 1510, 801, 1050, 1598, 1599, 1050, 1600, - 1601, 1057, 1602, 1603, 1604, 1605, 1606, 1556, - 1607, 1608, 1609, 1610, 1611, 1612, 1613, 1614, - 1615, 1616, 1617, 1618, 1575, 1619, 1050, 1059, - 801, 1510, 1620, 1621, 1059, 1047, 1510, 801, - 1047, 1510, 1050, 1622, 1107, 1623, 1624, 1625, - 1626, 1627, 1628, 1629, 1630, 1047, 1631, 1632, - 1633, 1634, 1635, 1636, 1047, 1059, 1510, 1638, - 1639, 1640, 1641, 1642, 1643, 1644, 1645, 1646, - 1647, 1648, 1644, 1650, 1651, 1652, 1653, 1637, - 1649, 1637, 1510, 1637, 1510, + 1182, 1183, 1184, 1185, 1186, 1187, 1189, 1190, + 1191, 1192, 1193, 1194, 670, 1148, 7, 1148, + 419, 1148, 419, 1161, 1164, 1188, 1195, 1160, + 1142, 1142, 1196, 1143, 1197, 1199, 1198, 4, + 1147, 1201, 1198, 1202, 1198, 2, 1147, 1198, + 6, 8, 8, 7, 1203, 1204, 1198, 1205, + 1206, 1198, 1207, 1208, 1198, 1209, 1198, 419, + 419, 1211, 1212, 489, 470, 1213, 470, 1214, + 1215, 1216, 1217, 1218, 1219, 1220, 1221, 1222, + 1223, 1224, 544, 1225, 520, 1226, 1227, 1228, + 1229, 1230, 1231, 1232, 1233, 1234, 1235, 1236, + 1237, 419, 419, 419, 425, 565, 1210, 1238, + 1198, 1239, 1198, 670, 1240, 419, 419, 419, + 670, 1240, 670, 670, 419, 1240, 419, 1240, + 419, 1240, 419, 670, 670, 670, 670, 670, + 1240, 419, 670, 670, 670, 419, 670, 419, + 1240, 419, 670, 670, 670, 670, 419, 1240, + 670, 419, 670, 419, 670, 419, 670, 670, + 419, 670, 1240, 419, 670, 419, 670, 419, + 670, 1240, 670, 419, 1240, 670, 419, 670, + 419, 1240, 670, 670, 670, 670, 670, 1240, + 419, 419, 670, 419, 670, 1240, 670, 419, + 1240, 670, 670, 1240, 419, 419, 670, 419, + 670, 419, 670, 1240, 1241, 1242, 1243, 1244, + 1245, 1246, 1247, 1248, 1249, 1250, 1251, 715, + 1252, 1253, 1254, 1255, 1256, 1257, 1258, 1259, + 1260, 1261, 1262, 1263, 1262, 1264, 1265, 1266, + 1267, 1268, 671, 1240, 1269, 1270, 1271, 1272, + 1273, 1274, 1275, 1276, 1277, 1278, 1279, 1280, + 1281, 1282, 1283, 1284, 1285, 1286, 1287, 725, + 1288, 1289, 1290, 692, 1291, 1292, 1293, 1294, + 1295, 1296, 671, 1297, 1298, 1299, 1300, 1301, + 1302, 1303, 1304, 674, 1305, 671, 674, 1306, + 1307, 1308, 1309, 683, 1240, 1310, 1311, 1312, + 1313, 703, 1314, 1315, 683, 1316, 1317, 1318, + 1319, 1320, 671, 1240, 1321, 1280, 1322, 1323, + 1324, 683, 1325, 1326, 674, 671, 683, 425, + 1240, 1290, 671, 674, 683, 425, 683, 425, + 1327, 683, 1240, 425, 674, 1328, 1329, 674, + 1330, 1331, 681, 1332, 1333, 1334, 1335, 1336, + 1286, 1337, 1338, 1339, 1340, 1341, 1342, 1343, + 1344, 1345, 1346, 1347, 1348, 1305, 1349, 674, + 683, 425, 1240, 1350, 1351, 683, 671, 1240, + 425, 671, 1240, 674, 1352, 731, 1353, 1354, + 1355, 1356, 1357, 1358, 1359, 1360, 671, 1361, + 1362, 1363, 1364, 1365, 1366, 671, 683, 1240, + 1368, 1369, 1370, 1371, 1372, 1373, 1374, 1375, + 1376, 1377, 1378, 1374, 1380, 1381, 1382, 1383, + 1367, 1379, 1367, 1240, 1367, 1240, 1384, 1384, + 1385, 1386, 1387, 1388, 1389, 1390, 1391, 1392, + 1389, 767, 1393, 1393, 1393, 1394, 1393, 1393, + 768, 769, 770, 1393, 767, 1384, 1384, 1395, + 1398, 1399, 1397, 1400, 1401, 1400, 1402, 1393, + 1404, 1403, 1398, 1405, 1397, 1407, 1406, 1396, + 1396, 1396, 768, 769, 770, 1396, 767, 767, + 1408, 773, 1408, 1409, 1408, 775, 1410, 1411, + 1412, 1413, 1414, 1415, 1416, 1413, 776, 775, + 1410, 1417, 1417, 777, 779, 1418, 1417, 776, + 1420, 1421, 1419, 1420, 1421, 1422, 1419, 775, + 1410, 1423, 1417, 775, 1410, 1417, 1425, 1424, + 1427, 1426, 776, 1428, 777, 1428, 779, 1428, + 785, 1429, 1430, 1431, 1432, 1433, 1434, 1435, + 1432, 786, 785, 1429, 1436, 1436, 787, 789, + 1437, 1436, 786, 1439, 1440, 1438, 1439, 1440, + 1441, 1438, 785, 1429, 1442, 1436, 785, 1429, + 1436, 1444, 1443, 1446, 1445, 786, 1447, 787, + 1447, 789, 1447, 795, 1450, 1451, 1453, 1454, + 1455, 1449, 1456, 1457, 1458, 1459, 1460, 1461, + 1462, 1463, 1464, 1465, 1466, 1467, 1468, 1469, + 1470, 1471, 1472, 1473, 1474, 1475, 1477, 1478, + 1479, 1480, 1481, 1482, 795, 795, 1448, 1449, + 1452, 1476, 1483, 1448, 1046, 795, 795, 1485, + 1486, 865, 846, 1487, 846, 1488, 1489, 1490, + 1491, 1492, 1493, 1494, 1495, 1496, 1497, 1498, + 920, 1499, 896, 1500, 1501, 1502, 1503, 1504, + 1505, 1506, 1507, 1508, 1509, 1510, 1511, 795, + 795, 795, 801, 941, 1484, 1046, 1512, 795, + 795, 795, 1046, 1512, 1046, 1046, 795, 1512, + 795, 1512, 795, 1512, 795, 1046, 1046, 1046, + 1046, 1046, 1512, 795, 1046, 1046, 1046, 795, + 1046, 795, 1512, 795, 1046, 1046, 1046, 1046, + 795, 1512, 1046, 795, 1046, 795, 1046, 795, + 1046, 1046, 795, 1046, 1512, 795, 1046, 795, + 1046, 795, 1046, 1512, 1046, 795, 1512, 1046, + 795, 1046, 795, 1512, 1046, 1046, 1046, 1046, + 1046, 1512, 795, 795, 1046, 795, 1046, 1512, + 1046, 795, 1512, 1046, 1046, 1512, 795, 795, + 1046, 795, 1046, 795, 1046, 1512, 1513, 1514, + 1515, 1516, 1517, 1518, 1519, 1520, 1521, 1522, + 1523, 1091, 1524, 1525, 1526, 1527, 1528, 1529, + 1530, 1531, 1532, 1533, 1534, 1535, 1534, 1536, + 1537, 1538, 1539, 1540, 1047, 1512, 1541, 1542, + 1543, 1544, 1545, 1546, 1547, 1548, 1549, 1550, + 1551, 1552, 1553, 1554, 1555, 1556, 1557, 1558, + 1559, 1101, 1560, 1561, 1562, 1068, 1563, 1564, + 1565, 1566, 1567, 1568, 1047, 1569, 1570, 1571, + 1572, 1573, 1574, 1575, 1576, 1050, 1577, 1047, + 1050, 1578, 1579, 1580, 1581, 1059, 1512, 1582, + 1583, 1584, 1585, 1079, 1586, 1587, 1059, 1588, + 1589, 1590, 1591, 1592, 1047, 1512, 1593, 1552, + 1594, 1595, 1596, 1059, 1597, 1598, 1050, 1047, + 1059, 801, 1512, 1562, 1047, 1050, 1059, 801, + 1059, 801, 1599, 1059, 1512, 801, 1050, 1600, + 1601, 1050, 1602, 1603, 1057, 1604, 1605, 1606, + 1607, 1608, 1558, 1609, 1610, 1611, 1612, 1613, + 1614, 1615, 1616, 1617, 1618, 1619, 1620, 1577, + 1621, 1050, 1059, 801, 1512, 1622, 1623, 1059, + 1047, 1512, 801, 1047, 1512, 1050, 1624, 1107, + 1625, 1626, 1627, 1628, 1629, 1630, 1631, 1632, + 1047, 1633, 1634, 1635, 1636, 1637, 1638, 1047, + 1059, 1512, 1640, 1641, 1642, 1643, 1644, 1645, + 1646, 1647, 1648, 1649, 1650, 1646, 1652, 1653, + 1654, 1655, 1639, 1651, 1639, 1512, 1639, 1512, } var _hcltok_trans_targs []int16 = []int16{ @@ -3238,7 +3238,7 @@ var _hcltok_trans_targs []int16 = []int16{ 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 405, 406, 407, 408, 410, - 412, 414, 1459, 1471, 1459, 437, 438, 439, + 412, 414, 1459, 1472, 1459, 437, 438, 439, 440, 417, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, @@ -3281,11 +3281,11 @@ var _hcltok_trans_targs []int16 = []int16{ 888, 889, 890, 891, 892, 895, 896, 898, 899, 900, 902, 903, 904, 905, 906, 907, 908, 909, 910, 911, 912, 914, 915, 916, - 917, 920, 922, 923, 925, 927, 1509, 1510, - 929, 930, 931, 1509, 1509, 932, 1523, 1523, - 1524, 935, 1523, 936, 1525, 1526, 1529, 1530, - 1534, 1534, 1535, 941, 1534, 942, 1536, 1537, - 1540, 1541, 1545, 1546, 1545, 968, 969, 970, + 917, 920, 922, 923, 925, 927, 1510, 1511, + 929, 930, 931, 1510, 1510, 932, 1524, 1524, + 1525, 935, 1524, 936, 1526, 1527, 1530, 1531, + 1535, 1535, 1536, 941, 1535, 942, 1537, 1538, + 1541, 1542, 1546, 1547, 1546, 968, 969, 970, 971, 948, 972, 973, 974, 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, 989, 990, 991, 992, 993, @@ -3316,7 +3316,7 @@ var _hcltok_trans_targs []int16 = []int16{ 1186, 1187, 1188, 1189, 1190, 1191, 1192, 1193, 1194, 1195, 1196, 1197, 1198, 1199, 1200, 1201, 1202, 1204, 1205, 1206, 1207, 1208, 1209, 1211, - 1213, 1215, 1217, 1219, 1220, 1545, 1545, 1221, + 1213, 1215, 1217, 1219, 1220, 1546, 1546, 1221, 1358, 1359, 1290, 1360, 1361, 1362, 1363, 1364, 1365, 1319, 1366, 1255, 1367, 1368, 1369, 1370, 1371, 1372, 1373, 1374, 1275, 1375, 1376, 1377, @@ -3330,78 +3330,78 @@ var _hcltok_trans_targs []int16 = []int16{ 1439, 1440, 1441, 1442, 1443, 1445, 1446, 1447, 1448, 1451, 1453, 1454, 1456, 1458, 1460, 1459, 1461, 1462, 1459, 1463, 1459, 1464, 1465, 1466, - 1468, 1469, 1470, 1459, 1472, 1459, 1473, 1459, - 1474, 1475, 1476, 1477, 1478, 1479, 1480, 1481, + 1468, 1469, 1470, 1471, 1459, 1473, 1459, 1474, + 1459, 1475, 1476, 1477, 1478, 1479, 1480, 1481, 1482, 1483, 1484, 1485, 1486, 1487, 1488, 1489, 1490, 1491, 1492, 1493, 1494, 1495, 1496, 1497, 1498, 1499, 1500, 1501, 1502, 1503, 1504, 1505, - 1506, 1507, 1508, 1459, 1459, 1459, 1459, 1459, - 1459, 1, 1459, 7, 1459, 1459, 1459, 1459, - 1459, 415, 416, 420, 421, 422, 423, 424, - 425, 426, 427, 428, 429, 430, 431, 433, - 435, 436, 468, 509, 524, 531, 533, 535, - 555, 558, 574, 687, 1459, 1459, 1459, 691, - 692, 693, 694, 695, 696, 697, 698, 699, - 700, 701, 703, 704, 705, 706, 707, 708, - 709, 710, 711, 712, 713, 714, 715, 716, - 717, 718, 719, 720, 721, 722, 723, 725, - 726, 727, 728, 729, 730, 731, 732, 733, - 734, 735, 736, 737, 738, 739, 741, 742, - 743, 745, 746, 747, 748, 749, 750, 751, - 752, 753, 754, 755, 756, 757, 758, 760, - 761, 762, 763, 764, 765, 766, 767, 768, - 770, 771, 772, 773, 774, 775, 776, 777, - 778, 779, 780, 781, 782, 783, 784, 785, - 786, 787, 789, 790, 791, 792, 793, 794, - 795, 796, 797, 798, 799, 800, 801, 802, - 803, 804, 805, 806, 807, 808, 809, 811, - 812, 813, 814, 815, 816, 817, 818, 819, - 820, 821, 822, 823, 824, 825, 826, 855, - 880, 883, 884, 886, 893, 894, 897, 901, - 913, 918, 919, 921, 924, 926, 1511, 1509, - 1512, 1517, 1519, 1509, 1520, 1521, 1522, 1509, - 928, 1509, 1509, 1513, 1514, 1516, 1509, 1515, - 1509, 1509, 1509, 1518, 1509, 1509, 1509, 933, - 934, 938, 939, 1523, 1531, 1532, 1533, 1523, - 937, 1523, 1523, 934, 1527, 1528, 1523, 1523, - 1523, 1523, 1523, 940, 944, 945, 1534, 1542, - 1543, 1544, 1534, 943, 1534, 1534, 940, 1538, - 1539, 1534, 1534, 1534, 1534, 1534, 1545, 1547, - 1548, 1549, 1550, 1551, 1552, 1553, 1554, 1555, - 1556, 1557, 1558, 1559, 1560, 1561, 1562, 1563, - 1564, 1565, 1566, 1567, 1568, 1569, 1570, 1571, - 1572, 1573, 1574, 1575, 1576, 1577, 1578, 1579, - 1580, 1581, 1545, 946, 947, 951, 952, 953, - 954, 955, 956, 957, 958, 959, 960, 961, - 962, 964, 966, 967, 999, 1040, 1055, 1062, - 1064, 1066, 1086, 1089, 1105, 1218, 1545, 1222, - 1223, 1224, 1225, 1226, 1227, 1228, 1229, 1230, - 1231, 1232, 1234, 1235, 1236, 1237, 1238, 1239, - 1240, 1241, 1242, 1243, 1244, 1245, 1246, 1247, - 1248, 1249, 1250, 1251, 1252, 1253, 1254, 1256, - 1257, 1258, 1259, 1260, 1261, 1262, 1263, 1264, - 1265, 1266, 1267, 1268, 1269, 1270, 1272, 1273, - 1274, 1276, 1277, 1278, 1279, 1280, 1281, 1282, - 1283, 1284, 1285, 1286, 1287, 1288, 1289, 1291, - 1292, 1293, 1294, 1295, 1296, 1297, 1298, 1299, - 1301, 1302, 1303, 1304, 1305, 1306, 1307, 1308, - 1309, 1310, 1311, 1312, 1313, 1314, 1315, 1316, - 1317, 1318, 1320, 1321, 1322, 1323, 1324, 1325, - 1326, 1327, 1328, 1329, 1330, 1331, 1332, 1333, - 1334, 1335, 1336, 1337, 1338, 1339, 1340, 1342, - 1343, 1344, 1345, 1346, 1347, 1348, 1349, 1350, - 1351, 1352, 1353, 1354, 1355, 1356, 1357, 1386, - 1411, 1414, 1415, 1417, 1424, 1425, 1428, 1432, - 1444, 1449, 1450, 1452, 1455, 1457, + 1506, 1507, 1508, 1509, 1459, 1459, 1459, 1459, + 1459, 1459, 1, 1459, 1459, 7, 1459, 1459, + 1459, 1459, 1459, 415, 416, 420, 421, 422, + 423, 424, 425, 426, 427, 428, 429, 430, + 431, 433, 435, 436, 468, 509, 524, 531, + 533, 535, 555, 558, 574, 687, 1459, 1459, + 1459, 691, 692, 693, 694, 695, 696, 697, + 698, 699, 700, 701, 703, 704, 705, 706, + 707, 708, 709, 710, 711, 712, 713, 714, + 715, 716, 717, 718, 719, 720, 721, 722, + 723, 725, 726, 727, 728, 729, 730, 731, + 732, 733, 734, 735, 736, 737, 738, 739, + 741, 742, 743, 745, 746, 747, 748, 749, + 750, 751, 752, 753, 754, 755, 756, 757, + 758, 760, 761, 762, 763, 764, 765, 766, + 767, 768, 770, 771, 772, 773, 774, 775, + 776, 777, 778, 779, 780, 781, 782, 783, + 784, 785, 786, 787, 789, 790, 791, 792, + 793, 794, 795, 796, 797, 798, 799, 800, + 801, 802, 803, 804, 805, 806, 807, 808, + 809, 811, 812, 813, 814, 815, 816, 817, + 818, 819, 820, 821, 822, 823, 824, 825, + 826, 855, 880, 883, 884, 886, 893, 894, + 897, 901, 913, 918, 919, 921, 924, 926, + 1512, 1510, 1513, 1518, 1520, 1510, 1521, 1522, + 1523, 1510, 928, 1510, 1510, 1514, 1515, 1517, + 1510, 1516, 1510, 1510, 1510, 1519, 1510, 1510, + 1510, 933, 934, 938, 939, 1524, 1532, 1533, + 1534, 1524, 937, 1524, 1524, 934, 1528, 1529, + 1524, 1524, 1524, 1524, 1524, 940, 944, 945, + 1535, 1543, 1544, 1545, 1535, 943, 1535, 1535, + 940, 1539, 1540, 1535, 1535, 1535, 1535, 1535, + 1546, 1548, 1549, 1550, 1551, 1552, 1553, 1554, + 1555, 1556, 1557, 1558, 1559, 1560, 1561, 1562, + 1563, 1564, 1565, 1566, 1567, 1568, 1569, 1570, + 1571, 1572, 1573, 1574, 1575, 1576, 1577, 1578, + 1579, 1580, 1581, 1582, 1546, 946, 947, 951, + 952, 953, 954, 955, 956, 957, 958, 959, + 960, 961, 962, 964, 966, 967, 999, 1040, + 1055, 1062, 1064, 1066, 1086, 1089, 1105, 1218, + 1546, 1222, 1223, 1224, 1225, 1226, 1227, 1228, + 1229, 1230, 1231, 1232, 1234, 1235, 1236, 1237, + 1238, 1239, 1240, 1241, 1242, 1243, 1244, 1245, + 1246, 1247, 1248, 1249, 1250, 1251, 1252, 1253, + 1254, 1256, 1257, 1258, 1259, 1260, 1261, 1262, + 1263, 1264, 1265, 1266, 1267, 1268, 1269, 1270, + 1272, 1273, 1274, 1276, 1277, 1278, 1279, 1280, + 1281, 1282, 1283, 1284, 1285, 1286, 1287, 1288, + 1289, 1291, 1292, 1293, 1294, 1295, 1296, 1297, + 1298, 1299, 1301, 1302, 1303, 1304, 1305, 1306, + 1307, 1308, 1309, 1310, 1311, 1312, 1313, 1314, + 1315, 1316, 1317, 1318, 1320, 1321, 1322, 1323, + 1324, 1325, 1326, 1327, 1328, 1329, 1330, 1331, + 1332, 1333, 1334, 1335, 1336, 1337, 1338, 1339, + 1340, 1342, 1343, 1344, 1345, 1346, 1347, 1348, + 1349, 1350, 1351, 1352, 1353, 1354, 1355, 1356, + 1357, 1386, 1411, 1414, 1415, 1417, 1424, 1425, + 1428, 1432, 1444, 1449, 1450, 1452, 1455, 1457, } var _hcltok_trans_actions []byte = []byte{ - 145, 107, 0, 0, 91, 141, 0, 7, + 147, 109, 0, 0, 91, 143, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 121, 0, 0, 0, + 0, 0, 0, 0, 123, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -3448,7 +3448,7 @@ var _hcltok_trans_actions []byte = []byte{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 143, 193, 149, 0, 0, 0, + 0, 0, 145, 195, 151, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -3479,7 +3479,7 @@ var _hcltok_trans_actions []byte = []byte{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 147, 125, 0, + 0, 0, 0, 0, 0, 149, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -3491,11 +3491,11 @@ var _hcltok_trans_actions []byte = []byte{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 31, 169, + 0, 0, 0, 0, 0, 0, 31, 171, 0, 0, 0, 35, 33, 0, 55, 41, - 175, 0, 53, 0, 175, 175, 0, 0, - 75, 61, 181, 0, 73, 0, 181, 181, - 0, 0, 85, 187, 89, 0, 0, 0, + 177, 0, 53, 0, 177, 177, 0, 0, + 75, 61, 183, 0, 73, 0, 183, 183, + 0, 0, 85, 189, 89, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -3539,18 +3539,19 @@ var _hcltok_trans_actions []byte = []byte{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 93, - 0, 0, 119, 0, 111, 0, 7, 7, - 7, 0, 0, 113, 0, 115, 0, 123, - 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 121, 0, 113, 0, 7, 7, + 0, 7, 0, 0, 115, 0, 117, 0, + 125, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 7, 7, - 7, 196, 196, 196, 196, 196, 196, 7, - 7, 196, 7, 127, 139, 135, 97, 133, - 103, 0, 129, 0, 101, 95, 109, 99, - 131, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 7, + 7, 7, 198, 198, 198, 198, 198, 198, + 7, 7, 198, 7, 129, 141, 137, 97, + 135, 103, 0, 131, 107, 0, 101, 95, + 111, 99, 133, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 105, 117, 137, 0, + 0, 0, 0, 0, 0, 0, 105, 119, + 139, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -3568,23 +3569,23 @@ var _hcltok_trans_actions []byte = []byte{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 13, - 0, 0, 172, 17, 0, 7, 7, 23, - 0, 25, 27, 0, 0, 0, 151, 0, - 15, 19, 9, 0, 21, 11, 29, 0, - 0, 0, 0, 43, 0, 178, 178, 49, - 0, 157, 154, 1, 175, 175, 45, 37, - 47, 39, 51, 0, 0, 0, 63, 0, - 184, 184, 69, 0, 163, 160, 1, 181, - 181, 65, 57, 67, 59, 71, 77, 0, + 0, 13, 0, 0, 174, 17, 0, 7, + 7, 23, 0, 25, 27, 0, 0, 0, + 153, 0, 15, 19, 9, 0, 21, 11, + 29, 0, 0, 0, 0, 43, 0, 180, + 180, 49, 0, 159, 156, 1, 177, 177, + 45, 37, 47, 39, 51, 0, 0, 0, + 63, 0, 186, 186, 69, 0, 165, 162, + 1, 183, 183, 65, 57, 67, 59, 71, + 77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 7, + 7, 7, 192, 192, 192, 192, 192, 192, + 7, 7, 192, 7, 81, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 7, 7, 7, - 190, 190, 190, 190, 190, 190, 7, 7, - 190, 7, 81, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 83, 0, + 83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -3602,7 +3603,6 @@ var _hcltok_trans_actions []byte = []byte{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, } var _hcltok_to_state_actions []byte = []byte{ @@ -3794,16 +3794,16 @@ var _hcltok_to_state_actions []byte = []byte{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 3, 0, 0, + 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 166, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 166, 0, + 0, 0, 0, 0, 168, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 168, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 3, 0, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, } var _hcltok_from_state_actions []byte = []byte{ @@ -3995,16 +3995,16 @@ var _hcltok_from_state_actions []byte = []byte{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 5, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 5, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, } var _hcltok_eof_trans []int16 = []int16{ @@ -4190,32 +4190,32 @@ var _hcltok_eof_trans []int16 = []int16{ 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, - 1046, 1046, 1046, 0, 1196, 1197, 1198, 1200, - 1198, 1198, 1198, 1203, 1198, 1198, 1198, 1209, - 1198, 1198, 1239, 1239, 1239, 1239, 1239, 1239, - 1239, 1239, 1239, 1239, 1239, 1239, 1239, 1239, - 1239, 1239, 1239, 1239, 1239, 1239, 1239, 1239, - 1239, 1239, 1239, 1239, 1239, 1239, 1239, 1239, - 1239, 1239, 1239, 1239, 1239, 0, 1392, 1394, - 1395, 1399, 1399, 1392, 1402, 1395, 1405, 1395, - 1407, 1407, 1407, 0, 1416, 1418, 1418, 1416, - 1416, 1423, 1425, 1427, 1427, 1427, 0, 1435, - 1437, 1437, 1435, 1435, 1442, 1444, 1446, 1446, - 1446, 0, 1483, 1511, 1511, 1511, 1511, 1511, - 1511, 1511, 1511, 1511, 1511, 1511, 1511, 1511, - 1511, 1511, 1511, 1511, 1511, 1511, 1511, 1511, - 1511, 1511, 1511, 1511, 1511, 1511, 1511, 1511, - 1511, 1511, 1511, 1511, 1511, 1511, + 1046, 1046, 1046, 0, 1197, 1198, 1199, 1201, + 1199, 1199, 1199, 1204, 1199, 1199, 1199, 1199, + 1211, 1199, 1199, 1241, 1241, 1241, 1241, 1241, + 1241, 1241, 1241, 1241, 1241, 1241, 1241, 1241, + 1241, 1241, 1241, 1241, 1241, 1241, 1241, 1241, + 1241, 1241, 1241, 1241, 1241, 1241, 1241, 1241, + 1241, 1241, 1241, 1241, 1241, 1241, 0, 1394, + 1396, 1397, 1401, 1401, 1394, 1404, 1397, 1407, + 1397, 1409, 1409, 1409, 0, 1418, 1420, 1420, + 1418, 1418, 1425, 1427, 1429, 1429, 1429, 0, + 1437, 1439, 1439, 1437, 1437, 1444, 1446, 1448, + 1448, 1448, 0, 1485, 1513, 1513, 1513, 1513, + 1513, 1513, 1513, 1513, 1513, 1513, 1513, 1513, + 1513, 1513, 1513, 1513, 1513, 1513, 1513, 1513, + 1513, 1513, 1513, 1513, 1513, 1513, 1513, 1513, + 1513, 1513, 1513, 1513, 1513, 1513, 1513, } const hcltok_start int = 1459 const hcltok_first_final int = 1459 const hcltok_error int = 0 -const hcltok_en_stringTemplate int = 1509 -const hcltok_en_heredocTemplate int = 1523 -const hcltok_en_bareTemplate int = 1534 -const hcltok_en_identOnly int = 1545 +const hcltok_en_stringTemplate int = 1510 +const hcltok_en_heredocTemplate int = 1524 +const hcltok_en_bareTemplate int = 1535 +const hcltok_en_identOnly int = 1546 const hcltok_en_main int = 1459 //line scan_tokens.rl:16 @@ -4232,7 +4232,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To StartByte: start.Byte, } -//line scan_tokens.rl:305 +//line scan_tokens.rl:315 // Ragel state p := 0 // "Pointer" into data @@ -4260,7 +4260,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To var retBraces []int // stack of brace levels that cause us to use fret var heredocs []heredocInProgress // stack of heredocs we're currently processing -//line scan_tokens.rl:340 +//line scan_tokens.rl:350 // Make Go compiler happy _ = ts @@ -4280,7 +4280,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To f.emitToken(TokenType(b[0]), ts, te) } -//line scan_tokens.go:4289 +//line scan_tokens.go:4290 { top = 0 ts = 0 @@ -4288,7 +4288,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To act = 0 } -//line scan_tokens.go:4297 +//line scan_tokens.go:4298 { var _klen int var _trans int @@ -4312,7 +4312,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To //line NONE:1 ts = p -//line scan_tokens.go:4320 +//line scan_tokens.go:4321 } } @@ -4384,7 +4384,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To _acts++ switch _hcltok_actions[_acts-1] { case 0: -//line scan_tokens.rl:224 +//line scan_tokens.rl:233 p-- case 4: @@ -4392,13 +4392,13 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To te = p + 1 case 5: -//line scan_tokens.rl:248 +//line scan_tokens.rl:257 act = 4 case 6: -//line scan_tokens.rl:250 +//line scan_tokens.rl:259 act = 6 case 7: -//line scan_tokens.rl:160 +//line scan_tokens.rl:169 te = p + 1 { token(TokenTemplateInterp) @@ -4416,7 +4416,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To } } case 8: -//line scan_tokens.rl:170 +//line scan_tokens.rl:179 te = p + 1 { token(TokenTemplateControl) @@ -4434,7 +4434,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To } } case 9: -//line scan_tokens.rl:84 +//line scan_tokens.rl:93 te = p + 1 { token(TokenCQuote) @@ -4447,19 +4447,19 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To } case 10: -//line scan_tokens.rl:248 +//line scan_tokens.rl:257 te = p + 1 { token(TokenQuotedLit) } case 11: -//line scan_tokens.rl:251 +//line scan_tokens.rl:260 te = p + 1 { token(TokenBadUTF8) } case 12: -//line scan_tokens.rl:160 +//line scan_tokens.rl:169 te = p p-- { @@ -4478,7 +4478,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To } } case 13: -//line scan_tokens.rl:170 +//line scan_tokens.rl:179 te = p p-- { @@ -4497,41 +4497,41 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To } } case 14: -//line scan_tokens.rl:248 +//line scan_tokens.rl:257 te = p p-- { token(TokenQuotedLit) } case 15: -//line scan_tokens.rl:249 +//line scan_tokens.rl:258 te = p p-- { token(TokenQuotedNewline) } case 16: -//line scan_tokens.rl:250 +//line scan_tokens.rl:259 te = p p-- { token(TokenInvalid) } case 17: -//line scan_tokens.rl:251 +//line scan_tokens.rl:260 te = p p-- { token(TokenBadUTF8) } case 18: -//line scan_tokens.rl:248 +//line scan_tokens.rl:257 p = (te) - 1 { token(TokenQuotedLit) } case 19: -//line scan_tokens.rl:251 +//line scan_tokens.rl:260 p = (te) - 1 { token(TokenBadUTF8) @@ -4552,13 +4552,13 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To } case 21: -//line scan_tokens.rl:148 +//line scan_tokens.rl:157 act = 11 case 22: -//line scan_tokens.rl:259 +//line scan_tokens.rl:268 act = 12 case 23: -//line scan_tokens.rl:160 +//line scan_tokens.rl:169 te = p + 1 { token(TokenTemplateInterp) @@ -4576,7 +4576,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To } } case 24: -//line scan_tokens.rl:170 +//line scan_tokens.rl:179 te = p + 1 { token(TokenTemplateControl) @@ -4594,7 +4594,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To } } case 25: -//line scan_tokens.rl:111 +//line scan_tokens.rl:120 te = p + 1 { // This action is called specificially when a heredoc literal @@ -4639,13 +4639,13 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To token(TokenStringLit) } case 26: -//line scan_tokens.rl:259 +//line scan_tokens.rl:268 te = p + 1 { token(TokenBadUTF8) } case 27: -//line scan_tokens.rl:160 +//line scan_tokens.rl:169 te = p p-- { @@ -4664,7 +4664,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To } } case 28: -//line scan_tokens.rl:170 +//line scan_tokens.rl:179 te = p p-- { @@ -4683,7 +4683,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To } } case 29: -//line scan_tokens.rl:148 +//line scan_tokens.rl:157 te = p p-- { @@ -4694,14 +4694,14 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To token(TokenStringLit) } case 30: -//line scan_tokens.rl:259 +//line scan_tokens.rl:268 te = p p-- { token(TokenBadUTF8) } case 31: -//line scan_tokens.rl:148 +//line scan_tokens.rl:157 p = (te) - 1 { // This action is called when a heredoc literal _doesn't_ end @@ -4736,13 +4736,13 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To } case 33: -//line scan_tokens.rl:156 +//line scan_tokens.rl:165 act = 15 case 34: -//line scan_tokens.rl:266 +//line scan_tokens.rl:275 act = 16 case 35: -//line scan_tokens.rl:160 +//line scan_tokens.rl:169 te = p + 1 { token(TokenTemplateInterp) @@ -4760,7 +4760,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To } } case 36: -//line scan_tokens.rl:170 +//line scan_tokens.rl:179 te = p + 1 { token(TokenTemplateControl) @@ -4778,19 +4778,19 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To } } case 37: -//line scan_tokens.rl:156 +//line scan_tokens.rl:165 te = p + 1 { token(TokenStringLit) } case 38: -//line scan_tokens.rl:266 +//line scan_tokens.rl:275 te = p + 1 { token(TokenBadUTF8) } case 39: -//line scan_tokens.rl:160 +//line scan_tokens.rl:169 te = p p-- { @@ -4809,7 +4809,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To } } case 40: -//line scan_tokens.rl:170 +//line scan_tokens.rl:179 te = p p-- { @@ -4828,21 +4828,21 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To } } case 41: -//line scan_tokens.rl:156 +//line scan_tokens.rl:165 te = p p-- { token(TokenStringLit) } case 42: -//line scan_tokens.rl:266 +//line scan_tokens.rl:275 te = p p-- { token(TokenBadUTF8) } case 43: -//line scan_tokens.rl:156 +//line scan_tokens.rl:165 p = (te) - 1 { token(TokenStringLit) @@ -4869,45 +4869,45 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To } case 45: -//line scan_tokens.rl:270 +//line scan_tokens.rl:279 act = 17 case 46: -//line scan_tokens.rl:271 +//line scan_tokens.rl:280 act = 18 case 47: -//line scan_tokens.rl:271 +//line scan_tokens.rl:280 te = p + 1 { token(TokenBadUTF8) } case 48: -//line scan_tokens.rl:272 +//line scan_tokens.rl:281 te = p + 1 { token(TokenInvalid) } case 49: -//line scan_tokens.rl:270 +//line scan_tokens.rl:279 te = p p-- { token(TokenIdent) } case 50: -//line scan_tokens.rl:271 +//line scan_tokens.rl:280 te = p p-- { token(TokenBadUTF8) } case 51: -//line scan_tokens.rl:270 +//line scan_tokens.rl:279 p = (te) - 1 { token(TokenIdent) } case 52: -//line scan_tokens.rl:271 +//line scan_tokens.rl:280 p = (te) - 1 { token(TokenBadUTF8) @@ -4928,86 +4928,92 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To } case 54: -//line scan_tokens.rl:278 +//line scan_tokens.rl:287 act = 22 case 55: -//line scan_tokens.rl:301 - act = 39 +//line scan_tokens.rl:311 + act = 40 case 56: -//line scan_tokens.rl:280 +//line scan_tokens.rl:289 te = p + 1 { token(TokenComment) } case 57: -//line scan_tokens.rl:281 +//line scan_tokens.rl:290 te = p + 1 { token(TokenNewline) } case 58: -//line scan_tokens.rl:283 +//line scan_tokens.rl:292 te = p + 1 { token(TokenEqualOp) } case 59: -//line scan_tokens.rl:284 +//line scan_tokens.rl:293 te = p + 1 { token(TokenNotEqual) } case 60: -//line scan_tokens.rl:285 +//line scan_tokens.rl:294 te = p + 1 { token(TokenGreaterThanEq) } case 61: -//line scan_tokens.rl:286 +//line scan_tokens.rl:295 te = p + 1 { token(TokenLessThanEq) } case 62: -//line scan_tokens.rl:287 +//line scan_tokens.rl:296 te = p + 1 { token(TokenAnd) } case 63: -//line scan_tokens.rl:288 +//line scan_tokens.rl:297 te = p + 1 { token(TokenOr) } case 64: -//line scan_tokens.rl:289 +//line scan_tokens.rl:298 te = p + 1 { - token(TokenEllipsis) + token(TokenDoubleColon) } case 65: -//line scan_tokens.rl:290 +//line scan_tokens.rl:299 te = p + 1 { - token(TokenFatArrow) + token(TokenEllipsis) } case 66: -//line scan_tokens.rl:291 +//line scan_tokens.rl:300 te = p + 1 { - selfToken() + token(TokenFatArrow) } case 67: -//line scan_tokens.rl:180 +//line scan_tokens.rl:301 + te = p + 1 + { + selfToken() + } + case 68: +//line scan_tokens.rl:189 te = p + 1 { token(TokenOBrace) braces++ } - case 68: -//line scan_tokens.rl:185 + case 69: +//line scan_tokens.rl:194 te = p + 1 { if len(retBraces) > 0 && retBraces[len(retBraces)-1] == braces { @@ -5026,8 +5032,8 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To braces-- } } - case 69: -//line scan_tokens.rl:197 + case 70: +//line scan_tokens.rl:206 te = p + 1 { // Only consume from the retBraces stack and return if we are at @@ -5055,8 +5061,8 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To braces-- } } - case 70: -//line scan_tokens.rl:79 + case 71: +//line scan_tokens.rl:88 te = p + 1 { token(TokenOQuote) @@ -5064,12 +5070,12 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To stack = append(stack, 0) stack[top] = cs top++ - cs = 1509 + cs = 1510 goto _again } } - case 71: -//line scan_tokens.rl:89 + case 72: +//line scan_tokens.rl:98 te = p + 1 { token(TokenOHeredoc) @@ -5094,94 +5100,94 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To stack = append(stack, 0) stack[top] = cs top++ - cs = 1523 + cs = 1524 goto _again } } - case 72: -//line scan_tokens.rl:301 + case 73: +//line scan_tokens.rl:311 te = p + 1 { token(TokenBadUTF8) } - case 73: -//line scan_tokens.rl:302 + case 74: +//line scan_tokens.rl:312 te = p + 1 { token(TokenInvalid) } - case 74: -//line scan_tokens.rl:276 + case 75: +//line scan_tokens.rl:285 te = p p-- - case 75: -//line scan_tokens.rl:277 + case 76: +//line scan_tokens.rl:286 te = p p-- { token(TokenNumberLit) } - case 76: -//line scan_tokens.rl:278 + case 77: +//line scan_tokens.rl:287 te = p p-- { token(TokenIdent) } - case 77: -//line scan_tokens.rl:280 + case 78: +//line scan_tokens.rl:289 te = p p-- { token(TokenComment) } - case 78: -//line scan_tokens.rl:291 + case 79: +//line scan_tokens.rl:301 te = p p-- { selfToken() } - case 79: -//line scan_tokens.rl:301 + case 80: +//line scan_tokens.rl:311 te = p p-- { token(TokenBadUTF8) } - case 80: -//line scan_tokens.rl:302 + case 81: +//line scan_tokens.rl:312 te = p p-- { token(TokenInvalid) } - case 81: -//line scan_tokens.rl:277 + case 82: +//line scan_tokens.rl:286 p = (te) - 1 { token(TokenNumberLit) } - case 82: -//line scan_tokens.rl:278 + case 83: +//line scan_tokens.rl:287 p = (te) - 1 { token(TokenIdent) } - case 83: -//line scan_tokens.rl:291 + case 84: +//line scan_tokens.rl:301 p = (te) - 1 { selfToken() } - case 84: -//line scan_tokens.rl:301 + case 85: +//line scan_tokens.rl:311 p = (te) - 1 { token(TokenBadUTF8) } - case 85: + case 86: //line NONE:1 switch act { case 22: @@ -5189,14 +5195,14 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To p = (te) - 1 token(TokenIdent) } - case 39: + case 40: { p = (te) - 1 token(TokenBadUTF8) } } -//line scan_tokens.go:5055 +//line scan_tokens.go:5060 } } @@ -5215,7 +5221,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To //line NONE:1 act = 0 -//line scan_tokens.go:5073 +//line scan_tokens.go:5078 } } @@ -5241,7 +5247,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To } } -//line scan_tokens.rl:363 +//line scan_tokens.rl:373 // If we fall out here without being in a final state then we've // encountered something that the scanner can't match, which we'll diff --git a/hclsyntax/scan_tokens.rl b/hclsyntax/scan_tokens.rl index 942ad92b..8d1e08af 100644 --- a/hclsyntax/scan_tokens.rl +++ b/hclsyntax/scan_tokens.rl @@ -53,6 +53,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To LogicalAnd = "&&"; LogicalOr = "||"; + DoubleColon = "::"; Ellipsis = "..."; FatArrow = "=>"; @@ -294,6 +295,7 @@ func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []To LessThanEqual => { token(TokenLessThanEq); }; LogicalAnd => { token(TokenAnd); }; LogicalOr => { token(TokenOr); }; + DoubleColon => { token(TokenDoubleColon); }; Ellipsis => { token(TokenEllipsis); }; FatArrow => { token(TokenFatArrow); }; SelfToken => { selfToken() }; diff --git a/hclsyntax/scan_tokens_test.go b/hclsyntax/scan_tokens_test.go index f3b6eeb4..10c42007 100644 --- a/hclsyntax/scan_tokens_test.go +++ b/hclsyntax/scan_tokens_test.go @@ -372,6 +372,66 @@ func TestScanTokens_normal(t *testing.T) { }, }, + // TokenDoubleColon and associated TokenIdent + { + `::`, + []Token{ + { + Type: TokenDoubleColon, + Bytes: []byte(`::`), + Range: hcl.Range{ + Start: hcl.Pos{Byte: 0, Line: 1, Column: 1}, + End: hcl.Pos{Byte: 2, Line: 1, Column: 3}, + }, + }, + { + Type: TokenEOF, + Bytes: []byte{}, + Range: hcl.Range{ + Start: hcl.Pos{Byte: 2, Line: 1, Column: 3}, + End: hcl.Pos{Byte: 2, Line: 1, Column: 3}, + }, + }, + }, + }, + { + `a::b`, + []Token{ + { + Type: TokenIdent, + Bytes: []byte(`a`), + Range: hcl.Range{ + Start: hcl.Pos{Byte: 0, Line: 1, Column: 1}, + End: hcl.Pos{Byte: 1, Line: 1, Column: 2}, + }, + }, + { + Type: TokenDoubleColon, + Bytes: []byte(`::`), + Range: hcl.Range{ + Start: hcl.Pos{Byte: 1, Line: 1, Column: 2}, + End: hcl.Pos{Byte: 3, Line: 1, Column: 4}, + }, + }, + { + Type: TokenIdent, + Bytes: []byte(`b`), + Range: hcl.Range{ + Start: hcl.Pos{Byte: 3, Line: 1, Column: 4}, + End: hcl.Pos{Byte: 4, Line: 1, Column: 5}, + }, + }, + { + Type: TokenEOF, + Bytes: []byte{}, + Range: hcl.Range{ + Start: hcl.Pos{Byte: 4, Line: 1, Column: 5}, + End: hcl.Pos{Byte: 4, Line: 1, Column: 5}, + }, + }, + }, + }, + // Literal-only Templates (string literals, effectively) { `""`, diff --git a/hclsyntax/token.go b/hclsyntax/token.go index afde5f33..47648b8f 100644 --- a/hclsyntax/token.go +++ b/hclsyntax/token.go @@ -63,8 +63,9 @@ const ( TokenDot TokenType = '.' TokenComma TokenType = ',' - TokenEllipsis TokenType = '…' - TokenFatArrow TokenType = '⇒' + TokenDoubleColon TokenType = '⸬' + TokenEllipsis TokenType = '…' + TokenFatArrow TokenType = '⇒' TokenQuestion TokenType = '?' TokenColon TokenType = ':' diff --git a/hclsyntax/token_type_string.go b/hclsyntax/token_type_string.go index c23c4f0b..5a2cd4eb 100644 --- a/hclsyntax/token_type_string.go +++ b/hclsyntax/token_type_string.go @@ -4,67 +4,7 @@ package hclsyntax import "strconv" -func _() { - // An "invalid array index" compiler error signifies that the constant values have changed. - // Re-run the stringer command to generate them again. - var x [1]struct{} - _ = x[TokenOBrace-123] - _ = x[TokenCBrace-125] - _ = x[TokenOBrack-91] - _ = x[TokenCBrack-93] - _ = x[TokenOParen-40] - _ = x[TokenCParen-41] - _ = x[TokenOQuote-171] - _ = x[TokenCQuote-187] - _ = x[TokenOHeredoc-72] - _ = x[TokenCHeredoc-104] - _ = x[TokenStar-42] - _ = x[TokenSlash-47] - _ = x[TokenPlus-43] - _ = x[TokenMinus-45] - _ = x[TokenPercent-37] - _ = x[TokenEqual-61] - _ = x[TokenEqualOp-8788] - _ = x[TokenNotEqual-8800] - _ = x[TokenLessThan-60] - _ = x[TokenLessThanEq-8804] - _ = x[TokenGreaterThan-62] - _ = x[TokenGreaterThanEq-8805] - _ = x[TokenAnd-8743] - _ = x[TokenOr-8744] - _ = x[TokenBang-33] - _ = x[TokenDot-46] - _ = x[TokenComma-44] - _ = x[TokenEllipsis-8230] - _ = x[TokenFatArrow-8658] - _ = x[TokenQuestion-63] - _ = x[TokenColon-58] - _ = x[TokenTemplateInterp-8747] - _ = x[TokenTemplateControl-955] - _ = x[TokenTemplateSeqEnd-8718] - _ = x[TokenQuotedLit-81] - _ = x[TokenStringLit-83] - _ = x[TokenNumberLit-78] - _ = x[TokenIdent-73] - _ = x[TokenComment-67] - _ = x[TokenNewline-10] - _ = x[TokenEOF-9220] - _ = x[TokenBitwiseAnd-38] - _ = x[TokenBitwiseOr-124] - _ = x[TokenBitwiseNot-126] - _ = x[TokenBitwiseXor-94] - _ = x[TokenStarStar-10138] - _ = x[TokenApostrophe-39] - _ = x[TokenBacktick-96] - _ = x[TokenSemicolon-59] - _ = x[TokenTabs-9225] - _ = x[TokenInvalid-65533] - _ = x[TokenBadUTF8-128169] - _ = x[TokenQuotedNewline-9252] - _ = x[TokenNil-0] -} - -const _TokenType_name = "TokenNilTokenNewlineTokenBangTokenPercentTokenBitwiseAndTokenApostropheTokenOParenTokenCParenTokenStarTokenPlusTokenCommaTokenMinusTokenDotTokenSlashTokenColonTokenSemicolonTokenLessThanTokenEqualTokenGreaterThanTokenQuestionTokenCommentTokenOHeredocTokenIdentTokenNumberLitTokenQuotedLitTokenStringLitTokenOBrackTokenCBrackTokenBitwiseXorTokenBacktickTokenCHeredocTokenOBraceTokenBitwiseOrTokenCBraceTokenBitwiseNotTokenOQuoteTokenCQuoteTokenTemplateControlTokenEllipsisTokenFatArrowTokenTemplateSeqEndTokenAndTokenOrTokenTemplateInterpTokenEqualOpTokenNotEqualTokenLessThanEqTokenGreaterThanEqTokenEOFTokenTabsTokenQuotedNewlineTokenStarStarTokenInvalidTokenBadUTF8" +const _TokenType_name = "TokenNilTokenNewlineTokenBangTokenPercentTokenBitwiseAndTokenApostropheTokenOParenTokenCParenTokenStarTokenPlusTokenCommaTokenMinusTokenDotTokenSlashTokenColonTokenSemicolonTokenLessThanTokenEqualTokenGreaterThanTokenQuestionTokenCommentTokenOHeredocTokenIdentTokenNumberLitTokenQuotedLitTokenStringLitTokenOBrackTokenCBrackTokenBitwiseXorTokenBacktickTokenCHeredocTokenOBraceTokenBitwiseOrTokenCBraceTokenBitwiseNotTokenOQuoteTokenCQuoteTokenTemplateControlTokenEllipsisTokenFatArrowTokenTemplateSeqEndTokenAndTokenOrTokenTemplateInterpTokenEqualOpTokenNotEqualTokenLessThanEqTokenGreaterThanEqTokenEOFTokenTabsTokenQuotedNewlineTokenStarStarTokenDoubleColonTokenInvalidTokenBadUTF8" var _TokenType_map = map[TokenType]string{ 0: _TokenType_name[0:8], @@ -119,8 +59,9 @@ var _TokenType_map = map[TokenType]string{ 9225: _TokenType_name[603:612], 9252: _TokenType_name[612:630], 10138: _TokenType_name[630:643], - 65533: _TokenType_name[643:655], - 128169: _TokenType_name[655:667], + 11820: _TokenType_name[643:659], + 65533: _TokenType_name[659:671], + 128169: _TokenType_name[671:683], } func (i TokenType) String() string { From 1ce4917789ea5ed149c2c3254d85c65654c27cc4 Mon Sep 17 00:00:00 2001 From: James Bardin Date: Wed, 1 Nov 2023 16:56:00 -0400 Subject: [PATCH 3/4] add a few more function scope tests --- hclsyntax/expression_test.go | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/hclsyntax/expression_test.go b/hclsyntax/expression_test.go index 72ff1596..4f3f75f7 100644 --- a/hclsyntax/expression_test.go +++ b/hclsyntax/expression_test.go @@ -362,6 +362,36 @@ upper( cty.StringVal("FOO"), 0, }, + { + `::upper("foo")`, // :: is still not a valid identifier + &hcl.EvalContext{ + Functions: map[string]function.Function{ + "::upper": stdlib.UpperFunc, + }, + }, + cty.DynamicVal, + 1, + }, + { + `double::::upper("foo")`, // missing name after :: + &hcl.EvalContext{ + Functions: map[string]function.Function{ + "double::::upper": stdlib.UpperFunc, + }, + }, + cty.NilVal, + 1, + }, + { + `missing::("foo")`, // missing name after :: + &hcl.EvalContext{ + Functions: map[string]function.Function{ + "missing::": stdlib.UpperFunc, + }, + }, + cty.NilVal, + 1, + }, { `misbehave()`, &hcl.EvalContext{ @@ -2194,8 +2224,12 @@ EOT for _, test := range tests { t.Run(test.input, func(t *testing.T) { expr, parseDiags := ParseExpression([]byte(test.input), "", hcl.Pos{Line: 1, Column: 1, Byte: 0}) + var got cty.Value + var valDiags hcl.Diagnostics - got, valDiags := expr.Value(test.ctx) + if expr != nil { + got, valDiags = expr.Value(test.ctx) + } diagCount := len(parseDiags) + len(valDiags) From 916ac487b471a8c6220be57d711710942c7dd29c Mon Sep 17 00:00:00 2001 From: James Bardin Date: Thu, 2 Nov 2023 14:14:41 -0400 Subject: [PATCH 4/4] add scoped function integration tests Add a locals blocks to the terraformlike tests, with normal and scoped function calls. --- integrationtest/terraformlike_test.go | 65 +++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/integrationtest/terraformlike_test.go b/integrationtest/terraformlike_test.go index 89783462..ae866269 100644 --- a/integrationtest/terraformlike_test.go +++ b/integrationtest/terraformlike_test.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/hcl/v2/hclsyntax" "github.com/hashicorp/hcl/v2/json" "github.com/zclconf/go-cty/cty" + "github.com/zclconf/go-cty/cty/function" ) // TestTerraformLike parses both a native syntax and a JSON representation @@ -53,10 +54,14 @@ func TestTerraformLike(t *testing.T) { Name string `hcl:"name,label"` Providers hcl.Expression `hcl:"providers"` } + type Locals struct { + Config hcl.Body `hcl:",remain"` + } type Root struct { Variables []*Variable `hcl:"variable,block"` Resources []*Resource `hcl:"resource,block"` Modules []*Module `hcl:"module,block"` + Locals []*Locals `hcl:"locals,block"` } instanceDecode := &hcldec.ObjectSpec{ "image_id": &hcldec.AttrSpec{ @@ -343,6 +348,57 @@ func TestTerraformLike(t *testing.T) { t.Errorf("wrong value traversal [1] type %T; want hcl.TraverseAttr", vt[1]) } }) + + t.Run("locals", func(t *testing.T) { + locals := root.Locals[0] + attrs, diags := locals.Config.JustAttributes() + if diags.HasErrors() { + t.Fatal(diags) + } + + ctx := &hcl.EvalContext{ + Functions: map[string]function.Function{ + "func": function.New(&function.Spec{ + Params: []function.Parameter{{Type: cty.String}}, + Type: function.StaticReturnType(cty.String), + Impl: func([]cty.Value, cty.Type) (cty.Value, error) { + return cty.StringVal("func_result"), nil + }, + }), + "scoped::func": function.New(&function.Spec{ + Params: []function.Parameter{{Type: cty.String}}, + Type: function.StaticReturnType(cty.String), + Impl: func([]cty.Value, cty.Type) (cty.Value, error) { + return cty.StringVal("scoped::func_result"), nil + }, + }), + }, + } + + res := attrs["func_result"] + funcVal, diags := res.Expr.Value(ctx) + if diags.HasErrors() { + t.Fatal(diags) + } + + wantVal := cty.StringVal("func_result") + + if !funcVal.RawEquals(wantVal) { + t.Errorf("expected %#v, got %#v", wantVal, funcVal) + } + + res = attrs["scoped_func_result"] + funcVal, diags = res.Expr.Value(ctx) + if diags.HasErrors() { + t.Fatal(diags) + } + + wantVal = cty.StringVal("scoped::func_result") + + if !funcVal.RawEquals(wantVal) { + t.Errorf("expected %#v, got %#v", wantVal, funcVal) + } + }) }) } } @@ -352,6 +408,11 @@ const terraformLikeNativeSyntax = ` variable "image_id" { } +locals { + func_result = func("arg") + scoped_func_result = scoped::func("arg") +} + resource "happycloud_instance" "test" { instance_type = "z3.weedy" image_id = var.image_id @@ -400,6 +461,10 @@ const terraformLikeJSON = ` "variable": { "image_id": {} }, + "locals": { + "func_result": "${func(\"arg\")}", + "scoped_func_result": "${scoped::func(\"arg\")}" + }, "resource": { "happycloud_instance": { "test": {