astext

package
v0.0.0-...-d6b2721 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyFieldWithLabel

func CopyFieldWithLabel(field *ast.Field, newLabel ast.Label) *ast.Field

func CopyFieldWithValue

func CopyFieldWithValue(field *ast.Field, newValue ast.Expr) *ast.Field

func CopyImportDeclWithSpecs

func CopyImportDeclWithSpecs(expr *ast.ImportDecl, specs []*ast.ImportSpec) *ast.ImportDecl

func CopyIndexExpression

func CopyIndexExpression(expr *ast.IndexExpr, value ast.Expr) *ast.IndexExpr

func CopyLetClauseWithValue

func CopyLetClauseWithValue(let *ast.LetClause, value ast.Expr) *ast.LetClause

func CopyParenExpression

func CopyParenExpression(expr *ast.ParenExpr, value ast.Expr) *ast.ParenExpr

func CopySliceExpression

func CopySliceExpression(expr *ast.SliceExpr, low, high ast.Expr) *ast.SliceExpr

func CopyUnaryExpression

func CopyUnaryExpression(expr *ast.UnaryExpr, value ast.Expr) *ast.UnaryExpr

func NewInterpolation

func NewInterpolation(items []ast.Expr) *ast.Interpolation

func ResolveIdentifierValueInExpression

func ResolveIdentifierValueInExpression(expr ast.Node) (ast.Node, bool)

ResolveIdentifierValueInExpression replaces all identifiers with their respective values Returns node with all identifiers replaced, if possible and whether a (sub-) expression was changed

func ResolveIdentifierValueInExpressionInScope

func ResolveIdentifierValueInExpressionInScope(expr ast.Node, scope string) (ast.Node, bool)

Types

type IdentifierSet

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

func NewIdentifierSet

func NewIdentifierSet() *IdentifierSet

Jump to

Keyboard shortcuts

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