parser

package
v1.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 16, 2023 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttributeAtPos

func AttributeAtPos(block *hclsyntax.Block, pos hcl.Pos) *hclsyntax.Attribute

func AttributeWithName

func AttributeWithName(block *hclsyntax.Block, name string) *hclsyntax.Attribute

func BlockAtPos

func BlockAtPos(body *hclsyntax.Body, pos hcl.Pos) *hclsyntax.Block

func ContainsPos

func ContainsPos(r hcl.Range, pos hcl.Pos) bool

func ExtractAction

func ExtractAction(block *hclsyntax.Block) *string

func ExtractAzureResourceType

func ExtractAzureResourceType(block *hclsyntax.Block) *string

func RangeOver

func RangeOver(a hcl.Range, b hcl.Range) hcl.Range

func ToLiteral

func ToLiteral(expression hclsyntax.Expression) *string

func ToLiteralBoolean

func ToLiteralBoolean(expression hclsyntax.Expression) *bool

Types

type HclNode

type HclNode struct {
	Children                         map[string]*HclNode
	KeyRange, ValueRange, EqualRange hcl.Range
	Value                            *string
	Key                              string
	KeyValueFormat                   KeyValueFormat
}

func BuildHclNode

func BuildHclNode(tokens hclsyntax.Tokens) *HclNode

func HclNodeArraysOfPos

func HclNodeArraysOfPos(hclNode *HclNode, pos hcl.Pos) []*HclNode

func JsonEncodeExpressionToHclNode

func JsonEncodeExpressionToHclNode(data []byte, expression hclsyntax.Expression) *HclNode

func (HclNode) GetRange

func (rm HclNode) GetRange() hcl.Range

func (HclNode) IsValueArray

func (rm HclNode) IsValueArray() bool

func (HclNode) IsValueMap

func (rm HclNode) IsValueMap() bool

type KeyValueFormat added in v1.4.0

type KeyValueFormat int
const (
	KeyEqualValue KeyValueFormat = iota
	QuotedKeyEqualValue
	QuotedKeyColonValue
)

type State

type State struct {
	CurrentHclNode                   *HclNode
	Key                              *string
	Value                            *string
	KeyRange, ValueRange, EqualRange hcl.Range
	Index                            *int
	ExpectKey                        bool
	ExpectEqual                      bool
}

func (State) GetCurrentKey

func (s State) GetCurrentKey() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL