errors

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2018 License: MIT Imports: 2 Imported by: 6

Documentation

Index

Constants

View Source
const (

	// EndOfFileError represents normal EOF error
	EndOfFileError
	// UnexpectedTokenError means that token is not what we expected
	UnexpectedTokenError
	// UnexpectedEndError means we get unexpected "end" keyword (this is mainly created for REPL)
	UnexpectedEndError
	// MethodDefinitionError means there's an error on method definition's method name
	MethodDefinitionError
	// InvalidAssignmentError means user assigns value to wrong type of expressions
	InvalidAssignmentError
	// SyntaxError means there's a grammatical in the source code
	SyntaxError
	// ArgumentError means there's a method parameter's definition error
	ArgumentError
)

Enums for different kinds of syntax errors

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	// Message contains the readable message of error
	Message string
	ErrType int
}

Error represents parser's parsing error

func InitError

func InitError(msg string, errType int) *Error

InitError is a helper function for easily initializing error object

func NewArgumentError

func NewArgumentError(formerArgType, laterArgType int, argLiteral string, line int) *Error

NewArgumentError is a helper function the helps initializing argument errors

func NewTypeParsingError

func NewTypeParsingError(tokenLiteral, targetType string, line int) *Error

NewTypeParsingError is a helper function the helps initializing type parsing errors

func (*Error) IsEOF

func (e *Error) IsEOF() bool

IsEOF checks if error is end of file error

func (*Error) IsUnexpectedEnd

func (e *Error) IsUnexpectedEnd() bool

IsUnexpectedEnd checks if error is unexpected "end" keyword error

Jump to

Keyboard shortcuts

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