edn

package module
v0.0.0-...-aa12bdc Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2015 License: MPL-2.0 Imports: 6 Imported by: 0

README

EDN

An EDN parser for Go.

Building

Note: Development on this library is done against Go 1.1. In particular, Go 1.0's YACC differs from Go 1.1's YACC with regards to how fmt is imported.

The lexer is generated with nex and the parser is generated with Go's YACC tool.

In order to be compatible with go get[1], which does not support a precompilation step[2] the generated files are committed alongside the source files.

The lexer and parser are re-created every time the project is made, which you can simply do with:

make

This will also run the tests.

License

MPL 2.0

Documentation

Overview

An EDN (http://edn-format.org) parser for Go.

The main entry points for this library are ParseString(string) and ParseReader(io.Reader), which both return a representation of the data according to this library's Value interface.

edn.ParseString(`(:a [123 #{5 7 3}] {"string" 123})`)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DumpString

func DumpString(value types.Value) string

DumpString accepts any EDN value and will return the EDN string representation.

func ParseReader

func ParseReader(reader io.Reader) (val types.Value, err error)

ParseReader parses EDN from an io.Reader.

Data is returned as a Value in the first return value. The second return value is nil on successful parses, and an error on unsuccessful parses (e.g. syntax error).

func ParseString

func ParseString(string string) (val types.Value, err error)

ParseString is like ParseReader except it takes a string. See ParseReader for more details.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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