analyzer

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checker

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

func NewChecker

func NewChecker(scope *pkg.Scope, env *types.Environment) *Checker

func (*Checker) Assignable

func (c *Checker) Assignable(left, right types.Type) bool

func (*Checker) Comparable

func (c *Checker) Comparable(left, right types.Type) bool

func (*Checker) Convertible

func (c *Checker) Convertible(left, right types.Type) bool

func (*Checker) LookupTag

func (c *Checker) LookupTag(expr *ast.IdentExpr) (language.Tag, error)

func (*Checker) RegisterFn

func (c *Checker) RegisterFn(node *ast.FnDefStmt) error

func (*Checker) RegisterTarget

func (c *Checker) RegisterTarget(node *ast.DeclTarget) error

func (*Checker) RegisterType

func (c *Checker) RegisterType(node *ast.TypeDefStmt) error

func (*Checker) ResolveExpr

func (c *Checker) ResolveExpr(expr ast.Expr) (types.Type, error)

func (*Checker) ResolveType

func (c *Checker) ResolveType(expr ast.TypeExpr) (types.Type, error)

type Key

type Key struct {
	Name   string
	Fields map[language.Tag]string
}

type Section

type Section struct {
	Name      string
	Keys      map[string]*Key
	Templates map[string]*Template
	Sections  []*Section
}

type Semantics

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

func New

func New(file *parser.File, ast *ast.File, checker *Checker) *Semantics

func (Semantics) Errors

func (s Semantics) Errors() error

func (*Semantics) Scan

func (s *Semantics) Scan() error

func (*Semantics) ScanFns

func (s *Semantics) ScanFns() *pkg.Scope

func (*Semantics) ScanImports

func (s *Semantics) ScanImports() []*pkg.Package

func (Semantics) ScanName

func (s Semantics) ScanName() string

func (*Semantics) ScanSections

func (s *Semantics) ScanSections() []*Section

func (*Semantics) ScanTags

func (s *Semantics) ScanTags() map[string]language.Tag

func (*Semantics) ScanTypes

func (s *Semantics) ScanTypes() *types.Environment

type Template

type Template struct {
	Name   string
	Params []types.Type
	// TODO: figure this out?
	Fields map[language.Tag]int
}

Jump to

Keyboard shortcuts

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