{"id":13580606,"url":"https://github.com/dalance/nom-tracable","last_synced_at":"2025-10-26T15:35:09.756Z","repository":{"id":47454650,"uuid":"199005647","full_name":"dalance/nom-tracable","owner":"dalance","description":"Extension of nom to trace parser","archived":false,"fork":false,"pushed_at":"2025-02-03T20:28:21.000Z","size":80,"stargazers_count":49,"open_issues_count":3,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-09-01T18:53:21.401Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dalance.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-07-26T11:32:35.000Z","updated_at":"2025-02-07T10:36:49.000Z","dependencies_parsed_at":"2024-01-16T20:54:59.867Z","dependency_job_id":"ff016489-2067-4a69-97bf-2a957359836f","html_url":"https://github.com/dalance/nom-tracable","commit_stats":{"total_commits":76,"total_committers":2,"mean_commits":38.0,"dds":"0.013157894736842146","last_synced_commit":"3ba5cd5c4f95e52f3b25c7e304c5634a8049150c"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/dalance/nom-tracable","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dalance%2Fnom-tracable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dalance%2Fnom-tracable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dalance%2Fnom-tracable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dalance%2Fnom-tracable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dalance","download_url":"https://codeload.github.com/dalance/nom-tracable/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dalance%2Fnom-tracable/sbom","scorecard":{"id":317539,"data":{"date":"2025-08-11","repo":{"name":"github.com/dalance/nom-tracable","commit":"8005417651fbb7a7f89245ba7e02f2e698cc2aa7"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Code-Review","score":0,"reason":"Found 1/20 approved changesets -- score normalized to 0","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":"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":"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":"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":"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/rust.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/dalance/nom-tracable/rust.yml/master?enable=pin","Info:   0 out of   1 GitHub-owned 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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/rust.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":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"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":"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":"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-APACHE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE-APACHE: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":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"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 11 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-18T00:34:43.007Z","repository_id":47454650,"created_at":"2025-08-18T00:34:43.007Z","updated_at":"2025-08-18T00:34:43.007Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274244009,"owners_count":25248156,"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","status":"online","status_checked_at":"2025-09-09T02:00:10.223Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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-01T15:01:53.527Z","updated_at":"2025-10-26T15:35:09.663Z","avatar_url":"https://github.com/dalance.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# nom-tracable\nExtension of [nom](https://github.com/Geal/nom) to trace parser.\n\n[![Actions Status](https://github.com/dalance/nom-tracable/workflows/Regression/badge.svg)](https://github.com/dalance/nom-tracable/actions)\n[![Crates.io](https://img.shields.io/crates/v/nom-tracable.svg)](https://crates.io/crates/nom-tracable)\n[![Docs.rs](https://docs.rs/nom-tracable/badge.svg)](https://docs.rs/nom-tracable)\n\n## Feature\n\n* Tracing parser by colored format\n* Forward/backward call count\n* Folding the specific parsers\n* Histogram/cumulative histogram of parser call count\n* Zero-overhead when trace is disabled\n\n![nom-tracable](https://user-images.githubusercontent.com/4331004/78225158-b8dc8480-7504-11ea-83ec-3111026313ba.png)\n\n\n## Requirement\n\nnom must be 5.0.0 or later.\nnom-tracable can be applied to function-style parser only.\n\nThe input type of nom parser must implement `Tracable` trait.\nTherefore `\u0026str` and `\u0026[u8]` can't be used.\nYou can define a wrapper type of `\u0026str` or `\u0026[u8]` and implement `Tracable`.\n\nnom-tracable is integrated with [nom_locate](https://github.com/fflorent/nom_locate).\nYou can use `nom_locate::LocatedSpan\u003cT, TracableInfo\u003e` as input type.\nThis implements `Tracable` in this crate.\n\nNote: `T` in `nom_locate::LocatedSpan\u003cT, TracableInfo\u003e` must implement `FragmentDisplay`.\n`\u0026str` and `\u0026[u8]` implement it in this crate. If you want to use another type as `T`, you should implement `FragmentDisplay` for it.\n\n## Usage\n\n```Cargo.toml\n[features]\ndefault = []\ntrace   = [\"nom-tracable/trace\"]\n\n[dependencies]\nnom-tracable = \"0.9.1\"\n```\n\nnom-tracable provides `trace` feature, and the crate using nom-tracable must provide the feature too.\nWhen `trace` is enabled, trace dump is enabled.\nIf not, there is no additional cost.\n\n## Example\n\nYou can try examples by the following command.\n\n```\n$ cargo run --manifest-path=nom-tracable/Cargo.toml --example str_parser --features trace\n$ cargo run --manifest-path=nom-tracable/Cargo.toml --example u8_parser --features trace\n```\n\n`str_parser` is below:\n\n```rust\nuse nom::branch::*;\nuse nom::character::complete::*;\nuse nom::IResult;\nuse nom_locate::LocatedSpan;\nuse nom_tracable::{cumulative_histogram, histogram, tracable_parser, TracableInfo};\n\n// Input type must implement trait Tracable\n// nom_locate::LocatedSpan\u003cT, TracableInfo\u003e implements it.\ntype Span\u003c'a\u003e = LocatedSpan\u003c\u0026'a str, TracableInfo\u003e;\n\n// Apply tracable_parser by custom attribute\n#[tracable_parser]\npub fn expr(s: Span) -\u003e IResult\u003cSpan, String\u003e {\n    alt((expr_plus, expr_minus, term))(s)\n}\n\n#[tracable_parser]\npub fn expr_plus(s: Span) -\u003e IResult\u003cSpan, String\u003e {\n    let (s, x) = term(s)?;\n    let (s, y) = char('+')(s)?;\n    let (s, z) = expr(s)?;\n    let ret = format!(\"{}{}{}\", x, y, z);\n    Ok((s, ret))\n}\n\n#[tracable_parser]\npub fn expr_minus(s: Span) -\u003e IResult\u003cSpan, String\u003e {\n    let (s, x) = term(s)?;\n    let (s, y) = char('-')(s)?;\n    let (s, z) = expr(s)?;\n    let ret = format!(\"{}{}{}\", x, y, z);\n    Ok((s, ret))\n}\n\n#[tracable_parser]\npub fn term(s: Span) -\u003e IResult\u003cSpan, String\u003e {\n    let (s, x) = term_internal(s)?;\n    Ok((s, x))\n}\n\n#[tracable_parser]\npub fn term_internal(s: Span) -\u003e IResult\u003cSpan, String\u003e {\n    let (s, x) = char('1')(s)?;\n    Ok((s, x.to_string()))\n}\n\nfn main() {\n    // Configure trace setting\n    let info = TracableInfo::new().parser_width(64).fold(\"term\");\n    let ret = expr(LocatedSpan::new_extra(\"1-1+1+1-1\", info));\n\n    // Show histogram\n    histogram();\n    cumulative_histogram();\n}\n```\n\n## License\n\nLicensed under either of\n\n * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)\n * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)\n\nat your option.\n\n### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally\nsubmitted for inclusion in the work by you, as defined in the Apache-2.0\nlicense, shall be dual licensed as above, without any additional terms or\nconditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdalance%2Fnom-tracable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdalance%2Fnom-tracable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdalance%2Fnom-tracable/lists"}