errs

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidType      = errors.New("invalid type")
	ErrCannotUseType    = errors.New("cannot use type")
	ErrNotComparable    = errors.New("expressions are not comparable")
	ErrNotOperable      = errors.New("expressions are not operable")
	ErrNotCallable      = errors.New("expression is not callable")
	ErrNotIndexable     = errors.New("expression is not indexable")
	ErrInvalidIndex     = errors.New("invalid index")
	ErrTooManyArguments = errors.New("too many arguments in call")
	ErrTooFewArguments  = errors.New("too few arguments in call")
	ErrNonBoolPredicate = errors.New("non bool predicate")
	ErrMultipleTypes    = errors.New("both sides of this expression must be the same type")
	ErrBuiltinOverride  = errors.New("is a builtin type you cannot override")

	ErrInvalidDeclName           = errors.New("invalid declaration name")
	ErrDuplicateDefinition       = errors.New("duplicate definition")
	ErrInvalidTargetTag          = errors.New("invalid target tag")
	ErrUndeclaredTargetTag       = errors.New("undeclared target tag")
	ErrMissingTargetField        = errors.New("missing target field")
	ErrUnresolvedImportReference = errors.New("unresolved import reference")
	ErrUnresolvedTypeReference   = errors.New("unresolved type reference")
	ErrUnresolvedFnReference     = errors.New("unresolved fn reference")
	ErrUnresolvedConstReference  = errors.New("unresolved const reference")
)
View Source
var (
	ErrUnexpectedToken       = errors.New("unexpected token")
	ErrUnterminatedConstruct = errors.New("unterminated")
	ErrMalformedNumber       = errors.New("malformed number")
)

Functions

func NewErrorSet

func NewErrorSet(file string, errors []error) error

Types

type CompileError

type CompileError struct{}

type ErrorSet

type ErrorSet struct {
	Errors []error
	// contains filtered or unexported fields
}

func (*ErrorSet) Error

func (e *ErrorSet) Error() string

func (*ErrorSet) File

func (e *ErrorSet) File() string

func (*ErrorSet) Position

func (e *ErrorSet) Position() (start token.Position, end token.Position)

func (*ErrorSet) Unwrap

func (e *ErrorSet) Unwrap() []error

type ReferenceError

type ReferenceError struct {
	Err      error
	Node     ast.Node
	Original ast.Node
	Value    string
}

func (*ReferenceError) Error

func (e *ReferenceError) Error() string

func (*ReferenceError) Name

func (e *ReferenceError) Name() string

func (*ReferenceError) Position

func (e *ReferenceError) Position() (start token.Position, end token.Position)

func (*ReferenceError) Unwrap

func (e *ReferenceError) Unwrap() error

type SyntaxError

type SyntaxError struct {
	Err      error
	Token    token.Token
	Expected []token.Kind
	Details  string
}

func (*SyntaxError) Error

func (e *SyntaxError) Error() string

func (*SyntaxError) Name

func (e *SyntaxError) Name() string

func (*SyntaxError) Position

func (e *SyntaxError) Position() (token.Position, token.Position)

func (*SyntaxError) Unwrap

func (e *SyntaxError) Unwrap() error

type Type

type Type interface {
	String() string
}

type TypeError

type TypeError struct {
	Err   error
	Node  ast.Node
	Left  Type
	Right Type
	Type  Type
	N     int
	M     int
	Value string
}

func (*TypeError) Error

func (e *TypeError) Error() string

func (*TypeError) Name

func (e *TypeError) Name() string

func (*TypeError) Position

func (e *TypeError) Position() (start token.Position, end token.Position)

func (*TypeError) Unwrap

func (e *TypeError) Unwrap() error

Jump to

Keyboard shortcuts

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