Skip to content

losinggeneration/pego

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pego

This is a pattern matching library for Go. It is based on lpeg, which uses a flavor of PEG.

This is the official continuation of the project of the same name started by Markus Jarderot. He wrote the implementation and I've updated the project to work with newer Go versions.

The original project page is located here: https://code.google.com/p/pego/

Example

pat := Grm("S", map[string]*Pattern{
	"S": Ref("A").Clist(),
	"A": Seq(
		NegSet("()").Rep(0, -1),
		Seq(
			Ref("B"),
			NegSet("()").Rep(0, -1),
		).Rep(0, -1)).Csimple(),
	"B": Seq(
		"(", Ref("A"), ")"),
})

More information

About

PEG library in Go based on LPeg

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published