loader

package
v0.0.96 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2026 License: BSD-3-Clause Imports: 8 Imported by: 1

Documentation

Overview

loader.go

loader_no_peg.go

Index

Constants

View Source
const (
	NPEG_TOKEN_NONE = iota
	NPEG_TOKEN_WORD
	NPEG_TOKEN_SETWORD
	NPEG_TOKEN_LSETWORD
	NPEG_TOKEN_MODWORD
	NPEG_TOKEN_LMODWORD
	NPEG_TOKEN_GETWORD
	NPEG_TOKEN_OPWORD
	NPEG_TOKEN_PIPEWORD
	NPEG_TOKEN_ONECHARPIPE
	NPEG_TOKEN_TAGWORD
	NPEG_TOKEN_KINDWORD
	NPEG_TOKEN_XWORD
	NPEG_TOKEN_EXWORD
	NPEG_TOKEN_GENWORD
	NPEG_TOKEN_NUMBER
	NPEG_TOKEN_DECIMAL
	NPEG_TOKEN_STRING
	NPEG_TOKEN_URI
	NPEG_TOKEN_EMAIL
	NPEG_TOKEN_FPATH
	NPEG_TOKEN_CPATH
	NPEG_TOKEN_OPCPATH
	NPEG_TOKEN_PIPECPATH
	NPEG_TOKEN_GETCPATH
	NPEG_TOKEN_BLOCK_START
	NPEG_TOKEN_BLOCK_END
	NPEG_TOKEN_BBLOCK_START
	NPEG_TOKEN_BBLOCK_END
	NPEG_TOKEN_OPBBLOCK_START
	NPEG_TOKEN_GROUP_START
	NPEG_TOKEN_GROUP_END
	NPEG_TOKEN_OPGROUP_START
	NPEG_TOKEN_OPBLOCK_START
	NPEG_TOKEN_COMMA
	NPEG_TOKEN_VOID
	NPEG_TOKEN_COMMENT
	NPEG_TOKEN_SPACE
	NPEG_TOKEN_LOCATION_NODE
	NPEG_TOKEN_FLAGWORD
	NPEG_TOKEN_EOF
	NPEG_TOKEN_ERROR
)

Token types for the non-PEG parser

View Source
const (
	ERR_NONE = iota
	ERR_UNKNOWN
	ERR_SPACING_OP
	ERR_SPACING_BLK
	ERR_SPACING_OTHR
)

Variables

This section is empty.

Functions

func GetIdxs

func GetIdxs() *env.Idxs

func InitIndex

func InitIndex()

func LoadStringNEW added in v0.0.15

func LoadStringNEW(input string, sig bool, ps *env.ProgramState) env.Object

LoadStringNEW loads a string using the non-PEG parser with a program state

func LoadStringNEWNoPEG added in v0.0.82

func LoadStringNEWNoPEG(input string, sig bool, ps *env.ProgramState) env.Object

LoadStringNEWNoPEG loads a string using the non-PEG parser with a program state This version injects LocationNodes during parsing for better error reporting

func LoadStringNoPEG added in v0.0.82

func LoadStringNoPEG(input string, sig bool) (env.Object, *env.Idxs)

LoadStringNoPEG loads a string using the non-PEG parser

Types

type Lexer added in v0.0.82

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

Lexer tokenizes input string character by character

func NewLexer added in v0.0.82

func NewLexer(input string) *Lexer

NewLexer creates a new lexer

func NewLexerWithLocationNodes added in v0.0.86

func NewLexerWithLocationNodes(input string, scriptPath string) *Lexer

NewLexerWithLocationNodes creates a new lexer that injects LocationNodes at newlines

func (*Lexer) NextToken added in v0.0.82

func (l *Lexer) NextToken() NoPEGToken

NextToken returns the next token from the input

type NoPEGParser added in v0.0.82

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

NoPEGParser parses tokens into Rye values

func NewParserNoPEG added in v0.0.82

func NewParserNoPEG(input string, wordIndex *env.Idxs) *NoPEGParser

NewParserNoPEG creates a new parser

func NewParserNoPEGWithLocationNodes added in v0.0.86

func NewParserNoPEGWithLocationNodes(input string, wordIndex *env.Idxs, scriptPath string) *NoPEGParser

NewParserNoPEGWithLocationNodes creates a new parser that injects LocationNodes

func (*NoPEGParser) Parse added in v0.0.82

func (p *NoPEGParser) Parse() (env.Object, error)

Parse parses the input and returns a Rye block

type NoPEGToken added in v0.0.82

type NoPEGToken struct {
	Type  int
	Value string
	Line  int
	Col   int
	Err   int
}

NoPEGToken represents a lexical token

Jump to

Keyboard shortcuts

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