typeparams

package standard library
go1.23.3 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PackIndexExpr added in go1.18

func PackIndexExpr(x ast.Expr, lbrack token.Pos, exprs []ast.Expr, rbrack token.Pos) ast.Expr

Types

type IndexExpr added in go1.18

type IndexExpr struct {
	Orig    ast.Expr   // the wrapped expr, which may be distinct from the IndexListExpr below.
	X       ast.Expr   // expression
	Lbrack  token.Pos  // position of "["
	Indices []ast.Expr // index expressions
	Rbrack  token.Pos  // position of "]"
}

IndexExpr wraps an ast.IndexExpr or ast.IndexListExpr.

Orig holds the original ast.Expr from which this IndexExpr was derived.

Note: IndexExpr (intentionally) does not wrap ast.Expr, as that leads to accidental misuse such as encountered in golang/go#63933.

TODO(rfindley): remove this helper, in favor of just having a helper function that returns indices.

func UnpackIndexExpr added in go1.18

func UnpackIndexExpr(n ast.Node) *IndexExpr

func (*IndexExpr) Pos added in go1.23.0

func (x *IndexExpr) Pos() token.Pos

Jump to

Keyboard shortcuts

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