perror

package
v0.0.0-...-8c81fcd Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertEqual

func AssertEqual(t *testing.T, exp Perror, act Perror) bool

AssertEqual asserts the Perrors are equal except for the error messages. The error messages are simple checked to ensure they are not empty.

func PrintError

func PrintError(file string, perr Perror)

PrintError prints a Perror.

Types

type Perror

type Perror interface {

	// Line returns the offending line index within the scroill.
	Line() int

	// Cols returns the offending column indices within the scroll.
	Cols() []int

	// Errors returns an array of error messages.
	Errors() []string
}

Perror represents an error found while parsing.

func New

func New(l int, c []int, e []string) Perror

New returns a new initialised Perror.

func NewByError

func NewByError(l, c int, e error) Perror

NewByError creates a new Perror from an error.

Jump to

Keyboard shortcuts

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