resolver

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2022 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package resolver proVides tool for resolving variable and function declarations

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ResolveError

type ResolveError []error

func (ResolveError) Error

func (p ResolveError) Error() string

type Resolver

type Resolver struct {
	Scopes  []map[string]bool
	Globals map[string]bool
	// contains filtered or unexported fields
}

Stores state required to resolve a parse tree

func NewResolver

func NewResolver(lines []string, file string) Resolver

Constructs a new resolver

func (*Resolver) ResolveExprs

func (r *Resolver) ResolveExprs(exprs ast.Exprs) error

func (*Resolver) VisitAssignment

func (r *Resolver) VisitAssignment(a ast.Assignment) any

func (*Resolver) VisitBinary

func (r *Resolver) VisitBinary(b ast.Binary) any

func (*Resolver) VisitCallExpr

func (r *Resolver) VisitCallExpr(c ast.Call) any

func (*Resolver) VisitFnExpr

func (r *Resolver) VisitFnExpr(f ast.FnExpr) any

func (*Resolver) VisitGrouping

func (r *Resolver) VisitGrouping(g ast.Grouping) any

func (*Resolver) VisitIfExpr

func (r *Resolver) VisitIfExpr(i ast.IfExpr) any

func (*Resolver) VisitLiteral

func (r *Resolver) VisitLiteral(l ast.Literal) any

func (*Resolver) VisitReturnExpr

func (r *Resolver) VisitReturnExpr(re ast.Return) any

func (*Resolver) VisitUnary

func (r *Resolver) VisitUnary(u ast.Unary) any

func (*Resolver) VisitVarDecl

func (r *Resolver) VisitVarDecl(v ast.VarDecl) any

func (*Resolver) VisitWhileExpr

func (r *Resolver) VisitWhileExpr(w ast.WhileExpr) any

type UndeclaredVarErr

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

func (UndeclaredVarErr) Error

func (u UndeclaredVarErr) Error() string

Jump to

Keyboard shortcuts

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