astutil

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2025 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloneNode

func CloneNode[T ast.Node](n T) T

CloneNode returns a deep copy of a Node. It omits pointers to ast.{Scope,Object} variables.

func Deprecation added in v0.4.0

func Deprecation(doc *ast.CommentGroup) string

Deprecation returns the paragraph of the doc comment that starts with the conventional "Deprecation: " marker, as defined by https://go.dev/wiki/Deprecated, or "" if the documented symbol is not deprecated.

func PosInStringLiteral added in v0.4.0

func PosInStringLiteral(lit *ast.BasicLit, offset int) (token.Pos, error)

PosInStringLiteral returns the position within a string literal corresponding to the specified byte offset within the logical string that it denotes.

func RangeInStringLiteral added in v0.4.0

func RangeInStringLiteral(lit *ast.BasicLit, start, end int) (token.Pos, token.Pos, error)

RangeInStringLiteral calculates the positional range within a string literal corresponding to the specified start and end byte offsets within the logical string.

Types

This section is empty.

Directories

Path Synopsis
Package cursor augments inspector.Inspector with Cursor functionality allowing more flexibility and control during inspection.
Package cursor augments inspector.Inspector with Cursor functionality allowing more flexibility and control during inspection.
Package edge defines identifiers for each field of an ast.Node struct type that refers to another Node.
Package edge defines identifiers for each field of an ast.Node struct type that refers to another Node.

Jump to

Keyboard shortcuts

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