MCPcopy
hub / github.com/opentofu/opentofu / SymbolTable

Interface SymbolTable

internal/lang/exprs/symbol_table.go:17–33  ·  view source on GitHub ↗

SymbolTable is an interface implemented by types that have an associated symbol table, meaning that they contain a set of attributes that can be looked up by name.

Source from the content-addressed store, hash-verified

15// symbol table, meaning that they contain a set of attributes that can be
16// looked up by name.
17type SymbolTable interface {
18 // ResolveSymbol looks up a symbol by name, either returning what it
19 // refers to or error diagnostics if no such symbol exists.
20 ResolveAttr(ref hcl.TraverseAttr) (Attribute, tfdiags.Diagnostics)
21
22 // HandleInvalidStep is called if a reference contains anything other
23 // than an attribute access at a position handled by a symbol table,
24 // so that the symbol table can produce a specialized error message
25 // explaining what kind of attributes are expected.
26 //
27 // The given source range refers either to the non-attribute step that
28 // was encountered or, if the problem is that nothing was present at all,
29 // then to the entire reference expression visited so far.
30 //
31 // The result of this method MUST include at least one error diagnostic.
32 HandleInvalidStep(rng tfdiags.SourceRange) tfdiags.Diagnostics
33}

Callers 1

buildSymbolTableFunction · 0.85

Implementers 9

testModuleInstanceinternal/lang/exprs/example_test.go
testResourcesOfModeinternal/lang/exprs/example_test.go
testResourcesOfTypeinternal/lang/exprs/example_test.go
moduleInstanceScopeinternal/lang/eval/internal/tofu2024/m
moduleInstanceResourceSymbolTableinternal/lang/eval/internal/tofu2024/m
moduleInstNestedSymbolTableinternal/lang/eval/internal/tofu2024/m
inputVariableValidationScopeinternal/lang/eval/internal/tofu2024/m
instanceOverlayScopeinternal/lang/eval/internal/tofu2024/m
instanceLocalSymbolTableinternal/lang/eval/internal/tofu2024/m

Calls

no outgoing calls

Tested by

no test coverage detected