{"id":17478596,"url":"https://github.com/nixpulvis/parser-combinator","last_synced_at":"2025-07-12T08:03:03.555Z","repository":{"id":22795654,"uuid":"26141998","full_name":"nixpulvis/parser-combinator","owner":"nixpulvis","description":"CFG Parser Combinators for Racket","archived":false,"fork":false,"pushed_at":"2019-05-05T01:07:10.000Z","size":176,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-02T04:47:56.387Z","etag":null,"topics":["json","library","parser"],"latest_commit_sha":null,"homepage":"https://nixpulvis.com/projects/parser-combinator","language":"Racket","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nixpulvis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-11-03T22:31:56.000Z","updated_at":"2021-12-11T21:09:48.000Z","dependencies_parsed_at":"2022-08-22T15:10:26.665Z","dependency_job_id":null,"html_url":"https://github.com/nixpulvis/parser-combinator","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/nixpulvis/parser-combinator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nixpulvis%2Fparser-combinator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nixpulvis%2Fparser-combinator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nixpulvis%2Fparser-combinator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nixpulvis%2Fparser-combinator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nixpulvis","download_url":"https://codeload.github.com/nixpulvis/parser-combinator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nixpulvis%2Fparser-combinator/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264958575,"owners_count":23689030,"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":["json","library","parser"],"created_at":"2024-10-18T20:29:30.182Z","updated_at":"2025-07-12T08:03:03.514Z","avatar_url":"https://github.com/nixpulvis.png","language":"Racket","funding_links":[],"categories":[],"sub_categories":[],"readme":"# parser-combinator\n\nSimple Racket parser library, and default (tested) JSON implementation.\n\n## Install\n\n```sh\nraco pkg install parser-combinator\n```\n\n## JSON Usage\n\n```racket\n#lang racket\n(require parser-combinator/json)\n\n(string-\u003ejson \"[]\")\n;=\u003e '()\n(string-\u003ejson \"[1, {\\\"foo\\\": false}, 2]\")\n;=\u003e (list 1 (list (json-pair \"foo\" #f)) 2)\n```\n\n## Parser Usage\n\n```racket\n#lang racket\n(require parser-combinator/parse)\n\n(define-parser DIGIT+ (alt* (lit \"0\")\n                            (lit \"1\")\n                            (lit \"2\")\n                            (lit \"3\")\n                            (lit \"4\")\n                            (lit \"5\")\n                            (lit \"6\")\n                            (lit \"7\")\n                            (lit \"8\")\n                            (lit \"9\")))\n\n(define-parser DIGIT (alt* (lit \"0\") DIGIT+))\n\n(define-parser NUMBER (seq* 'number\n                           (opt (lit \"-\"))\n                           (alt* (lit \"0\") (seq* 'significand\n                                                 DIGIT+\n                                                 (star DIGIT)))))\n\n; (seq-node 'number AST AST) -\u003e Number\n(define (parse-number ast)\n  (string-\u003enumber (string-append \"#e\" (flatten-ast ast))))\n\n; String -\u003e Number\n(define (parse str)\n  (parse-number (parse NUMBER str)))\n\n(println (parse \"0\"))\n(println (parse \"-0\"))\n(println (parse \"1\"))\n(println (parse \"140\"))\n```\n\n## Tests\n\nRun all of the tests.\n\n```sh\nraco test *tests.rkt\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnixpulvis%2Fparser-combinator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnixpulvis%2Fparser-combinator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnixpulvis%2Fparser-combinator/lists"}