parse

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package parse provides Ale language parsing functionality

Index

Constants

View Source
const (
	ErrExpectedPathString = "expected include path as string, got: %s"
	ErrExpectedFileSystem = "expected file system, got: %s"
)
View Source
const (
	// ErrPrefixedNotPaired is raised when the parser encounters the end of the
	// stream without being able to complete a paired element, such as a quote
	ErrPrefixedNotPaired = "end of file reached before completing %s"

	// ErrUnexpectedDot is raised when the parser encounters a dot in the
	// stream when it isn't part of an open list
	ErrUnexpectedDot = "encountered '" + lang.Dot + "' with no open list"

	// ErrInvalidListSyntax is raised when the parse encounters a misplaced dot
	// when parsing an open list
	ErrInvalidListSyntax = "invalid list syntax"

	// ErrListNotClosed is raised when the parser encounters the end of the
	// stream while an open list is still being parsed
	ErrListNotClosed = "end of file reached with open list"

	// ErrUnmatchedListEnd is raised when a list-end character is encountered
	// in the stream when no open list is being parsed
	ErrUnmatchedListEnd = "encountered '" + lang.ListEnd +
		"' with no open list"

	// ErrVectorNotClosed is raised when the parser encounters the end of the
	// stream while an open vector is still being parsed
	ErrVectorNotClosed = "end of file reached with open vector"

	// ErrUnmatchedVectorEnd is raised when a vector-end character is
	// encountered in the stream when no open vector is being parsed
	ErrUnmatchedVectorEnd = "encountered '" + lang.VectorEnd +
		"' with no open vector"

	// ErrObjectNotClosed is raised when the parser encounters the end of the
	// stream while an open object is still being parsed
	ErrObjectNotClosed = "end of file reached with open object"

	// ErrUnmatchedObjectEnd is raised when an object-end character is
	// encountered in the stream when no open object is being parsed
	ErrUnmatchedObjectEnd = "encountered '" + lang.ObjectEnd +
		"' with no open object"
)

Variables

This section is empty.

Functions

func FromString

func FromString(
	ns env.Namespace, tokenize Tokenizer, str data.String,
) (data.Sequence, error)

FromString returns a Lazy Sequence of scanned data structures

Types

type Tokenizer

type Tokenizer func(data.String) (data.Sequence, error)

Jump to

Keyboard shortcuts

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