Documentation
¶
Index ¶
- func NewLexer(source []byte) *lexer
- type AnonymousFunction
- type Argument
- type BinaryExpression
- type BoolLiteral
- type BooleanType
- type Break
- type Comment
- type ConditionalMatchCase
- type ConditionalMatchExpression
- type CustomType
- type DeclaredType
- type Document
- type EnumDefinition
- type Expression
- type ExternalFunction
- type FloatType
- type ForInLoop
- type ForLoop
- type FunctionCall
- type FunctionDeclaration
- type FunctionType
- type GenericType
- type Identifier
- type IfStatement
- type ImplBlock
- type Import
- type InstanceMethod
- type InstanceProperty
- type IntType
- type InterpolatedStr
- type List
- type ListLiteral
- type Location
- type Map
- type MapEntry
- type MapLiteral
- type MatchCase
- type MatchExpression
- type NumLiteral
- type Operator
- type Parameter
- type ParseError
- type ParseResult
- type Point
- type Program
- type RangeExpression
- type RangeLoop
- type ResultType
- type Statement
- type StaticFunction
- type StaticFunctionDeclaration
- type StaticProperty
- type StrLiteral
- type StringType
- type StructDefinition
- type StructField
- type StructInstance
- type StructValue
- type TraitDefinition
- type TraitImplementation
- type Try
- type TypeDeclaration
- type UnaryExpression
- type VariableAssignment
- type VariableDeclaration
- type VoidLiteral
- type VoidType
- type WhileLoop
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AnonymousFunction ¶
type AnonymousFunction struct {
Location
Parameters []Parameter
ReturnType DeclaredType
Body []Statement
}
func (AnonymousFunction) String ¶
func (a AnonymousFunction) String() string
type BinaryExpression ¶
type BinaryExpression struct {
Location
Operator Operator
Left, Right Expression
}
func (BinaryExpression) String ¶
func (b BinaryExpression) String() string
type BoolLiteral ¶
type BooleanType ¶
type BooleanType struct {
Location
// contains filtered or unexported fields
}
func (BooleanType) GetName ¶
func (s BooleanType) GetName() string
func (BooleanType) IsNullable ¶
func (v BooleanType) IsNullable() bool
type ConditionalMatchCase ¶
type ConditionalMatchCase struct {
Location
Condition Expression // The boolean condition to evaluate (nil for catch-all case)
Body []Statement
}
func (ConditionalMatchCase) String ¶
func (c ConditionalMatchCase) String() string
type ConditionalMatchExpression ¶
type ConditionalMatchExpression struct {
Location
Cases []ConditionalMatchCase
Comments []Comment // Comments found within the match expression
}
func (ConditionalMatchExpression) String ¶
func (c ConditionalMatchExpression) String() string
type CustomType ¶
type CustomType struct {
Location
Name string
Type StaticProperty
Private bool
TypeArgs []DeclaredType
// contains filtered or unexported fields
}
func (CustomType) GetName ¶
func (u CustomType) GetName() string
func (CustomType) IsNullable ¶
func (u CustomType) IsNullable() bool
func (CustomType) String ¶
func (u CustomType) String() string
type DeclaredType ¶
type EnumDefinition ¶
type EnumDefinition struct {
Location
Name string
Variants []string
Private bool
Comments []Comment // Comments found within the enum definition
}
func (EnumDefinition) String ¶
func (e EnumDefinition) String() string
type Expression ¶
type Expression interface {
Statement
}
type ExternalFunction ¶
type ExternalFunction struct {
Location
Name string
Parameters []Parameter
ReturnType DeclaredType
ExternalBinding string
Private bool
}
func (ExternalFunction) String ¶
func (e ExternalFunction) String() string
type FloatType ¶
type FloatType struct {
Location
// contains filtered or unexported fields
}
func (FloatType) IsNullable ¶
type ForInLoop ¶
type ForInLoop struct {
Location
Cursor Identifier
Cursor2 Identifier
Iterable Expression
Body []Statement
}
type ForLoop ¶
type ForLoop struct {
Location
Init *VariableDeclaration
Condition Expression
Incrementer Statement
Body []Statement
}
type FunctionCall ¶
type FunctionCall struct {
Location
Name string
TypeArgs []DeclaredType
Args []Argument
Comments []Comment // Comments found within the function call
}
func (FunctionCall) String ¶
func (f FunctionCall) String() string
type FunctionDeclaration ¶
type FunctionDeclaration struct {
Location
Name string
Mutates bool
Parameters []Parameter
ReturnType DeclaredType
Body []Statement
Private bool
Comments []Comment // Comments found within the function declaration
}
func (FunctionDeclaration) String ¶
func (f FunctionDeclaration) String() string
type FunctionType ¶
type FunctionType struct {
Location
Nullable bool
Params []DeclaredType
Return DeclaredType
}
func (FunctionType) GetName ¶
func (f FunctionType) GetName() string
func (FunctionType) IsNullable ¶
func (f FunctionType) IsNullable() bool
type GenericType ¶
func (GenericType) GetName ¶
func (g GenericType) GetName() string
func (GenericType) IsNullable ¶
func (g GenericType) IsNullable() bool
func (GenericType) String ¶
func (g GenericType) String() string
type Identifier ¶
func (Identifier) String ¶
func (i Identifier) String() string
type IfStatement ¶
type IfStatement struct {
Location
Condition Expression
Body []Statement
Else Statement
}
func (IfStatement) String ¶
func (i IfStatement) String() string
type ImplBlock ¶
type ImplBlock struct {
Location
Target Identifier
Methods []FunctionDeclaration
Comments []Comment // Comments found within the impl block
}
type InstanceMethod ¶
type InstanceMethod struct {
Location
Target Expression
Method FunctionCall
}
func (InstanceMethod) String ¶
func (im InstanceMethod) String() string
type InstanceProperty ¶
type InstanceProperty struct {
Location
Target Expression
Property Identifier
}
func (InstanceProperty) String ¶
func (ip InstanceProperty) String() string
type IntType ¶
type IntType struct {
Location
// contains filtered or unexported fields
}
func (IntType) IsNullable ¶
type InterpolatedStr ¶
type InterpolatedStr struct {
Location
Chunks []Expression
}
func (InterpolatedStr) String ¶
func (i InterpolatedStr) String() string
type List ¶
type List struct {
Location
Element DeclaredType
// contains filtered or unexported fields
}
func (List) IsNullable ¶
type ListLiteral ¶
type ListLiteral struct {
Location
Items []Expression
Comments []Comment // Comments found within the list literal
}
func (ListLiteral) String ¶
func (l ListLiteral) String() string
type Location ¶
func (Location) GetLocation ¶
type Map ¶
type Map struct {
Location
Key DeclaredType
Value DeclaredType
// contains filtered or unexported fields
}
func (Map) IsNullable ¶
type MapEntry ¶
type MapEntry struct {
Key Expression
Value Expression
}
type MapLiteral ¶
type MapLiteral struct {
Location
Entries []MapEntry
Comments []Comment // Comments found within the map literal
}
func (MapLiteral) String ¶
func (m MapLiteral) String() string
type MatchCase ¶
type MatchCase struct {
Location
Pattern Expression
Body []Statement
}
type MatchExpression ¶
type MatchExpression struct {
Location
Subject Expression
Cases []MatchCase
Comments []Comment // Comments found within the match expression
}
func (MatchExpression) String ¶
func (m MatchExpression) String() string
type NumLiteral ¶
func (NumLiteral) String ¶
func (n NumLiteral) String() string
type ParseError ¶
type ParseResult ¶
type ParseResult struct {
Program *Program
Errors []ParseError
// contains filtered or unexported fields
}
func Parse ¶
func Parse(source []byte, fileName string) ParseResult
func (ParseResult) PrintErrors ¶
func (pr ParseResult) PrintErrors()
type RangeExpression ¶
type RangeExpression struct {
Location
Start, End Expression
}
func (RangeExpression) String ¶
func (b RangeExpression) String() string
type RangeLoop ¶
type RangeLoop struct {
Location
Cursor Identifier
Cursor2 Identifier
Start Expression
End Expression
Body []Statement
}
type ResultType ¶
type ResultType struct {
Location
Val, Err DeclaredType
// contains filtered or unexported fields
}
func (ResultType) GetName ¶
func (r ResultType) GetName() string
func (ResultType) IsNullable ¶
func (r ResultType) IsNullable() bool
type StaticFunction ¶
type StaticFunction struct {
Location
Target Expression
Function FunctionCall
}
func (StaticFunction) String ¶
func (s StaticFunction) String() string
type StaticFunctionDeclaration ¶
type StaticFunctionDeclaration struct {
FunctionDeclaration
Path StaticProperty
}
func (StaticFunctionDeclaration) String ¶
func (f StaticFunctionDeclaration) String() string
type StaticProperty ¶
type StaticProperty struct {
Location
Target Expression
Property Expression
}
func (StaticProperty) String ¶
func (s StaticProperty) String() string
type StrLiteral ¶
func (StrLiteral) String ¶
func (s StrLiteral) String() string
type StringType ¶
type StringType struct {
Location
// contains filtered or unexported fields
}
func (StringType) GetName ¶
func (s StringType) GetName() string
func (StringType) IsNullable ¶
func (v StringType) IsNullable() bool
type StructDefinition ¶
type StructDefinition struct {
Location
Name Identifier
Fields []StructField
Private bool
Comments []Comment // Comments found within the struct definition
}
func (StructDefinition) String ¶
func (s StructDefinition) String() string
type StructField ¶
type StructField struct {
Name Identifier
Type DeclaredType
}
type StructInstance ¶
type StructInstance struct {
Location
Name Identifier
Properties []StructValue
Comments []Comment // Comments found within the struct instance
}
func (StructInstance) String ¶
func (s StructInstance) String() string
type StructValue ¶
type StructValue struct {
Location
Name Identifier
Value Expression
}
type TraitDefinition ¶
type TraitDefinition struct {
Location
Name Identifier
Methods []FunctionDeclaration
Private bool
Comments []Comment // Comments found within the trait definition
}
func (TraitDefinition) String ¶
func (t TraitDefinition) String() string
type TraitImplementation ¶
type TraitImplementation struct {
Location
Trait Expression // Identifier | StaticProperty
ForType Identifier
Methods []FunctionDeclaration
}
func (TraitImplementation) String ¶
func (t TraitImplementation) String() string
type Try ¶
type Try struct {
Location
Expression Expression
CatchVar *Identifier // nil if no catch clause
CatchBlock []Statement // nil if no catch clause
// contains filtered or unexported fields
}
type TypeDeclaration ¶
type TypeDeclaration struct {
Location
Name Identifier
Type []DeclaredType
Private bool
}
func (TypeDeclaration) String ¶
func (t TypeDeclaration) String() string
type UnaryExpression ¶
type UnaryExpression struct {
Location
Operator Operator
Operand Expression
}
type VariableAssignment ¶
type VariableAssignment struct {
Location
Target Expression
Operator Operator
Value Expression
}
type VariableDeclaration ¶
type VariableDeclaration struct {
Location
Name string
Mutable bool
Value Expression
Type DeclaredType
}
func (VariableDeclaration) String ¶
func (v VariableDeclaration) String() string
type VoidLiteral ¶
type VoidLiteral struct {
Location
}
func (VoidLiteral) String ¶
func (v VoidLiteral) String() string
type VoidType ¶
type VoidType struct {
Location
// contains filtered or unexported fields
}
func (VoidType) IsNullable ¶
Click to show internal directories.
Click to hide internal directories.