ast

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const ArithmeticExprNode = "arithmetic_expr"
View Source
const BinaryExprNode = "binary_expr"
View Source
const CallExprNode = "call_expr"
View Source
const CommentStmtNode = "comment_stmt"
View Source
const DeclStmtNode = "decl_stmt"
View Source
const DeclTargetNode = "decl_target"
View Source
const EmptyEntryNode = "empty_entry"
View Source
const EmptyExprNode = "empty_expr"
View Source
const EmptyStmtNode = "empty_stmt"
View Source
const FieldNode = "field"
View Source
const FileNode = "file"
View Source
const FnDefStmtNode = "fn_def_stmt"
View Source
const GroupExprNode = "group_expr"
View Source
const IdentExprNode = "ident_expr"
View Source
const ImportExprNode = "import_expr"
View Source
const ImportStmtNode = "import_stmt"
View Source
const IndexExprNode = "index_expr"
View Source
const KeyEntryNode = "key_entry"
View Source
const ListTypeExprNode = "list_type_expr"
View Source
const MemberExprNode = "member_expr"
View Source
const NumberLitExprNode = "number_literal_expr"
View Source
const ParameterNode = "parameter"
View Source
const SectionStmtNode = "section_stmt"
View Source
const StringLitExprNode = "string_literal_expr"
View Source
const StructLitExprNode = "struct_literal_expr"
View Source
const TemplateEntryNode = "template_entry"
View Source
const TemplateLitExprNode = "template_literal_expr"
View Source
const TernaryExprNode = "ternary_expr"
View Source
const TypeDefStmtNode = "type_def_stmt"
View Source
const TypePairNode = "type_pair"

Variables

This section is empty.

Functions

func NewNode

func NewNode(t string, s, e token.Position) *node

func NewStmtNode

func NewStmtNode(t string, s, e token.Position, comments ...*CommentStmt) *stmtNode

Types

type ArithmeticExpr

type ArithmeticExpr struct {
	Node     `json:"node"`
	Operator token.Token `json:"operator"`
	Left     Expr        `json:"left"`
	Right    Expr        `json:"right"`
}

type BinaryExpr

type BinaryExpr struct {
	Node     `json:"node"`
	Operator token.Token `json:"operator"`
	Left     Expr        `json:"left"`
	Right    Expr        `json:"right"`
}

type CallExpr

type CallExpr struct {
	Node `json:"node"`
	Fn   Expr   `json:"fn"`
	Args []Expr `json:"args"`
}

type CommentStmt

type CommentStmt struct {
	Stmt    `json:"node"`
	Literal string `json:"literal"`
	Raw     string `json:"raw"`
}

type DeclStmt

type DeclStmt struct {
	Stmt    `json:"node"`
	Name    *IdentExpr    `json:"name"`
	Targets []*DeclTarget `json:"targets"`
}

type DeclTarget

type DeclTarget struct {
	Node `json:"node"`
	Tag  *StringLitExpr `json:"tag"`
	Name *IdentExpr     `json:"name"`
}

type EmptyEntry

type EmptyEntry struct {
	Node `json:"node"`
}

type EmptyExpr

type EmptyExpr struct {
	Node `json:"node"`
}

type EmptyStmt

type EmptyStmt struct {
	Stmt `json:"node"`
}

type Entry

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

type Expr

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

type Field

type Field struct {
	Node  `json:"node"`
	Tag   *IdentExpr `json:"tag"`
	Value Expr       `json:"value"`
}

type File

type File struct {
	Node    `json:"node"`
	Decl    *DeclStmt     `json:"decl"`
	Imports []*ImportStmt `json:"imports"`
	Stmts   []Stmt        `json:"stmts"`
}

type FnDefStmt

type FnDefStmt struct {
	Stmt   `json:"node"`
	Name   *IdentExpr   `json:"name"`
	Params []*Parameter `json:"params"`
	Body   Expr         `json:"body"`
}

type GroupExpr

type GroupExpr struct {
	Node `json:"node"`
	Expr Expr `json:"expr"`
}

type IdentExpr

type IdentExpr struct {
	Node  `json:"node"`
	Value string `json:"value"`
}

func NewIdent

func NewIdent(t token.Token) *IdentExpr

type ImportExpr

type ImportExpr struct {
	Node  `json:"node"`
	Left  *IdentExpr `json:"left"`
	Right *IdentExpr `json:"right"`
}

type ImportStmt

type ImportStmt struct {
	Stmt `json:"node"`
	List []*IdentExpr `json:"list"`
}

type IndexExpr

type IndexExpr struct {
	Node  `json:"node"`
	Host  Expr `json:"host"`
	Index Expr `json:"index"`
}

type KeyEntry

type KeyEntry struct {
	Node   `json:"node"`
	Name   *IdentExpr `json:"name"`
	Fields []*Field   `json:"fields"`
}

type ListTypeExpr

type ListTypeExpr struct {
	Node `json:"node"`
	Type TypeExpr `json:"type"`
}

type MemberExpr

type MemberExpr struct {
	Node  `json:"node"`
	Left  Expr       `json:"left"`
	Right *IdentExpr `json:"right"`
}

type Node

type Node interface {
	NodeType() string

	Start() token.Position
	End() token.Position
}

type NumberLitExpr

type NumberLitExpr struct {
	Node  `json:"node"`
	Value float64 `json:"value"`
}

type Parameter

type Parameter struct {
	Node  `json:"node"`
	Index int        `json:"index"`
	Name  *IdentExpr `json:"name"`
	Type  TypeExpr   `json:"type"`
}

type SectionStmt

type SectionStmt struct {
	Stmt `json:"node"`
	Name *IdentExpr `json:"name"`
	Body []Entry    `json:"body"`
}

type Stmt

type Stmt interface {
	Node
	Comments() []*CommentStmt
	// contains filtered or unexported methods
}

type StringLitExpr

type StringLitExpr struct {
	Node  `json:"node"`
	Value string `json:"value"`
}

func NewString

func NewString(t token.Token) *StringLitExpr

type StructLitExpr

type StructLitExpr struct {
	Node   `json:"node"`
	Fields []*TypePair `json:"list"`
}

type TemplateEntry

type TemplateEntry struct {
	Node        `json:"node"`
	Partitioned bool         `json:"partitioned"`
	Name        *IdentExpr   `json:"name"`
	Fields      []*Field     `json:"fields"`
	Params      []*Parameter `json:"params"`
}

type TemplateLitExpr

type TemplateLitExpr struct {
	Node  `json:"node"`
	Value []Expr `json:"value"`
}

type TernaryExpr

type TernaryExpr struct {
	Node      `json:"node"`
	Predicate Expr `json:"predicate"`
	Left      Expr `json:"left"`
	Right     Expr `json:"right"`
}

type TypeDefStmt

type TypeDefStmt struct {
	Stmt `json:"node"`
	Name *IdentExpr `json:"name"`
	Type TypeExpr   `json:"type"`
}

type TypeExpr

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

type TypePair

type TypePair struct {
	Node  `json:"node"`
	Index int        `json:"index"`
	Name  *IdentExpr `json:"name"`
	Type  TypeExpr   `json:"type"`
}

Jump to

Keyboard shortcuts

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