common

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2022 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JContext

type JContext struct {
	Name           string
	Parent         *JContext
	ParentEntryPos *JPosition
	SymbolTable    *JSymbolTable
}

func NewJContext

func NewJContext(name string, symbolTable *JSymbolTable, parent *JContext, parentEntryPos *JPosition) *JContext

type JError

type JError struct {
	StartPos *JPosition
	EndPos   *JPosition
}

func (*JError) ErrorString

func (e *JError) ErrorString(name, details string) string

type JExpectedCharacterError

type JExpectedCharacterError struct {
	*JError
	ExpectedChar byte
}

func (*JExpectedCharacterError) Error

func (e *JExpectedCharacterError) Error() string

type JIllegalCharacterError

type JIllegalCharacterError struct {
	*JError
	IllegalChar byte
}

func (*JIllegalCharacterError) Error

func (e *JIllegalCharacterError) Error() string

type JInvalidSyntaxError

type JInvalidSyntaxError struct {
	*JError
	Details string
}

func (*JInvalidSyntaxError) Error

func (e *JInvalidSyntaxError) Error() string

type JNumberTypeError

type JNumberTypeError struct {
	*JError
	Number interface{}
}

func (*JNumberTypeError) Error

func (e *JNumberTypeError) Error() string

type JPosition

type JPosition struct {
	Index    int
	Col      int
	Ln       int64
	Filename string
	Text     string
}

func NewJPosition

func NewJPosition(index, col int, ln int64, filename, text string) *JPosition

func (*JPosition) Advance

func (p *JPosition) Advance(text []byte) *JPosition

func (*JPosition) Back

func (p *JPosition) Back(text []byte) *JPosition

func (*JPosition) Copy

func (p *JPosition) Copy() *JPosition

type JRunTimeError

type JRunTimeError struct {
	*JError
	Context *JContext
	Details string
}

func (*JRunTimeError) Error

func (e *JRunTimeError) Error() string

type JSymbolTable

type JSymbolTable struct {
	Symbols *safemap.SafeMap[any]
	Parent  *JSymbolTable
}

func NewJSymbolTable

func NewJSymbolTable(parent *JSymbolTable) *JSymbolTable

func (*JSymbolTable) Get

func (st *JSymbolTable) Get(name any) any

func (*JSymbolTable) Remove

func (st *JSymbolTable) Remove(name any) *JSymbolTable

func (*JSymbolTable) Set

func (st *JSymbolTable) Set(name, value any) *JSymbolTable

Jump to

Keyboard shortcuts

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