reader

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2018 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package reader defines interfaces for an input reader and reader position

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error interface {
	error
	Cause() error
	Msg() string
	Pos() Position
}

Error is an interface for handling errors with a position

func NewError

func NewError(pos Position, format string, values ...interface{}) Error

NewError creates a new reader error instance

func WrapError

func WrapError(pos Position, cause error, format string, values ...interface{}) Error

WrapError wraps the given error in a parser error If the cause is already a parser error then WrapError returns the same error with an updated error message If format contains the "{{err}}" placeholder it will be replaced with the cause's error message

type Position

type Position interface {
	Filename() string
	Pos() int
	fmt.Stringer
}

Position is a given position in the reader

type Reader

type Reader interface {
	Clone() Reader
	Remaining() int
	Cursor() Position
	IsEOF() bool
	fmt.Stringer
}

Reader is a reader interface for parsing

Directories

Path Synopsis
Code generated by mockery v1.0.0 Code generated by mockery v1.0.0 Code generated by mockery v1.0.0
Code generated by mockery v1.0.0 Code generated by mockery v1.0.0 Code generated by mockery v1.0.0

Jump to

Keyboard shortcuts

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