ast

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyPatches

func ApplyPatches(node *Node)

func LetChain

func LetChain(node *Node) (bindings []*Node, body *Node)

LetChain returns the bindings in a consecutive, well-formed let chain and the first body that is not another let. Keeping this shape traversal in one place lets passes process long lexical scopes without consuming one Go stack frame per binding.

func RenameVar

func RenameVar(node *Node, oldName, newName string)

func ReplaceNext

func ReplaceNext(node *Node, replacement *Node)

func ReportError

func ReportError(reason string, line, column int)

func ResolveModules

func ResolveModules(root *Node)

func Stringify

func Stringify(node *Node) string

Types

type ErrorOutput

type ErrorOutput struct {
	Reason string `json:"reason"`
	Line   int    `json:"line"`
	Column int    `json:"column"`
}

type Node

type Node struct {
	Type     string
	Value    string
	Children []*Node
	Line     int
	Column   int
	Filename string
	Inferred TypeInfo
}

func ApplyWithContext

func ApplyWithContext(node *Node, ctxVars []*Node) *Node

func CopyNode

func CopyNode(n *Node) *Node

type TypeInfo

type TypeInfo struct {
	Kind         ValueKind
	Name         string
	Size         uint64
	Align        uint64
	Pointer      bool
	Key          *TypeInfo
	Element      *TypeInfo
	Fields       map[string]TypeInfo
	FieldOffsets map[string]uint64
}

TypeInfo describes both the source-level type and its native layout. Size and Align are zero for Unknown/Any because no backend-safe layout is known.

func Layout

func Layout(kind ValueKind) TypeInfo

type ValueKind

type ValueKind string

ValueKind is the language-level type category inferred by the semantic checker. Unknown is intentional: HowlFrame permits dynamic values at runtime, while known values still carry enough layout information for native backends to make safe decisions.

const (
	Unknown ValueKind = "unknown"
	Any     ValueKind = "any"
	Void    ValueKind = "void"
	Bool    ValueKind = "bool"
	Int     ValueKind = "int"
	Float   ValueKind = "float"
	String  ValueKind = "string"
	Bytes   ValueKind = "bytes"
	List    ValueKind = "list"
	Dict    ValueKind = "dict"
	Struct  ValueKind = "struct"
)

Jump to

Keyboard shortcuts

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