{"id":28206238,"url":"https://github.com/slimenull/interpolatedparser","last_synced_at":"2025-06-11T14:30:56.971Z","repository":{"id":283131000,"uuid":"950777061","full_name":"SlimeNull/InterpolatedParser","owner":"SlimeNull","description":"InterpolatedParser","archived":false,"fork":false,"pushed_at":"2025-03-19T08:04:37.000Z","size":24,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-17T10:09:22.046Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SlimeNull.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2025-03-18T17:09:14.000Z","updated_at":"2025-03-19T08:04:41.000Z","dependencies_parsed_at":"2025-03-18T18:42:13.923Z","dependency_job_id":"ab767ef8-9375-43df-a555-2e711ea36bf3","html_url":"https://github.com/SlimeNull/InterpolatedParser","commit_stats":null,"previous_names":["slimenull/interpolatedparser"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SlimeNull%2FInterpolatedParser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SlimeNull%2FInterpolatedParser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SlimeNull%2FInterpolatedParser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SlimeNull%2FInterpolatedParser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SlimeNull","download_url":"https://codeload.github.com/SlimeNull/InterpolatedParser/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SlimeNull%2FInterpolatedParser/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259280658,"owners_count":22833432,"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":"2025-05-17T10:09:21.210Z","updated_at":"2025-06-11T14:30:56.959Z","avatar_url":"https://github.com/SlimeNull.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# InterpolatedParser\n\nSimple value parser with interpolated string.\n\nExample:\n\n```cs\nusing InterpolatedParsing;\n\nstring input = \"x is 69\";\n\nint x = 0;\nParsing.Parse(input, $\"x is {x}\");\n\nConsole.WriteLine(x); // Prints 69.\n```\n\n## Built-In Support\n\nByte, UInt16, UInt32, UInt64, SByte, Int16, Int32, Int64, Single, Double, BigInteger, Decimal, Boolean, Enum is supported by default\n\n## Add custom type support\n\nWrite a parser:\n\n```cs\npublic record struct TwoDouble(double X, double Y);\n\npublic class TwoDoubleParser : IParser\u003cTwoDouble\u003e\n{\n    public TwoDouble Parse(ref int index, string text)\n    {\n        double x = 0;\n        double y = 0;\n        Parsing.Parse(ref index, text, $\"{x},{y}\");\n        return new TwoDouble(x, y);\n    }\n\n    public bool TryParse(ref int index, string text, out TwoDouble value)\n    {\n        double x = 0;\n        double y = 0;\n        if (Parsing.TryParse(ref index, text, $\"{x},{y}\"))\n        {\n            value = new TwoDouble(x, y);\n            return true;\n        }\n\n        value = default;\n        return false;\n    }\n}\n```\n\nRegister parser:\n\n```cs\nParsing.RegisterParser(new TwoDoubleParser());\n```\n\nUse:\n\n```cs\nTwoDouble twoDouble = default;\nParsing.Parse(\"2323,2434\", $\"{twoDouble}\");\n\nConsole.WriteLine(twoDouble);  // Prints TwoDouble { X = 2323, Y = 2434 }\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslimenull%2Finterpolatedparser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fslimenull%2Finterpolatedparser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslimenull%2Finterpolatedparser/lists"}