comment

package
v1.5.14 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Comment

type Comment struct {
	// contains filtered or unexported fields
}

Comment - struct with comment value and its position on file

func (Comment) IsEmpty

func (c Comment) IsEmpty() bool

IsEmpty returns true if comment is empty, otherwise returns false

func (Comment) Line

func (c Comment) Line() int

Line returns the line comment starts

func (Comment) Value

func (c Comment) Value() string

Value returns comment value

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

Parser represents a list of code tokens

func NewParser

func NewParser(src []byte, filename string) (*Parser, error)

NewParser parses the content of a file and return a parser with its tokens

func (*Parser) ParseCommentsForNode

func (p *Parser) ParseCommentsForNode(rg hcl.Range) (startComment, leadComment Comment)

ParseCommentsForNode returns a comment in the range given in rg, if exists

Jump to

Keyboard shortcuts

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