ast

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Copyright 2025 The Hulo Authors. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AssignStmt

type AssignStmt struct {
	Lhs Expr
	Rhs Expr
}

type Attribute

type Attribute struct {
	Key   Expr
	Value Expr
}

type BasicLit

type BasicLit struct {
	Kind  token.Token
	Value string
}

type BinaryExpr

type BinaryExpr struct {
	X     Expr        // left operand
	OpPos token.Pos   // position of Op
	Op    token.Token // operator
	Y     Expr        // right operand
}

A BinaryExpr node represents a binary expression.

func (*BinaryExpr) End

func (x *BinaryExpr) End() token.Pos

func (*BinaryExpr) Pos

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

type BlcokStmt

type BlcokStmt struct {
	List []Stmt
}

type BlockExpr

type BlockExpr struct {
	List []Expr
}

type BreakStmt

type BreakStmt struct {
	Break token.Pos
	Label *Ident
}

type CallExpr

type CallExpr struct {
	Func  Expr
	Args  []Expr
	Brace bool
}

type CaseStmt

type CaseStmt struct {
	Cond Expr
	Body *BlcokStmt
}

type CatchStmt

type CatchStmt struct {
	Cond Expr
	Body *BlcokStmt
}

type ContinueStmt

type ContinueStmt struct{}

type DataStmt

type DataStmt struct {
	Param []Expr
	Body  *BlcokStmt
}

type Decl

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

type ExplictExpr

type ExplictExpr struct {
	X Expr
	Y Expr
}

type Expr

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

type ExprStmt

type ExprStmt struct {
	Expr
}

type Fields

type Fields struct {
	Sep string // " " "," ";"
}

type File

type File struct {
	Name string

	Stmts []Stmt
}

type ForStmt

type ForStmt struct {
	Lhs  Expr
	Cond Expr
	Rhs  Expr
	Body *BlcokStmt
}

type ForeachStmt

type ForeachStmt struct {
	Lhs  Expr
	Rhs  Expr
	Body *BlcokStmt
}

type FuncStmt

type FuncStmt struct {
	Func Expr
	Recv []Expr
	Body *BlcokStmt
}

type HashTable

type HashTable map[any]any

type Ident

type Ident struct {
	NamePos token.Pos // identifier position
	Name    string    // identifier name
}

An Ident node represents an identifier.

func (*Ident) End

func (x *Ident) End() token.Pos

func (*Ident) Pos

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

type IfStmt

type IfStmt struct {
	Cond Expr
	Body *BlcokStmt
	Else Stmt
}

type IncDecExpr

type IncDecExpr struct {
	X      Expr
	Tok    token.Token // INC or DEC
	TokPos token.Pos   // position of "++" or "--"
}

++X --X

func (*IncDecExpr) End

func (x *IncDecExpr) End() token.Pos

func (*IncDecExpr) Pos

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

type IndexExpr

type IndexExpr struct {
	X      Expr
	Lbrack token.Token
	Index  Expr
	Rbrack token.Token
}

type LabelStmt

type LabelStmt struct {
	X Expr
}

type List

type List []Expr

type MemberAccess

type MemberAccess struct {
	Type    Expr
	Colon   token.Pos
	Method  Expr
	Generic Expr
	Recv    []Expr
}

type ModExpr

type ModExpr struct {
	X Expr
	Y Expr
}

type Node

type Node interface {
	Pos() token.Pos
	End() token.Pos
}

type ReturnStmt

type ReturnStmt struct {
	X Expr
}

type Stmt

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

type SubExpr

type SubExpr struct {
	X Expr
}

type SwitchPattern

type SwitchPattern int
const (
	SwitchPatternNone SwitchPattern = iota
	SwitchPatternRegex
	SwitchPatternWildcard
	SwitchPatternExact
)

func (SwitchPattern) String

func (p SwitchPattern) String() string

type SwitchStmt

type SwitchStmt struct {
	Pattern       SwitchPattern
	Casesensitive bool
	Cond          Expr
	Cases         []*CaseStmt
	Default       *CaseStmt
}

type ThrowStmt

type ThrowStmt struct {
	X Expr
}

type TryStmt

type TryStmt struct {
	Body    *BlcokStmt
	Catches []*CatchStmt
	Finally *BlcokStmt
}

type UsingAssembly

type UsingAssembly struct {
	Assembly token.Pos
	Path     string
}

type UsingDecl

type UsingDecl struct {
	Using token.Pos
	*UsingModule
	*UsingNamespace
	*UsingAssembly
}

type UsingModule

type UsingModule struct {
	Module token.Pos
	Name   *Ident
}

type UsingNamespace

type UsingNamespace struct {
	Namespace token.Pos
	Name      *Ident
}

type VarExpr

type VarExpr struct {
	Tok     token.Token // lbrace | lbrack
	Opening token.Pos
	X       Expr
	Closing token.Pos
}

type WhileStmt

type WhileStmt struct {
	Do   bool
	Cond Expr
	Body *BlcokStmt
}

Jump to

Keyboard shortcuts

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