Help us shape the future of Go! Take the 2026 Go Developer Survey

parsego

module
v0.0.0-...-6121b42 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2020 License: MIT

README

Build Status GoDoc Go Report Card MIT licensed

parsego

Note: This is somewhat buggy, and is not maintained. Use at your own risk :)

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.

Directories

Path Synopsis
Package parser defines methods for building an running parser combinators.
Package parser defines methods for building an running parser combinators.
textpos
Package textpos contains immutable structures for working with positions in a text document.
Package textpos contains immutable structures for working with positions in a text document.

Jump to

Keyboard shortcuts

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