Skip to content

Latest commit

 

History

History
32 lines (25 loc) · 1.04 KB

README.md

File metadata and controls

32 lines (25 loc) · 1.04 KB

Build Status GoDoc Go Report Card MIT licensed

parsego

A simple, easy to use parser-combinator written in Golang.

Example usage:

package main

import "fmt"
import "github.com/jmikkola/parsego/parser"

func main() {
    p := parser.Sequence(
        parser.Digits(),
        parser.Maybe(
            parser.Sequence(
                parser.Char('.'),
                parser.Digits())))
    result, err := parser.ParseString(p, "1234.567")
    if err != nil {
        fmt.Println("failed to parse", err)
    } else {
        fmt.Println("parsed", result)
    }
}

See examples/ for more examples.