Documentation
¶
Index ¶
- func DebugString(diags []Diagnostic) string
- func EosGrammar() *grammargen.Grammar
- func Language() (*gotreesitter.Language, error)
- func Parse(moduleName string, src []byte) (*File, []Diagnostic)
- func ParseTree(src []byte) (*gotreesitter.Tree, *gotreesitter.Language, error)
- type BinaryExpr
- type CallExpr
- type CallableDecl
- type CallableKind
- type Decl
- type Diagnostic
- type DimExpr
- type Expr
- type ExprStmt
- type Field
- type File
- type IdentExpr
- type LetStmt
- type NumberExpr
- type ParamDecl
- type ReturnStmt
- type Severity
- type Span
- type Stmt
- type StringExpr
- type TypeRef
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DebugString ¶
func DebugString(diags []Diagnostic) string
DebugString renders diagnostics for tests and callers.
func EosGrammar ¶
func EosGrammar() *grammargen.Grammar
EosGrammar returns the tree-sitter grammar for the Eos source language.
func Language ¶
func Language() (*gotreesitter.Language, error)
Language returns the cached generated Eos tree-sitter language.
func Parse ¶
func Parse(moduleName string, src []byte) (*File, []Diagnostic)
Parse parses Eos source into the compiler-facing AST.
func ParseTree ¶
func ParseTree(src []byte) (*gotreesitter.Tree, *gotreesitter.Language, error)
ParseTree parses Eos source and returns the tree-sitter tree and language.
Types ¶
type BinaryExpr ¶
BinaryExpr is a binary operator expression.
func (*BinaryExpr) ExprSpan ¶
func (e *BinaryExpr) ExprSpan() Span
type CallableDecl ¶
type CallableDecl struct {
Kind CallableKind
Name string
Params []Field
Result TypeRef
Results []Field
Body []Stmt
Span Span
}
CallableDecl is a kernel or pipeline declaration.
func (*CallableDecl) DeclSpan ¶
func (d *CallableDecl) DeclSpan() Span
type CallableKind ¶
type CallableKind string
CallableKind identifies a top-level callable declaration.
const ( CallableKernel CallableKind = "kernel" CallablePipeline CallableKind = "pipeline" )
type Decl ¶
type Decl interface {
DeclSpan() Span
// contains filtered or unexported methods
}
Decl is a top-level declaration.
type Diagnostic ¶
Diagnostic records a compiler message tied to source.
type Expr ¶
type Expr interface {
ExprSpan() Span
// contains filtered or unexported methods
}
Expr is an expression node.
type File ¶
type File struct {
ModuleName string
Source []byte
Decls []Decl
Diagnostics []Diagnostic
}
File is the parsed Eos source module.
type NumberExpr ¶
NumberExpr is a numeric literal.
func (*NumberExpr) ExprSpan ¶
func (e *NumberExpr) ExprSpan() Span
type ReturnStmt ¶
ReturnStmt returns a value from the callable.
func (*ReturnStmt) StmtSpan ¶
func (s *ReturnStmt) StmtSpan() Span
type Stmt ¶
type Stmt interface {
StmtSpan() Span
// contains filtered or unexported methods
}
Stmt is a statement in a callable body.
type StringExpr ¶
StringExpr is a string literal.
func (*StringExpr) ExprSpan ¶
func (e *StringExpr) ExprSpan() Span