{"id":20602613,"url":"https://github.com/losinggeneration/pego","last_synced_at":"2025-04-15T01:54:21.542Z","repository":{"id":9079369,"uuid":"10852957","full_name":"losinggeneration/pego","owner":"losinggeneration","description":"PEG library in Go based on LPeg","archived":false,"fork":false,"pushed_at":"2017-03-23T23:45:14.000Z","size":47,"stargazers_count":20,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-15T01:54:15.079Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/losinggeneration.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-06-21T21:27:33.000Z","updated_at":"2023-07-25T13:48:38.000Z","dependencies_parsed_at":"2022-09-10T09:01:44.237Z","dependency_job_id":null,"html_url":"https://github.com/losinggeneration/pego","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/losinggeneration%2Fpego","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/losinggeneration%2Fpego/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/losinggeneration%2Fpego/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/losinggeneration%2Fpego/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/losinggeneration","download_url":"https://codeload.github.com/losinggeneration/pego/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248991540,"owners_count":21194894,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-16T09:14:16.075Z","updated_at":"2025-04-15T01:54:21.514Z","avatar_url":"https://github.com/losinggeneration.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"pego\n====\n\nThis is a pattern matching library for Go. It is based on lpeg, which uses a flavor of PEG.\n\nThis is the official continuation of the project of the same name started by Markus Jarderot.\nHe wrote the implementation and I've updated the project to work with newer Go versions.\n\nThe original project page is located here: https://code.google.com/p/pego/\n\n## Example\n```go\npat := Grm(\"S\", map[string]*Pattern{\n\t\"S\": Ref(\"A\").Clist(),\n\t\"A\": Seq(\n\t\tNegSet(\"()\").Rep(0, -1),\n\t\tSeq(\n\t\t\tRef(\"B\"),\n\t\t\tNegSet(\"()\").Rep(0, -1),\n\t\t).Rep(0, -1)).Csimple(),\n\t\"B\": Seq(\n\t\t\"(\", Ref(\"A\"), \")\"),\n})\n```\n\n## More information\n* [LPeg - Parsing Expression Grammars For Lua](http://www.inf.puc-rio.br/~roberto/lpeg/lpeg.html) - Source of inspiration\n* [A Text Pattern-Matching Tool based on Parsing Expression Grammars](http://www.inf.puc-rio.br/~roberto/docs/peg.pdf) - Paper on the implementation of LPeg.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flosinggeneration%2Fpego","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flosinggeneration%2Fpego","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flosinggeneration%2Fpego/lists"}