parser

package
v0.0.0-...-724e561 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StringNode

func StringNode(n Node) string

Types

type ArrayMode

type ArrayMode int
const (
	ArrayModeFixed ArrayMode = iota
	ArrayModeInfer
	ArrayModePointer
)

type ArrayType

type ArrayType struct {
	Base      Expr
	Mode      ArrayMode
	FixedSize int64
	// contains filtered or unexported fields
}

func (ArrayType) GetSpan

func (n ArrayType) GetSpan() diagnostics.SectionSpan

type Assignment

type Assignment struct {
	Left  Expr
	Right Expr
	// contains filtered or unexported fields
}

func (Assignment) GetSpan

func (n Assignment) GetSpan() diagnostics.SectionSpan

type BaseType

type BaseType struct {
	Name string
	// contains filtered or unexported fields
}

func (BaseType) GetSpan

func (n BaseType) GetSpan() diagnostics.SectionSpan

type BinaryExpr

type BinaryExpr struct {
	Left  Expr
	Op    *lexer.Token
	Right Expr
	// contains filtered or unexported fields
}

func (BinaryExpr) GetSpan

func (n BinaryExpr) GetSpan() diagnostics.SectionSpan

type Block

type Block struct {
	Statements []Stmt
	// contains filtered or unexported fields
}

func (Block) GetSpan

func (n Block) GetSpan() diagnostics.SectionSpan

func (Block) HasReturn

func (b Block) HasReturn() bool

type CallExpr

type CallExpr struct {
	Callee Expr
	Args   []Expr
	// contains filtered or unexported fields
}

func (CallExpr) GetSpan

func (n CallExpr) GetSpan() diagnostics.SectionSpan

type CaseClause

type CaseClause struct {
	Values  []Expr
	Default bool
	Block   Node
	// contains filtered or unexported fields
}

func (CaseClause) GetSpan

func (n CaseClause) GetSpan() diagnostics.SectionSpan

type CastExpr

type CastExpr struct {
	Target   Expr
	CastedTo Expr
	// contains filtered or unexported fields
}

func (CastExpr) GetSpan

func (n CastExpr) GetSpan() diagnostics.SectionSpan

type CompositeLiteral

type CompositeLiteral struct {
	Literals []Expr
	// contains filtered or unexported fields
}

func (CompositeLiteral) GetSpan

func (n CompositeLiteral) GetSpan() diagnostics.SectionSpan

type Declaration

type Declaration struct {
	Exported bool
	Value    Stmt
	// contains filtered or unexported fields
}

func (Declaration) GetSpan

func (n Declaration) GetSpan() diagnostics.SectionSpan

type Decrement

type Decrement struct {
	Target Expr
	// contains filtered or unexported fields
}

func (Decrement) GetSpan

func (n Decrement) GetSpan() diagnostics.SectionSpan

type ErrorNode

type ErrorNode struct {
	Message string
	// contains filtered or unexported fields
}

func (ErrorNode) GetSpan

func (n ErrorNode) GetSpan() diagnostics.SectionSpan

type Expr

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

type ExprStmt

type ExprStmt struct {
	Value Expr
	// contains filtered or unexported fields
}

func (ExprStmt) GetSpan

func (n ExprStmt) GetSpan() diagnostics.SectionSpan

type For

type For struct {
	Init  Stmt
	Cond  Expr
	Post  Stmt
	Block Stmt
	// contains filtered or unexported fields
}

func (For) GetSpan

func (n For) GetSpan() diagnostics.SectionSpan

type FunctionArg

type FunctionArg struct {
	Type Expr
	Name string
	// contains filtered or unexported fields
}

func (FunctionArg) GetSpan

func (n FunctionArg) GetSpan() diagnostics.SectionSpan

type FunctionDeclaration

type FunctionDeclaration struct {
	Name    string
	Returns Expr
	Args    []Node
	Block   *Block
	// contains filtered or unexported fields
}

func (FunctionDeclaration) GetSpan

func (n FunctionDeclaration) GetSpan() diagnostics.SectionSpan

type GroupExpr

type GroupExpr struct {
	Grouped Expr
	// contains filtered or unexported fields
}

func (GroupExpr) GetSpan

func (n GroupExpr) GetSpan() diagnostics.SectionSpan

