Skip to content

Latest commit

History

74 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

KDLGo

GoDoc

WIP Go parser for the KDL Document Language, version 1.0.0.

Current status

  • parsing to a kdl.Document model
  • serializing a kdl.Document model to a string
  • marshalling from a struct
  • unmarshalling to a struct
  • improve performance?

Usage

import (
kdl "github.com/frixuu/kdlgo"
)

Parse (to a Document model)

// or any of: ParseBytes, ParseFile, ParseReaderdocument, err:=kdl.ParseString(`foo bar="baz"`)

Modify the Document

ifdocument.Nodes[0].HasProp("bar") {
n:=kdl.NewNode("person")
n.AddArg("known")
// or: n.AddArgValue(kdl.NewStringValue("known", kdl.NoHint()))n.SetProp("name", "Joe")
// or: n.SetPropValue("name", kdl.NewStringValue("Joe", kdl.NoHint()))document.AddChild(n)
}

Serialize the Document

// or Write() to an io.Writers, err:=document.WriteString()

About

KDL parser in Go.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages