sema

package
v0.0.0-...-b865eba Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2025 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package sema implements the semantic analyzer for the Umka language.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissingExpr  = fmt.Errorf("missing expression")
	ErrMissingValue = fmt.Errorf("missing value")
)

Functions

This section is empty.

Types

type Analyzer

type Analyzer struct {
	Modules map[string]ast.Module
	Types   map[ast.Identifier]ast.Type
	Funcs   map[ast.Identifier]ast.DeclFunc
	// Consts holds only the constant declarations.
	Consts *Context
	// Globals holds the global constant and variable declarations.
	Globals *Context
	// contains filtered or unexported fields
}

func New

func New(root fs.FS) *Analyzer

func (*Analyzer) Analyze

func (a *Analyzer) Analyze(fileName string) (ast.Module, error)

type Context

type Context struct {
	Parent *Context
	Data   map[ast.Identifier]ast.Value
}

func NewContext

func NewContext(parent *Context) *Context

func (*Context) Get

func (c *Context) Get(ident ast.Identifier) (ast.Value, bool)

func (*Context) Set

func (c *Context) Set(ident ast.Identifier, value ast.Value)

type Error

type Error struct {
	Module   string
	Location ast.Location
	Err      error
}

func (Error) Error

func (e Error) Error() string

Jump to

Keyboard shortcuts

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