{"id":13710286,"url":"https://github.com/winksaville/zig-parse-number","last_synced_at":"2026-01-29T05:09:01.280Z","repository":{"id":77462889,"uuid":"157953818","full_name":"winksaville/zig-parse-number","owner":"winksaville","description":"Implement ParseNumber which can parse any TypeId.Int or TypeId.Float.","archived":false,"fork":false,"pushed_at":"2019-03-05T21:13:52.000Z","size":30,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-13T20:40:37.483Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/winksaville.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":null}},"created_at":"2018-11-17T05:27:32.000Z","updated_at":"2020-06-12T21:50:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"1932999f-6d0b-4112-89a3-72415de7be99","html_url":"https://github.com/winksaville/zig-parse-number","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/winksaville%2Fzig-parse-number","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winksaville%2Fzig-parse-number/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winksaville%2Fzig-parse-number/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winksaville%2Fzig-parse-number/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/winksaville","download_url":"https://codeload.github.com/winksaville/zig-parse-number/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252745013,"owners_count":21797720,"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":"2024-08-02T23:00:54.063Z","updated_at":"2026-01-29T05:09:01.247Z","avatar_url":"https://github.com/winksaville.png","language":"Zig","readme":"# Zig ParseNumber\n\nParseNumber returns a struct has a `parse` member that takes a slice and returns a T.\n\n```\npub fn ParseNumber(comptime T: type) type {\n    return struct {\n        fn parse(str: []const u8) !T {\n\t    ...\n\t}\n    }\n}\n```\n\n\n## Examples\n\n```\ntest \"ParseNumber.parseF32\" {\n    const parseF32 = ParseNumber(f32).parse;\n    var vf32 = try parseF32(\"123.e4\");\n    assert(vf32 == f32(123e4));\n}\n```\n\n## Test\n```bash\n$ zig test --release-safe parse_number.zig\nTest 1/7 ParseNumber.parseIntegerNumber...OK\nTest 2/7 ParseNumber.parseFloatNumber...OK\nTest 3/7 ParseNumber...OK\nTest 4/7 ParseNumber.errors...OK\nTest 5/7 ParseNumber.non-u8-sizes...OK\nTest 6/7 ParseNumber.non-u8-size-errors...OK\nTest 7/7 ParseNumber.parseF32...OK\nAll tests passed.\n```\n\n## Clean\nRemove `zig-cache/` directory\n```bash\n$ rm -rf test ./zig-cache/\n```\n","funding_links":[],"categories":["Applications","Parser","Language Essentials"],"sub_categories":["File Format Processing"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwinksaville%2Fzig-parse-number","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwinksaville%2Fzig-parse-number","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwinksaville%2Fzig-parse-number/lists"}