Skip to content

Latest commit

 

History

History
35 lines (22 loc) · 699 Bytes

File metadata and controls

35 lines (22 loc) · 699 Bytes

Cirru Parser

Cirru Parser implemented in Go. Visit http://cirru.org for more.

You may also find one writtern in CoffeeScript.

Usage

GoDoc

You may find a complete demo at parser_test.go. Here is an overview.

// import "github.com/Cirru/parser"

b, _ := ioutil.ReadFile("demo.cirru")

p := parser.NewParser()
p.Filename("_") // to specify filename
for _, c := range b {
  p.Read(rune(c))
}
p.Complete()

content, _ := json.MarshalIndent(p.ToTree(), "", "  ")
string(content) // in JSON

License

MIT