syntax

package
v0.8.0-a.21 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateFile

func ValidateFile(f *File) *parse.ErrorList

Types

type CompositeDecl

type CompositeDecl struct {
	S    parse.Span
	Name Ident
	Kind NodeKind
	Body FactoryBody
}

type ConstraintDecl

type ConstraintDecl struct {
	S     parse.Span
	Value parse.Expr
}

type EncryptionDecl

type EncryptionDecl struct {
	S        parse.Span
	Selector Ident
	Body     *parse.ObjectLit
}

type FactoryBody

type FactoryBody struct {
	S              parse.Span
	Description    *parse.StringLit
	Inputs         []InputDecl
	Locals         []LocalDecl
	Constraints    []ConstraintDecl
	Imports        []ImportDecl
	LibraryConfigs []LibraryConfigDecl
	StateMoves     []StateMoveDecl
	Resources      []NodeDecl
	Data           []NodeDecl
	Actions        []NodeDecl
	Outputs        []OutputDecl
}

type FactoryFile

type FactoryFile struct {
	S    parse.Span
	Body FactoryBody
}

type File

type File struct {
	S           parse.Span
	Kind        FileKind
	Path        string
	Factory     *FactoryFile
	Stack       *StackFile
	Project     *ProjectFile
	ProjectLock *ProjectLockFile
	Library     *LibraryFile
	Comments    []parse.Comment
}

func LowerFile

func LowerFile(f *parse.File) (*File, *parse.ErrorList)

func ParseSource

func ParseSource(path string, b []byte) (*File, error)

type FileKind

type FileKind int
const (
	FileUnknown FileKind = iota
	FileFactory
	FileStack
	FileProject
	FileProjectLock
	FileLibrary
)

type Ident

type Ident struct {
	S    parse.Span
	Name string
}

type ImportDecl

type ImportDecl struct {
	S     parse.Span
	Alias Ident
	Ref   *parse.StringLit
}

type InputDecl

type InputDecl struct {
	S    parse.Span
	Name Ident
	Body *parse.ObjectLit
	Type parse.TypeExpr
}

type LibraryConfigDecl

type LibraryConfigDecl struct {
	S     parse.Span
	Alias Ident
	Value parse.Expr
}

type LibraryFile

type LibraryFile struct {
	S       parse.Span
	Exports []CompositeDecl
}

type LocalDecl

type LocalDecl struct {
	S     parse.Span
	Name  Ident
	Value parse.Expr
}

type NodeDecl

type NodeDecl struct {
	S        parse.Span
	Kind     NodeKind
	Name     Ident
	Selector NodeSelector
	Body     *parse.ObjectLit
}

type NodeKind

type NodeKind string
const (
	NodeResource   NodeKind = "resource"
	NodeDataSource NodeKind = "data-source"
	NodeAction     NodeKind = "action"
)

type NodeSelector

type NodeSelector struct {
	S      parse.Span
	Alias  Ident
	Export Ident
}

type OutputDecl

type OutputDecl struct {
	S    parse.Span
	Name Ident
	Body *parse.ObjectLit
}

type ProjectFile

type ProjectFile struct {
	S             parse.Span
	UnobinVersion *parse.StringLit
	Requires      []ProjectRequire
	Replace       []ProjectReplace
}

type ProjectLockDep

type ProjectLockDep struct {
	S       parse.Span
	ID      StringKey
	Kind    Ident
	Version *parse.StringLit
	Commit  *parse.StringLit
	Hash    *parse.StringLit
}

type ProjectLockFile

type ProjectLockFile struct {
	S         parse.Span
	Version   *parse.NumberLit
	Toolchain *ProjectLockToolchain
	Deps      []ProjectLockDep
}

type ProjectLockToolchain

type ProjectLockToolchain struct {
	S             parse.Span
	UnobinVersion *parse.StringLit
}

type ProjectReplace

type ProjectReplace struct {
	S    parse.Span
	ID   StringKey
	Path *parse.StringLit
}

type ProjectRequire

type ProjectRequire struct {
	S        parse.Span
	ID       StringKey
	Version  *parse.StringLit
	Indirect *parse.BoolLit
}

type StackFactoryBlock

type StackFactoryBlock struct {
	S      parse.Span
	Pin    *parse.ObjectLit
	Inputs *parse.ObjectLit
}

type StackFile

type StackFile struct {
	S           parse.Span
	Factory     *StackFactoryBlock
	State       *StateDecl
	Encryption  *EncryptionDecl
	Locals      []LocalDecl
	Parallelism parse.Expr
}

type StateDecl

type StateDecl struct {
	S        parse.Span
	Selector Ident
	Body     *parse.ObjectLit
}

type StateMoveDecl

type StateMoveDecl struct {
	S    parse.Span
	From *StateMoveRef
	To   *StateMoveRef
}

type StateMoveRef

type StateMoveRef struct {
	S   parse.Span
	Ref stateref.EntryRef
}

type StringKey

type StringKey struct {
	S     parse.Span
	Value string
}

Jump to

Keyboard shortcuts

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