parser

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2022 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
}

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 State

type State struct {
	CurrentHclNode                   *HclNode
	Key                              *string
	Value                            *string
	KeyRange, ValueRange, EqualRange hcl.Range
	Index                            *int
	ExpectKey                        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