mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 18:35:44 +03:00
Support driver config fields being set to nil (#5391)
To pick up https://github.com/hashicorp/hcl2/pull/90
This commit is contained in:
10
vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/parser.go
generated
vendored
10
vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/parser.go
generated
vendored
@@ -1242,7 +1242,13 @@ func (p *parser) parseObjectCons() (Expression, hcl.Diagnostics) {
|
||||
panic("parseObjectCons called without peeker pointing to open brace")
|
||||
}
|
||||
|
||||
if forKeyword.TokenMatches(p.Peek()) {
|
||||
// We must temporarily stop looking at newlines here while we check for
|
||||
// a "for" keyword, since for expressions are _not_ newline-sensitive,
|
||||
// even though object constructors are.
|
||||
p.PushIncludeNewlines(false)
|
||||
isFor := forKeyword.TokenMatches(p.Peek())
|
||||
p.PopIncludeNewlines()
|
||||
if isFor {
|
||||
return p.finishParsingForExpr(open)
|
||||
}
|
||||
|
||||
@@ -1377,6 +1383,8 @@ func (p *parser) parseObjectCons() (Expression, hcl.Diagnostics) {
|
||||
}
|
||||
|
||||
func (p *parser) finishParsingForExpr(open Token) (Expression, hcl.Diagnostics) {
|
||||
p.PushIncludeNewlines(false)
|
||||
defer p.PopIncludeNewlines()
|
||||
introducer := p.Read()
|
||||
if !forKeyword.TokenMatches(introducer) {
|
||||
// Should never happen if callers are behaving
|
||||
|
||||
2
vendor/github.com/hashicorp/hcl2/hcl/json/structure.go
generated
vendored
2
vendor/github.com/hashicorp/hcl2/hcl/json/structure.go
generated
vendored
@@ -499,6 +499,8 @@ func (e *expression) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) {
|
||||
return cty.DynamicVal, diags
|
||||
}
|
||||
return cty.ObjectVal(attrs), diags
|
||||
case *nullVal:
|
||||
return cty.NullVal(cty.DynamicPseudoType), nil
|
||||
default:
|
||||
// Default to DynamicVal so that ASTs containing invalid nodes can
|
||||
// still be partially-evaluated.
|
||||
|
||||
Reference in New Issue
Block a user