liquid

package
v0.0.0-...-60d02c1 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2020 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsSubtype

func IsSubtype(e *Environment, t1, t2 types.Type) bool

IsSubType checks t1 <: t2 or not.

func JoinExpr

func JoinExpr(sep token.Token, es ...ast.Expr) ast.Expr

func TypeCheckExpr

func TypeCheckExpr(env *Environment, expr ast.Expr) types.Type

Types

type Environment

type Environment struct {
	// ExplicitRefinementMap is explicitly defined refinements.
	ExplicitRefinementMap ObjectRefinementMap

	// ImplicitRefinementMap is implicitly reasoned refinements, like assignment.
	ImplicitRefinementMap ObjectRefinementMap

	// Scope is current scope to type check
	Scope *types.Scope

	// Scope is current pos to type check
	Pos token.Pos

	// Pass is current analysis pass
	Pass *analysis.Pass
	// contains filtered or unexported fields
}

func NewEnvironment

func NewEnvironment(pass *analysis.Pass) *Environment

NewEnvironment creates new type environment with current analysis pass.

func (*Environment) AddFunArgRefinement

func (env *Environment) AddFunArgRefinement(label string, typ types.Type)

func (*Environment) ClearFunArgRefinement

func (env *Environment) ClearFunArgRefinement()

func (*Environment) Embedding

func (env *Environment) Embedding() ast.Expr

func (*Environment) RefinementTypeOf

func (env *Environment) RefinementTypeOf(object types.Object) types.Type

type NameRefinementMap

type NameRefinementMap map[string]types.Type

type ObjectRefinementMap

type ObjectRefinementMap map[types.Object]types.Type

type Result

type Result int
const (
	Valid Result = iota
	Invalid
	Unknown
)

func Query

func Query(env *Environment, p1, p2 ast.Expr) Result

make query ⟦e⟧ ∧ ⟦r1⟧ ⇒ ⟦r2⟧, and validate it.

Jump to

Keyboard shortcuts

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