file

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	Location Location
	Message  string
}

Error type which references a location within source and a message.

func (*Error) Format

func (e *Error) Format(source *Source) string

type Errors

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

func NewErrors

func NewErrors(source *Source) *Errors

func (*Errors) Error

func (e *Errors) Error() string

func (*Errors) First

func (e *Errors) First() string

func (*Errors) GetErrors

func (e *Errors) GetErrors() []Error

func (*Errors) HasError

func (e *Errors) HasError() bool

func (*Errors) ReportError

func (e *Errors) ReportError(l Location, format string, args ...interface{})

type Location

type Location struct {
	Line   int // The 1-based line of the location.
	Column int // The 0-based column number of the location.
}

func (Location) Empty

func (l Location) Empty() bool

type Source

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

func NewSource

func NewSource(contents string) *Source

func (*Source) Content

func (s *Source) Content() string

func (*Source) MarshalJSON

func (s *Source) MarshalJSON() ([]byte, error)

func (*Source) Snippet

func (s *Source) Snippet(line int) (string, bool)

func (*Source) UnmarshalJSON

func (s *Source) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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