{"id":13511677,"url":"https://github.com/pointlander/peg","last_synced_at":"2026-04-08T19:31:27.146Z","repository":{"id":882847,"uuid":"628618","full_name":"pointlander/peg","owner":"pointlander","description":"Peg, Parsing Expression Grammar, is an implementation of a Packrat parser generator.","archived":false,"fork":false,"pushed_at":"2025-11-10T14:04:55.000Z","size":763,"stargazers_count":1093,"open_issues_count":36,"forks_count":127,"subscribers_count":26,"default_branch":"main","last_synced_at":"2026-01-02T12:46:14.625Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pointlander.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2010-04-25T21:20:46.000Z","updated_at":"2025-12-31T22:58:47.000Z","dependencies_parsed_at":"2024-04-30T15:32:36.589Z","dependency_job_id":"777cf0a0-28a8-4abb-8b01-752682c42b34","html_url":"https://github.com/pointlander/peg","commit_stats":{"total_commits":187,"total_committers":42,"mean_commits":"4.4523809523809526","dds":0.8235294117647058,"last_synced_commit":"047adc6e3cbbd46edaadb58ff9abc399c429ddc0"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/pointlander/peg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pointlander%2Fpeg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pointlander%2Fpeg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pointlander%2Fpeg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pointlander%2Fpeg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pointlander","download_url":"https://codeload.github.com/pointlander/peg/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pointlander%2Fpeg/sbom","scorecard":{"id":739811,"data":{"date":"2025-08-11","repo":{"name":"github.com/pointlander/peg","commit":"e7926250bae5d755fb9ac4fc1a4dcaee8ca9ea8b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.9,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":8,"reason":"10 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 8","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/build.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":8,"reason":"Found 24/30 approved changesets -- score normalized to 8","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/pointlander/peg/build.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/pointlander/peg/build.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/pointlander/peg/build.yml/main?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: BSD 3-Clause \"New\" or \"Revised\" License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 27 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-22T17:07:10.297Z","repository_id":882847,"created_at":"2025-08-22T17:07:10.297Z","updated_at":"2025-08-22T17:07:10.297Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31571599,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-08-01T03:01:05.235Z","updated_at":"2026-04-08T19:31:27.137Z","avatar_url":"https://github.com/pointlander.png","language":"Go","readme":"# PEG, an Implementation of a Packrat Parsing Expression Grammar in Go\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/pointlander/peg.svg)](https://pkg.go.dev/github.com/pointlander/peg)\n[![Go Report Card](https://goreportcard.com/badge/github.com/pointlander/peg)](https://goreportcard.com/report/github.com/pointlander/peg)\n\nA [Parsing Expression Grammar](https://en.wikipedia.org/wiki/Parsing_expression_grammar) ( hence `peg`) is a way to create grammars similar in principle to [regular expressions](https://en.wikipedia.org/wiki/Regular_expression) but which allow better code integration. Specifically, `peg` is an implementation of the [Packrat](https://en.wikipedia.org/wiki/Parsing_expression_grammar#Implementing_parsers_from_parsing_expression_grammars) parser generator originally implemented as [peg/leg](https://www.piumarta.com/software/peg/) by [Ian Piumarta](https://www.piumarta.com/cv/) in C. A Packrat parser is a \"descent recursive parser\" capable of backtracking and negative look-ahead assertions which are problematic for regular expression engines.\n\n## Installation\n\n```\ngo install github.com/pointlander/peg@latest\n```\n\n\n## Usage\n\n### Build executable\n\n```\ngo generate \u0026\u0026 go build\n```\n\n### Help\n\n```\n./peg -h\n```\n\n\n### Example\n\nThis creates the file `peg.peg.go`:\n```\n./peg -inline -switch peg.peg\n```\n\n\n## PEG file syntax\n\nSee [peg-file-syntax.md](docs/peg-file-syntax.md)\n\n\n## Development\n\n### Requirements\n\n* [Golang](https://golang.org/doc/install), see [go.mod](go.mod) for version\n* [golangci-lint latest version](https://github.com/golangci/golangci-lint#install) (v2 or later)\n* [Bash 3.2.x or higher](https://www.gnu.org/software/bash)\n\n\n### Generate\n\nBootstrap and generate grammar *.peg.go. This commands should initially be executed once before other commands. \n```\ngo generate\n```\n\n\n### Build\n\n```\ngo build\n```\n\n([`go generate`](#generate) required once beforehand)\n\n\n#### Set version\n\nUse the version from the tag if the current commit has a tag. If not use the current commit hash.\n```\ngo build -ldflags \"-X main.Version=$(git describe --tags --exact-match 2\u003e/dev/null || git rev-parse --short HEAD)\"\n```\n\nAdditionally, since [Go 1.18](https://go.dev/doc/go1.18) the go command embeds version control information. Read the information:\n```\ngo version -m peg\n```\n\n\n### Test\n\n```\ngo test -short ./...\n```\n\n([`go generate`](#generate) required once beforehand)\n\n\n### Lint\n\n```\ngolangci-lint run\n```\n\n([`go generate`](#generate) required once beforehand)\n\n\n### Format\n\n```\ngolangci-lint fmt\n```\n\n\n### Benchmark\n```\ngo test -benchmem -bench .\n```\n\n([`go generate`](#generate) required once beforehand)\n\n\n## Author\n\nAndrew Snodgrass\n","funding_links":[],"categories":["Software Packages","Go","Golang","软件包","Go Tools","Other Software","軟件包","Go 工具"],"sub_categories":["Other Software","其他软件库和软件包","其他软件","其他軟件"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpointlander%2Fpeg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpointlander%2Fpeg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpointlander%2Fpeg/lists"}