type Identifier

type Identifier struct {
	Name string
	// contains filtered or unexported fields
}

func (Identifier) GetSpan

func (n Identifier) GetSpan() diagnostics.SectionSpan

type If

type If struct {
	Cond  Expr
	Block Stmt
	Elifs []Stmt
	Else  Stmt
	// contains filtered or unexported fields
}

func (If) GetSpan

func (n If) GetSpan() diagnostics.SectionSpan

type Increment

type Increment struct {
	Target Expr
	// contains filtered or unexported fields
}

func (Increment) GetSpan

func (n Increment) GetSpan() diagnostics.SectionSpan

type IndexExpr

type IndexExpr struct {
	Target Expr
	Index  Expr
	// contains filtered or unexported fields
}

func (IndexExpr) GetSpan

func (n IndexExpr) GetSpan() diagnostics.SectionSpan

type InferType

type InferType struct {
	// contains filtered or unexported fields
}

func (InferType) GetSpan

func (n InferType) GetSpan() diagnostics.SectionSpan

type LitBool

type LitBool struct {
	Value bool
	// contains filtered or unexported fields
}

func (LitBool) GetSpan

func (n LitBool) GetSpan() diagnostics.SectionSpan

type LitFloat

type LitFloat struct {
	Value float64
	// contains filtered or unexported fields
}

func (LitFloat) GetSpan

func (n LitFloat) GetSpan() diagnostics.SectionSpan

type LitInteger

type LitInteger struct {
	Value    int64
	Unsigned bool
	// contains filtered or unexported fields
}

func (LitInteger) GetSpan

func (n LitInteger) GetSpan() diagnostics.SectionSpan

type LitString

type LitString struct {
	Value string
	// contains filtered or unexported fields
}

func (LitString) GetSpan

func (n LitString) GetSpan() diagnostics.SectionSpan

type Node

type Node interface {
	GetSpan() diagnostics.SectionSpan
	// contains filtered or unexported methods
}

type ParseOptions

type ParseOptions struct {
	Throw bool
}

type Parser

type Parser interface {
	diagnostics.MightFail
	Parse(ts *lexer.TokenStream, opts *ParseOptions) Node
}

func Default

func Default() Parser

type PointerType

type PointerType struct {
	Value Expr
	// contains filtered or unexported fields
}

func (PointerType) GetSpan

func (n PointerType) GetSpan() diagnostics.SectionSpan

type Program

type Program struct {
	Statements []Stmt
	File       *diagnostics.File
	// contains filtered or unexported fields
}

func (Program) GetSpan

func (n Program) GetSpan() diagnostics.SectionSpan

func (*Program) String

func (p *Program) String() string

type Repeat

type Repeat struct {
	Count Expr
	Block Stmt
	// contains filtered or unexported fields
}

func (Repeat) GetSpan

func (n Repeat) GetSpan() diagnostics.SectionSpan

type Return

type Return struct {
	Values []Expr
	// contains filtered or unexported fields
}

func (Return) GetSpan

func (n Return) GetSpan() diagnostics.SectionSpan

type Stmt

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

type Switch

type Switch struct {
	Subject Expr
	Cases   []*CaseClause
	// contains filtered or unexported fields
}

func (Switch) GetSpan

func (n Switch) GetSpan() diagnostics.SectionSpan

type TupleType

type TupleType struct {
	Types []Expr
	// contains filtered or unexported fields
}

func (TupleType) GetSpan

func (n TupleType) GetSpan() diagnostics.SectionSpan

type UnaryExpr

type UnaryExpr struct {
	Operand Expr
	Op      *lexer.Token
	// contains filtered or unexported fields
}

func (UnaryExpr) GetSpan

func (n UnaryExpr) GetSpan() diagnostics.SectionSpan

type VariableDeclaration

type VariableDeclaration struct {
	Name  string
	Type  Expr
	Value Expr
	// contains filtered or unexported fields
}

func (VariableDeclaration) GetSpan

func (n VariableDeclaration) GetSpan() diagnostics.SectionSpan

type While

type While struct {
	Cond  Expr
	Block Stmt
	// contains filtered or unexported fields
}

func (While) GetSpan

func (n While) GetSpan() diagnostics.SectionSpan

Jump to

Keyboard shortcuts

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