ast

package
v0.13.1-rc1 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package ast declares the types used to represent syntax trees.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BadExpr

type BadExpr struct {
	ValuePos int
	Kind     token.Token
	Value    string
}

BadExpr node is a placeholder for expressions containing syntax errors.

func (*BadExpr) Pos

func (e *BadExpr) Pos() int

Pos implements Node.

type BasicLit

type BasicLit struct {
	ValuePos int
	Kind     token.Token
	Value    string
}

BasicLit node represents a literal of basic type.

func (*BasicLit) Pos

func (e *BasicLit) Pos() int

type BinaryExpr

type BinaryExpr struct {
	X     Expr
	OpPos int
	Op    token.Token
	Y     Expr
}

BinaryExpr node represents a binary expression.

func (*BinaryExpr) Pos

func (e *BinaryExpr) Pos() int

type CallExpr

type CallExpr struct {
	Fun    Expr
	Lparen int
	Args   []Expr
	Rparen int
}

A CallExpr node represents an expression followed by an argument list.

func (*CallExpr) Pos

func (e *CallExpr) Pos() int

type Expr

type Expr interface {
	Node
	// contains filtered or unexported methods
}

All expression nodes implement the Expr interface.

type Ident

type Ident struct {
	NamePos int
	Name    string
}

Ident node represents an identifier.

func (*Ident) Pos

func (e *Ident) Pos() int

type IndexExpr

type IndexExpr struct {
	X      Expr
	Lbrack int
	Index  Expr
	Rbrack int
}

IndexExpr node represents an expression followed by an index.

func (*IndexExpr) Pos

func (e *IndexExpr) Pos() int

type LeftArrowExpr

type LeftArrowExpr struct {
	Fun     Expr
	Larrow  int
	Rdbrace int
	Arg     Expr
}

A LeftArrowExpr node represents an expression followed by an argument.

func (*LeftArrowExpr) Pos

func (e *LeftArrowExpr) Pos() int

type Node

type Node interface {
	Pos() int
}

All node types implement the Node interface.

type ParameterExpr

type ParameterExpr struct {
	Ldbrace int
	X       Expr
	Rdbrace int
	Quoted  bool
}

ParameterExpr node represents a parameter of template.

func (*ParameterExpr) Pos

func (e *ParameterExpr) Pos() int

type SelectorExpr

type SelectorExpr struct {
	X   Expr
	Sel *Ident
}

SelectorExpr node represents an expression followed by a selector.

func (*SelectorExpr) Pos

func (e *SelectorExpr) Pos() int

Jump to

Keyboard shortcuts

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