checker

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package checker resolves names, infers local declaration types, validates assignments/returns, and records a type for every portable expression.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CaseBinding

type CaseBinding struct {
	Name  string
	Field EnumField
}

type CasePattern

type CasePattern struct {
	Variant     EnumVariant
	Bindings    []CaseBinding
	PayloadEnum bool
}

type Checker

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

type CodecApplication

type CodecApplication struct {
	Operation string
	Schema    CodecSchema
}

type CodecField

type CodecField struct {
	Name     string
	WireName string
	Schema   *CodecSchema
}

type CodecSchema

type CodecSchema struct {
	Type      types.Type
	Kind      string
	Module    string
	Reference *resolver.Binding
	Element   *CodecSchema
	Fields    []CodecField
}

type EnumField

type EnumField struct {
	Name string
	Type types.Type
}

type EnumVariant

type EnumVariant struct {
	EnumName      string
	Name          string
	Fields        []EnumField
	TypeArguments []types.Type
	Reference     *resolver.Binding
}

type GenericApplication

type GenericApplication struct {
	Name           string
	Kind           string
	TypeParameters []string
	TypeArguments  []types.Type
	Parameters     []types.Type
	ReturnType     types.Type
	Required       int
	Variadic       bool
}

type Result

type Result struct {
	Program             *ast.Program
	Expressions         map[ast.Expression]types.Type
	Variables           map[*ast.VariableStatement]types.Type
	Iterations          map[*ast.IterationExpression]types.Type
	Constants           map[ast.Expression]string
	ConstantOwners      map[*ast.VariableStatement]string
	Resolution          resolver.Result
	References          map[ast.Expression]resolver.Binding
	EnumConstructors    map[*ast.CallExpression]EnumVariant
	CasePatterns        map[ast.Expression]CasePattern
	GenericApplications map[*ast.GenericExpression]GenericApplication
	CodecApplications   map[*ast.CallExpression]CodecApplication
}

func Check

func Check(program *ast.Program, resolution resolver.Result) (Result, []diagnostic.Diagnostic)

Jump to

Keyboard shortcuts

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