parse

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package parse discovers loom.Graph declarations and turns them into the model IR. It reads AST nodes only to find source locations and reproduce expressions; every type decision goes through go/types.

Index

Constants

View Source
const DefaultLoomPath = "github.com/Xwudao/loom"

DefaultLoomPath is the import path of the loom runtime package.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

Parser turns loom.Graph declarations into graphs.

func New

func New(ld *load.Loader, loomPath, base string) *Parser

New returns a Parser over a loaded package graph. base is the directory used to render source paths in diagnostics.

func (*Parser) ContextType

func (p *Parser) ContextType() types.Type

ContextType returns context.Context, or nil.

func (*Parser) LifecycleType

func (p *Parser) LifecycleType() types.Type

LifecycleType returns *loom.Lifecycle, or nil if the loom package is not part of the loaded graph.

func (*Parser) Package

func (p *Parser) Package(pkg *packages.Package) ([]*model.Graph, error)

Package returns the graphs declared in pkg, ordered by variable name.

Jump to

Keyboard shortcuts

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