Documentation
¶
Index ¶
- type AddressOfExpr
- type ArrowLambda
- type AssignStmt
- type BinaryExpr
- type BlockExpr
- type BlockStmt
- type BooleanLiteral
- type BreakStmt
- type CallExpr
- type ChannelType
- type CloseExpr
- type ConstDecl
- type ConstSpec
- type ContinueStmt
- type Declaration
- type DeferStmt
- type DerefExpr
- type Directive
- type DiscardExpr
- type ElseStmt
- type EmptyExpr
- type ErrorExpr
- type Expression
- type ExpressionStmt
- type FieldAccessExpr
- type FieldDecl
- type FieldValue
- type FloatLiteral
- type ForConditionStmt
- type ForNumericStmt
- type ForRangeStmt
- type FunctionDecl
- type FunctionLiteral
- type FunctionType
- type GoStmt
- type Identifier
- type IfStmt
- type ImportDecl
- type IncDecStmt
- type IndexExpr
- type IntegerLiteral
- type InterfaceDecl
- type KeyValuePair
- type ListLiteralExpr
- type ListType
- type MakeExpr
- type MapLiteralExpr
- type MapType
- type MethodCallExpr
- type MethodSignature
- type NamedArgument
- type NamedType
- type Node
- type OnErrClause
- type OtherwiseCase
- type PanicExpr
- type Parameter
- type PetioleDecl
- type PipeExpr
- type PipedSwitchBody
- type PipedSwitchExpr
- type Position
- type PrimitiveType
- type Program
- type ReceiveExpr
- type Receiver
- type RecoverExpr
- type ReferenceType
- type ReturnExpr
- type ReturnStmt
- type RuneLiteral
- type SelectCase
- type SelectStmt
- type SendStmt
- type SkillDecl
- type SliceExpr
- type Statement
- type StringInterpolation
- type StringLiteral
- type StructLiteralExpr
- type SwitchStmt
- type TypeAnnotation
- type TypeAssertionExpr
- type TypeCase
- type TypeCastExpr
- type TypeDecl
- type TypeSwitchStmt
- type UnaryExpr
- type VarDeclStmt
- type WhenCase
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddressOfExpr ¶
type AddressOfExpr struct {
Token lexer.Token // The 'reference' token
Operand Expression // The expression to take address of
}
func (*AddressOfExpr) Pos ¶
func (e *AddressOfExpr) Pos() Position
func (*AddressOfExpr) TokenLiteral ¶
func (e *AddressOfExpr) TokenLiteral() string
type ArrowLambda ¶ added in v0.0.2
type ArrowLambda struct {
Token lexer.Token // The '=>' token
Parameters []*Parameter // May have nil Type for untyped params
Body Expression // Expression lambda: single expression (auto-return)
Block *BlockStmt // Block lambda: multi-statement body (mutually exclusive with Body)
}
ArrowLambda represents a short inline function using => syntax. Expression form: (r Repo) => r.Stars > 100 Block form: (r Repo) =>
name := r.Name return name
func (*ArrowLambda) Pos ¶ added in v0.0.2
func (e *ArrowLambda) Pos() Position
func (*ArrowLambda) TokenLiteral ¶ added in v0.0.2
func (e *ArrowLambda) TokenLiteral() string
type AssignStmt ¶
type AssignStmt struct {
Targets []Expression // Can be single or multiple targets
Values []Expression // Right-hand side values (can be single or multiple)
Token lexer.Token // The '=' token
OnErr *OnErrClause // Optional onerr clause (e.g., x = f() onerr panic "msg")
}
func (*AssignStmt) Pos ¶
func (s *AssignStmt) Pos() Position
func (*AssignStmt) TokenLiteral ¶
func (s *AssignStmt) TokenLiteral() string
type BinaryExpr ¶
type BinaryExpr struct {
Token lexer.Token // The operator token
Left Expression
Operator string
Right Expression
}
func (*BinaryExpr) Pos ¶
func (e *BinaryExpr) Pos() Position
func (*BinaryExpr) TokenLiteral ¶
func (e *BinaryExpr) TokenLiteral() string
type BlockExpr ¶
func (*BlockExpr) TokenLiteral ¶
type BlockStmt ¶
func (*BlockStmt) TokenLiteral ¶
type BooleanLiteral ¶
func (*BooleanLiteral) Pos ¶
func (e *BooleanLiteral) Pos() Position
func (*BooleanLiteral) TokenLiteral ¶
func (e *BooleanLiteral) TokenLiteral() string
type BreakStmt ¶
func (*BreakStmt) TokenLiteral ¶
type CallExpr ¶
type CallExpr struct {
Token lexer.Token // The '(' token or identifier
Function Expression
Arguments []Expression // Positional arguments
NamedArguments []*NamedArgument // Named arguments (e.g., name: value)
Variadic bool // true if 'many' used: f(many args)
}
func (*CallExpr) TokenLiteral ¶
type ChannelType ¶
type ChannelType struct {
Token lexer.Token // The 'channel' token
ElementType TypeAnnotation
}
func (*ChannelType) Pos ¶
func (t *ChannelType) Pos() Position
func (*ChannelType) TokenLiteral ¶
func (t *ChannelType) TokenLiteral() string
type CloseExpr ¶
type CloseExpr struct {
Token lexer.Token // The 'close' token
Channel Expression
}
func (*CloseExpr) TokenLiteral ¶
type ConstDecl ¶ added in v0.0.16
type ConstDecl struct {
Token lexer.Token // The 'const' token
Specs []*ConstSpec // One or more name=value pairs
}
ConstDecl represents a const declaration (single or grouped).
const MaxRetries = 5
const
StatusOK = 200
StatusNotFound = 404
func (*ConstDecl) TokenLiteral ¶ added in v0.0.16
type ConstSpec ¶ added in v0.0.16
type ConstSpec struct {
Name *Identifier
Value Expression // Required: const values must always be provided
}
ConstSpec is a single name = value pair inside a const block.
type ContinueStmt ¶
func (*ContinueStmt) Pos ¶
func (s *ContinueStmt) Pos() Position
func (*ContinueStmt) TokenLiteral ¶
func (s *ContinueStmt) TokenLiteral() string
type Declaration ¶
type Declaration interface {
Node
// contains filtered or unexported methods
}
type DeferStmt ¶
type DeferStmt struct {
Token lexer.Token // The 'defer' token
Call Expression // Can be CallExpr or MethodCallExpr
}
func (*DeferStmt) TokenLiteral ¶
type DerefExpr ¶
type DerefExpr struct {
Token lexer.Token // The 'dereference' token
Operand Expression // The expression to dereference
}
func (*DerefExpr) TokenLiteral ¶
type Directive ¶ added in v0.0.14
type Directive struct {
Token lexer.Token // The TOKEN_DIRECTIVE token
Name string // Directive name (e.g., "deprecated", "fix")
Args []string // Arguments (e.g., ["Use NewFunc instead"])
}
Directive represents a `# kuki:name args...` annotation attached to a declaration.
type DiscardExpr ¶
func (*DiscardExpr) Pos ¶
func (e *DiscardExpr) Pos() Position
func (*DiscardExpr) TokenLiteral ¶
func (e *DiscardExpr) TokenLiteral() string
type ElseStmt ¶
func (*ElseStmt) TokenLiteral ¶
type EmptyExpr ¶
type EmptyExpr struct {
Token lexer.Token // The 'empty' token
Type TypeAnnotation
}
func (*EmptyExpr) TokenLiteral ¶
type ErrorExpr ¶
type ErrorExpr struct {
Token lexer.Token // The 'error' token
Message Expression // Usually a string literal
}
func (*ErrorExpr) TokenLiteral ¶
type Expression ¶
type Expression interface {
Node
// contains filtered or unexported methods
}
type ExpressionStmt ¶
type ExpressionStmt struct {
Expression Expression
OnErr *OnErrClause // Optional onerr clause (e.g., f() onerr panic "msg")
}
func (*ExpressionStmt) Pos ¶
func (s *ExpressionStmt) Pos() Position
func (*ExpressionStmt) TokenLiteral ¶
func (s *ExpressionStmt) TokenLiteral() string
type FieldAccessExpr ¶ added in v0.0.14
type FieldAccessExpr struct {
Token lexer.Token // The '.' token
Object Expression // Can be nil for shorthand pipes: |> .Field
Field *Identifier
}
func (*FieldAccessExpr) Pos ¶ added in v0.0.14
func (e *FieldAccessExpr) Pos() Position
func (*FieldAccessExpr) TokenLiteral ¶ added in v0.0.14
func (e *FieldAccessExpr) TokenLiteral() string
type FieldDecl ¶
type FieldDecl struct {
Name *Identifier
Type TypeAnnotation
Tag string // Struct tag (e.g., `json:"name"`)
}
type FieldValue ¶
type FieldValue struct {
Name *Identifier
Value Expression
}
type FloatLiteral ¶
func (*FloatLiteral) Pos ¶
func (e *FloatLiteral) Pos() Position
func (*FloatLiteral) TokenLiteral ¶
func (e *FloatLiteral) TokenLiteral() string
type ForConditionStmt ¶
type ForConditionStmt struct {
Token lexer.Token // The 'for' token
Condition Expression
Body *BlockStmt
}
ForConditionStmt: for condition
func (*ForConditionStmt) Pos ¶
func (s *ForConditionStmt) Pos() Position
func (*ForConditionStmt) TokenLiteral ¶
func (s *ForConditionStmt) TokenLiteral() string
type ForNumericStmt ¶
type ForNumericStmt struct {
Token lexer.Token // The 'for' token
Variable *Identifier
Start Expression
End Expression
Through bool // true for 'through', false for 'to'
Body *BlockStmt
}
ForNumericStmt: for i from start to end / for i from start through end
func (*ForNumericStmt) Pos ¶
func (s *ForNumericStmt) Pos() Position
func (*ForNumericStmt) TokenLiteral ¶
func (s *ForNumericStmt) TokenLiteral() string
type ForRangeStmt ¶
type ForRangeStmt struct {
Token lexer.Token // The 'for' token
Variable *Identifier
Index *Identifier // Optional (for index, item in collection)
Collection Expression
Body *BlockStmt
}
ForRangeStmt: for item in collection
func (*ForRangeStmt) Pos ¶
func (s *ForRangeStmt) Pos() Position
func (*ForRangeStmt) TokenLiteral ¶
func (s *ForRangeStmt) TokenLiteral() string
type FunctionDecl ¶
type FunctionDecl struct {
Token lexer.Token // The 'func' token
Name *Identifier
Parameters []*Parameter
Returns []TypeAnnotation
Body *BlockStmt
Receiver *Receiver // For methods (optional)
Directives []Directive // Attached `# kuki:` directives
}
func (*FunctionDecl) Pos ¶
func (d *FunctionDecl) Pos() Position
func (*FunctionDecl) TokenLiteral ¶
func (d *FunctionDecl) TokenLiteral() string
type FunctionLiteral ¶
type FunctionLiteral struct {
Token lexer.Token // The 'func' token
Parameters []*Parameter
Returns []TypeAnnotation
Body *BlockStmt
}
func (*FunctionLiteral) Pos ¶
func (e *FunctionLiteral) Pos() Position
func (*FunctionLiteral) TokenLiteral ¶
func (e *FunctionLiteral) TokenLiteral() string
type FunctionType ¶
type FunctionType struct {
Token lexer.Token // The 'func' token
Parameters []TypeAnnotation // Parameter types
Returns []TypeAnnotation // Return types
}
FunctionType represents a function type annotation e.g., func(int, string) bool
func (*FunctionType) Pos ¶
func (t *FunctionType) Pos() Position
func (*FunctionType) TokenLiteral ¶
func (t *FunctionType) TokenLiteral() string
type GoStmt ¶
type GoStmt struct {
Token lexer.Token // The 'go' token
Call Expression // Can be CallExpr or MethodCallExpr (nil when Block is set)
Block *BlockStmt // Block form: go NEWLINE INDENT ... DEDENT (nil when Call is set)
}
func (*GoStmt) TokenLiteral ¶
type Identifier ¶
func (*Identifier) Pos ¶
func (e *Identifier) Pos() Position
func (*Identifier) TokenLiteral ¶
func (e *Identifier) TokenLiteral() string
type IfStmt ¶
type IfStmt struct {
Token lexer.Token // The 'if' token
Init Statement // Optional initialization statement (can be nil)
Condition Expression
Consequence *BlockStmt
Alternative Statement // Can be ElseStmt or another IfStmt (else if)
}
func (*IfStmt) TokenLiteral ¶
type ImportDecl ¶
type ImportDecl struct {
Token lexer.Token // The 'import' token
Path *StringLiteral
Alias *Identifier // Optional alias
}
func (*ImportDecl) Pos ¶
func (d *ImportDecl) Pos() Position
func (*ImportDecl) TokenLiteral ¶
func (d *ImportDecl) TokenLiteral() string
type IncDecStmt ¶
type IncDecStmt struct {
Token lexer.Token // The '++' or '--' token
Variable Expression
Operator string // "++" or "--"
}
func (*IncDecStmt) Pos ¶
func (s *IncDecStmt) Pos() Position
func (*IncDecStmt) TokenLiteral ¶
func (s *IncDecStmt) TokenLiteral() string
type IndexExpr ¶
type IndexExpr struct {
Token lexer.Token // The '[' token
Left Expression
Index Expression
}
func (*IndexExpr) TokenLiteral ¶
type IntegerLiteral ¶
func (*IntegerLiteral) Pos ¶
func (e *IntegerLiteral) Pos() Position
func (*IntegerLiteral) TokenLiteral ¶
func (e *IntegerLiteral) TokenLiteral() string
type InterfaceDecl ¶
type InterfaceDecl struct {
Token lexer.Token // The 'interface' token
Name *Identifier
Methods []*MethodSignature
Directives []Directive // Attached `# kuki:` directives
}
func (*InterfaceDecl) Pos ¶
func (d *InterfaceDecl) Pos() Position
func (*InterfaceDecl) TokenLiteral ¶
func (d *InterfaceDecl) TokenLiteral() string
type KeyValuePair ¶
type KeyValuePair struct {
Key Expression
Value Expression
}
type ListLiteralExpr ¶
type ListLiteralExpr struct {
Token lexer.Token // The '[' token or 'list' keyword
Type TypeAnnotation
Elements []Expression
}
func (*ListLiteralExpr) Pos ¶
func (e *ListLiteralExpr) Pos() Position
func (*ListLiteralExpr) TokenLiteral ¶
func (e *ListLiteralExpr) TokenLiteral() string
type ListType ¶
type ListType struct {
Token lexer.Token // The 'list' token
ElementType TypeAnnotation
}
func (*ListType) TokenLiteral ¶
type MakeExpr ¶
type MakeExpr struct {
Token lexer.Token // The 'make' token
Type TypeAnnotation
Args []Expression // Size/capacity for slices, channels
}
func (*MakeExpr) TokenLiteral ¶
type MapLiteralExpr ¶
type MapLiteralExpr struct {
Token lexer.Token // The '{' token or 'map' keyword
KeyType TypeAnnotation
ValType TypeAnnotation
Pairs []*KeyValuePair
}
func (*MapLiteralExpr) Pos ¶
func (e *MapLiteralExpr) Pos() Position
func (*MapLiteralExpr) TokenLiteral ¶
func (e *MapLiteralExpr) TokenLiteral() string
type MapType ¶
type MapType struct {
Token lexer.Token // The 'map' token
KeyType TypeAnnotation
ValueType TypeAnnotation
}
func (*MapType) TokenLiteral ¶
type MethodCallExpr ¶
type MethodCallExpr struct {
Token lexer.Token // The '.' token
Object Expression // Can be nil for shorthand pipes: |> .Method()
Method *Identifier
Arguments []Expression // Positional arguments
NamedArguments []*NamedArgument // Named arguments (e.g., name: value)
Variadic bool // true if 'many' used: obj.f(many args)
}
func (*MethodCallExpr) Pos ¶
func (e *MethodCallExpr) Pos() Position
func (*MethodCallExpr) TokenLiteral ¶
func (e *MethodCallExpr) TokenLiteral() string
type MethodSignature ¶
type MethodSignature struct {
Name *Identifier
Parameters []*Parameter
Returns []TypeAnnotation
}
type NamedArgument ¶
type NamedArgument struct {
Token lexer.Token // The identifier token for the name
Name *Identifier
Value Expression
}
NamedArgument represents a named argument in a function call e.g., foo(name: "value", count: 5)
func (*NamedArgument) Pos ¶
func (e *NamedArgument) Pos() Position
func (*NamedArgument) TokenLiteral ¶
func (e *NamedArgument) TokenLiteral() string
type NamedType ¶
func (*NamedType) TokenLiteral ¶
type OnErrClause ¶
type OnErrClause struct {
Token lexer.Token // The 'onerr' token
Handler Expression // Error handler (panic, error, empty, discard, or default value)
Explain string // Optional explanation/hint for LLM (e.g., onerr explain "hint message")
ShorthandReturn bool // True for bare "onerr return" — propagate error with zero values
ShorthandContinue bool // True for bare "onerr continue"
ShorthandBreak bool // True for bare "onerr break"
Alias string // Named alias for the caught error in block handlers (e.g., "onerr as e")
}
OnErrClause represents the error handling part of an onerr statement. It is not an AST node itself — it is a field on VarDeclStmt, AssignStmt, and ExpressionStmt.
type OtherwiseCase ¶ added in v0.0.2
type PanicExpr ¶
type PanicExpr struct {
Token lexer.Token // The 'panic' token
Message Expression
}
func (*PanicExpr) TokenLiteral ¶
type Parameter ¶
type Parameter struct {
Name *Identifier
Type TypeAnnotation
Variadic bool // true if "many" keyword used
DefaultValue Expression // Optional default value (e.g., count int = 10)
}
type PetioleDecl ¶
type PetioleDecl struct {
Token lexer.Token // The 'petiole' token
Name *Identifier
}
func (*PetioleDecl) Pos ¶
func (d *PetioleDecl) Pos() Position
func (*PetioleDecl) TokenLiteral ¶
func (d *PetioleDecl) TokenLiteral() string
type PipeExpr ¶
type PipeExpr struct {
Token lexer.Token // The '|>' token
Left Expression
Right Expression // Must be a function call
}
func (*PipeExpr) TokenLiteral ¶
type PipedSwitchBody ¶ added in v0.0.13
type PipedSwitchBody interface {
Node
// contains filtered or unexported methods
}
type PipedSwitchExpr ¶ added in v0.0.13
type PipedSwitchExpr struct {
Token lexer.Token // The '|>' token
Left Expression // The value being piped into the switch
Switch PipedSwitchBody // The switch block itself
}
func (*PipedSwitchExpr) Pos ¶ added in v0.0.13
func (e *PipedSwitchExpr) Pos() Position
func (*PipedSwitchExpr) TokenLiteral ¶ added in v0.0.13
func (e *PipedSwitchExpr) TokenLiteral() string
type PrimitiveType ¶
type PrimitiveType struct {
Token lexer.Token // The type token
Name string // int, float, string, bool, etc.
}
func (*PrimitiveType) Pos ¶
func (t *PrimitiveType) Pos() Position
func (*PrimitiveType) TokenLiteral ¶
func (t *PrimitiveType) TokenLiteral() string
type Program ¶
type Program struct {
Target string // Directive target (e.g., "mcp")
PetioleDecl *PetioleDecl // Optional petiole declaration
SkillDecl *SkillDecl // Optional skill declaration
Imports []*ImportDecl // Import declarations
Declarations []Declaration // Top-level declarations (types, interfaces, functions)
}
func (*Program) TokenLiteral ¶
type ReceiveExpr ¶
type ReceiveExpr struct {
Token lexer.Token // The 'receive' token
Channel Expression
}
func (*ReceiveExpr) Pos ¶
func (e *ReceiveExpr) Pos() Position
func (*ReceiveExpr) TokenLiteral ¶
func (e *ReceiveExpr) TokenLiteral() string
type Receiver ¶
type Receiver struct {
Name *Identifier // The receiver variable name
Type TypeAnnotation
}
type RecoverExpr ¶
func (*RecoverExpr) Pos ¶
func (e *RecoverExpr) Pos() Position
func (*RecoverExpr) TokenLiteral ¶
func (e *RecoverExpr) TokenLiteral() string
type ReferenceType ¶
type ReferenceType struct {
Token lexer.Token // The 'reference' token
ElementType TypeAnnotation
}
func (*ReferenceType) Pos ¶
func (t *ReferenceType) Pos() Position
func (*ReferenceType) TokenLiteral ¶
func (t *ReferenceType) TokenLiteral() string
type ReturnExpr ¶
type ReturnExpr struct {
Token lexer.Token // The 'return' token
Values []Expression
}
func (*ReturnExpr) Pos ¶
func (e *ReturnExpr) Pos() Position
func (*ReturnExpr) TokenLiteral ¶
func (e *ReturnExpr) TokenLiteral() string
type ReturnStmt ¶
type ReturnStmt struct {
Token lexer.Token // The 'return' token
Values []Expression
}
func (*ReturnStmt) Pos ¶
func (s *ReturnStmt) Pos() Position
func (*ReturnStmt) TokenLiteral ¶
func (s *ReturnStmt) TokenLiteral() string
type RuneLiteral ¶
func (*RuneLiteral) Pos ¶
func (e *RuneLiteral) Pos() Position
func (*RuneLiteral) TokenLiteral ¶
func (e *RuneLiteral) TokenLiteral() string
type SelectCase ¶ added in v0.0.6
type SelectStmt ¶ added in v0.0.6
type SelectStmt struct {
Token lexer.Token // The 'select' token
Cases []*SelectCase
Otherwise *OtherwiseCase // Optional default case
}
func (*SelectStmt) Pos ¶ added in v0.0.6
func (s *SelectStmt) Pos() Position
func (*SelectStmt) TokenLiteral ¶ added in v0.0.6
func (s *SelectStmt) TokenLiteral() string
type SendStmt ¶
type SendStmt struct {
Token lexer.Token // The 'send' token
Value Expression
Channel Expression
}
func (*SendStmt) TokenLiteral ¶
type SkillDecl ¶ added in v0.0.5
type SkillDecl struct {
Token lexer.Token // The 'skill' token
Name *Identifier
Description string // Description field
Version string // Version field
}
func (*SkillDecl) TokenLiteral ¶ added in v0.0.5
type SliceExpr ¶
type SliceExpr struct {
Token lexer.Token // The '[' token
Left Expression
Start Expression // Can be nil
End Expression // Can be nil
}
func (*SliceExpr) TokenLiteral ¶
type StringInterpolation ¶
type StringInterpolation struct {
IsLiteral bool // True for literal parts, false for expressions
Literal string // For literal parts
Expr Expression // For expression parts
}
type StringLiteral ¶
type StringLiteral struct {
Token lexer.Token
Value string
Interpolated bool // True if contains {expr}
Parts []*StringInterpolation // For interpolated strings
}
func (*StringLiteral) Pos ¶
func (e *StringLiteral) Pos() Position
func (*StringLiteral) TokenLiteral ¶
func (e *StringLiteral) TokenLiteral() string
type StructLiteralExpr ¶
type StructLiteralExpr struct {
Token lexer.Token // The type identifier
Type TypeAnnotation
Fields []*FieldValue
}
func (*StructLiteralExpr) Pos ¶
func (e *StructLiteralExpr) Pos() Position
func (*StructLiteralExpr) TokenLiteral ¶
func (e *StructLiteralExpr) TokenLiteral() string
type SwitchStmt ¶ added in v0.0.2
type SwitchStmt struct {
Token lexer.Token // The 'switch' token
Expression Expression // Optional (nil for condition switch)
Cases []*WhenCase
Otherwise *OtherwiseCase // Optional
}
func (*SwitchStmt) Pos ¶ added in v0.0.2
func (s *SwitchStmt) Pos() Position
func (*SwitchStmt) TokenLiteral ¶ added in v0.0.2
func (s *SwitchStmt) TokenLiteral() string
type TypeAnnotation ¶
type TypeAnnotation interface {
Node
// contains filtered or unexported methods
}
type TypeAssertionExpr ¶
type TypeAssertionExpr struct {
Token lexer.Token // The '.' token
Expression Expression
TargetType TypeAnnotation
}
func (*TypeAssertionExpr) Pos ¶
func (e *TypeAssertionExpr) Pos() Position
func (*TypeAssertionExpr) TokenLiteral ¶
func (e *TypeAssertionExpr) TokenLiteral() string
type TypeCase ¶ added in v0.0.5
type TypeCase struct {
Token lexer.Token // The 'when' token
Type TypeAnnotation // The type to match
Body *BlockStmt
}
TypeCase: when reference SomeType / when SomeType
type TypeCastExpr ¶
type TypeCastExpr struct {
Token lexer.Token // The 'as' token
Expression Expression
TargetType TypeAnnotation
}
func (*TypeCastExpr) Pos ¶
func (e *TypeCastExpr) Pos() Position
func (*TypeCastExpr) TokenLiteral ¶
func (e *TypeCastExpr) TokenLiteral() string
type TypeDecl ¶
type TypeDecl struct {
Token lexer.Token // The 'type' token
Name *Identifier
Fields []*FieldDecl // nil for type aliases
AliasType TypeAnnotation // non-nil for type aliases (e.g., func(...) ...)
Directives []Directive // Attached `# kuki:` directives
}
func (*TypeDecl) TokenLiteral ¶
type TypeSwitchStmt ¶ added in v0.0.5
type TypeSwitchStmt struct {
Token lexer.Token // The 'switch' token
Expression Expression // The expression to switch on
Binding *Identifier // The binding variable (e.g., e in "switch event as e")
Cases []*TypeCase // Type cases
Otherwise *OtherwiseCase // Optional default branch
}
TypeSwitchStmt: switch expr as binding
func (*TypeSwitchStmt) Pos ¶ added in v0.0.5
func (s *TypeSwitchStmt) Pos() Position
func (*TypeSwitchStmt) TokenLiteral ¶ added in v0.0.5
func (s *TypeSwitchStmt) TokenLiteral() string
type UnaryExpr ¶
type UnaryExpr struct {
Token lexer.Token // The operator token
Operator string
Right Expression
}
func (*UnaryExpr) TokenLiteral ¶
type VarDeclStmt ¶
type VarDeclStmt struct {
Names []*Identifier
Type TypeAnnotation // Optional (can be nil for inference)
Values []Expression // Right-hand side values (can be single or multiple)
Token lexer.Token // The identifier token or walrus token
OnErr *OnErrClause // Optional onerr clause (e.g., x := f() onerr panic "msg")
}
func (*VarDeclStmt) Pos ¶
func (s *VarDeclStmt) Pos() Position
func (*VarDeclStmt) TokenLiteral ¶
func (s *VarDeclStmt) TokenLiteral() string