syntax

package
v0.13.0-a.5 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: MIT Imports: 11 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateFile

func ValidateFile(f *File) *parse.ErrorList

Types

type AssetDecl added in v0.11.0

type AssetDecl struct {
	S      parse.Span
	Name   Ident
	Source *parse.StringLit
}

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
	Assets         []AssetDecl
	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 LowerParsedSource

func LowerParsedSource(path string, src []byte, f *lang.File) (*File, error)

LowerParsedSource lowers an already parsed UB source file into typed syntax.

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 SourceFileSpec

type SourceFileSpec struct {
	DisplayPath    string
	LibraryPath    string
	ProjectRelPath string
	PackageRelPath string
	LineStarts     []int
}

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