pazu

package
v0.0.0-...-8f07418 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(tokens []string) (interface{}, error)

Parse takes an s-expression of string tokens and returns an abstract syntax tree. It returns a single item which may be an Atom (int, string, symbol) or a List.

func Tokenize

func Tokenize(sexp string) (tokens []string, err error)

Types

type Atom

type Atom struct {
	Value interface{}
}

type List

type List struct {
	Elements []interface{} // Elements may be Atoms or Lists
}

type Symbol

type Symbol string

type SyntaxError

type SyntaxError struct {
	Msg    string
	Line   int
	Column int
}

func (*SyntaxError) Error

func (e *SyntaxError) Error() string

Jump to

Keyboard shortcuts

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