{"id":16485463,"url":"https://github.com/zaid-ajaj/fable.parsimmon","last_synced_at":"2025-03-21T07:31:05.165Z","repository":{"id":23580970,"uuid":"99387320","full_name":"Zaid-Ajaj/Fable.Parsimmon","owner":"Zaid-Ajaj","description":"Fable binding for the Parsimmon parser combinator library","archived":false,"fork":false,"pushed_at":"2022-12-09T14:37:44.000Z","size":616,"stargazers_count":21,"open_issues_count":8,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-03-28T02:31:19.222Z","etag":null,"topics":["fable","fsharp","parser","parsimmon"],"latest_commit_sha":null,"homepage":"","language":"F#","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/Zaid-Ajaj.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}},"created_at":"2017-08-04T23:47:12.000Z","updated_at":"2024-03-27T04:22:24.000Z","dependencies_parsed_at":"2023-01-14T01:00:59.863Z","dependency_job_id":null,"html_url":"https://github.com/Zaid-Ajaj/Fable.Parsimmon","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/Zaid-Ajaj%2FFable.Parsimmon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zaid-Ajaj%2FFable.Parsimmon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zaid-Ajaj%2FFable.Parsimmon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zaid-Ajaj%2FFable.Parsimmon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Zaid-Ajaj","download_url":"https://codeload.github.com/Zaid-Ajaj/Fable.Parsimmon/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244119694,"owners_count":20401032,"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":["fable","fsharp","parser","parsimmon"],"created_at":"2024-10-11T13:25:59.089Z","updated_at":"2025-03-21T07:31:04.846Z","avatar_url":"https://github.com/Zaid-Ajaj.png","language":"F#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fable.Parsimmon [![Build Status](https://travis-ci.org/Zaid-Ajaj/Fable.Parsimmon.svg?branch=master)](https://travis-ci.org/Zaid-Ajaj/Fable.Parsimmon)\n\n[Fable](http://fable.io/) binding and helpers for the [Parsimmon](https://github.com/jneen/parsimmon) parser combinator library.\n\n### Nuget Packages\n\n| Fable version | Package |\n| ------------- | ------------- |\n| 2.0  | [![Nuget](https://img.shields.io/nuget/v/Fable.Parsimmon.svg?maxAge=0\u0026colorB=brightgreen)](https://www.nuget.org/packages/Fable.Parsimmon)   |\n\n\n# Installation\nYou can install the library from Nuget using Paket:\n```\npaket add nuget Fable.Parsimmon --project path/to/YourProject.fsproj \n```\nIt includes the javascript dependency [(this file)](https://github.com/Zaid-Ajaj/Fable.Parsimmon/blob/master/Fable.Parsimmon/Parsimmon.js) in the Nuget package so there no need to install anything else using `npm`\n\nMake sure the references are added to your paket files\n```\n// paket.dependencies (solution-wide dependencies)\nnuget Fable.Parsimmon\n\n// paket.refernces (project-specific dependencies)\nFable.Parsimmon\n```\n\n\nTo understand how to use it, refer to the project `Fable.Parsimmon.Tests` where most of the combinators are tested, for example:\n```fs\nopen Fable.Parsimmon \n\nQUnit.test \"Parsing list of numbers works\" \u003c| fun test -\u003e\n    let comma = Parsimmon.str \",\"\n\n    let commaSeperatedNumbers = \n        Parsimmon.digit\n        |\u003e Parsimmon.many\n        |\u003e Parsimmon.concat\n        |\u003e Parsimmon.map int\n        |\u003e Parsimmon.seperateBy comma\n\n    let leftBracket = Parsimmon.str \"[\"\n    let rightBracket = Parsimmon.str \"]\"\n\n    commaSeperatedNumbers\n    |\u003e Parsimmon.between leftBracket rightBracket\n    |\u003e Parsimmon.parse \"[5,10,15,20,25]\"\n    |\u003e function\n        | Some [| 5; 10; 15; 20; 25 |] -\u003e test.pass()\n        | otherwise -\u003e test.fail()\n``` \nRecursive parsers as values such as [this one](https://github.com/jneen/parsimmon/blob/master/API.md#parsimmonlazyfn) are also supported:\n```fs\nQUnit.test \"Parsimmon.ofLazy works\" \u003c| fun test -\u003e \n    \n    let rec lazyValue = Parsimmon.ofLazy \u003c| fun () -\u003e \n        [ Parsimmon.str \"X\" \n          Parsimmon.str \"(\"\n             |\u003e Parsimmon.chain lazyValue\n             |\u003e Parsimmon.skip (Parsimmon.str \")\") ]\n        |\u003e Parsimmon.choose\n    \n\n    [\"X\"; \"(X)\"; \"((X))\"] \n    |\u003e List.map (fun token -\u003e Parsimmon.parse token lazyValue)\n    |\u003e function \n        | [ Some \"X\"; Some \"X\"; Some \"X\" ] -\u003e test.pass()\n        | otherwise -\u003e test.fail()\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzaid-ajaj%2Ffable.parsimmon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzaid-ajaj%2Ffable.parsimmon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzaid-ajaj%2Ffable.parsimmon/lists"}