checker

package
v0.0.0-...-46d7da7 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TypeChecker

type TypeChecker interface {
	// EvalType produces the type of an expression or an error if the type cannot be evaluated.
	// TODO: we probably want to use a golang type rather than pb.ValueType (a proto).
	EvalType(expr string, finder ast.AttributeDescriptorFinder) (dpb.ValueType, error)

	// AssertType evaluates the type of expr using the attribute set; if the evaluated type is equal to
	// the expected type we return nil, and return an error otherwise.
	AssertType(expr string, finder ast.AttributeDescriptorFinder, expectedType dpb.ValueType) error
}

TypeChecker validates a given expression for type safety.

func NewTypeChecker

func NewTypeChecker() TypeChecker

NewTypeChecker returns a new TypeChecker implementation.

Jump to

Keyboard shortcuts

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