{"id":22870215,"url":"https://github.com/berquerant/ybase","last_synced_at":"2026-02-26T07:16:25.355Z","repository":{"id":59669897,"uuid":"538390706","full_name":"berquerant/ybase","owner":"berquerant","description":"Utilities to implement a lexer for goyacc.","archived":false,"fork":false,"pushed_at":"2025-09-12T19:08:02.000Z","size":41,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-20T23:53:44.155Z","etag":null,"topics":["go","goyacc"],"latest_commit_sha":null,"homepage":"","language":"Go","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/berquerant.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,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-09-19T07:51:19.000Z","updated_at":"2025-09-12T19:08:05.000Z","dependencies_parsed_at":"2024-10-24T15:09:21.273Z","dependency_job_id":"6c7b890e-02ae-4526-995d-3ae2b195f946","html_url":"https://github.com/berquerant/ybase","commit_stats":{"total_commits":6,"total_committers":2,"mean_commits":3.0,"dds":"0.16666666666666663","last_synced_commit":"9cc4306a5271f61e5b46d2a8a57915ee6ab0ca6d"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/berquerant/ybase","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/berquerant%2Fybase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/berquerant%2Fybase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/berquerant%2Fybase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/berquerant%2Fybase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/berquerant","download_url":"https://codeload.github.com/berquerant/ybase/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/berquerant%2Fybase/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281099972,"owners_count":26443537,"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-10-26T02:00:06.575Z","response_time":61,"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":["go","goyacc"],"created_at":"2024-12-13T13:14:10.057Z","updated_at":"2025-10-26T11:51:27.072Z","avatar_url":"https://github.com/berquerant.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Go Report Card](https://goreportcard.com/badge/github.com/berquerant/ybase)](https://goreportcard.com/report/github.com/berquerant/ybase)\n[![Go Reference](https://pkg.go.dev/badge/github.com/berquerant/ybase.svg)](https://pkg.go.dev/github.com/berquerant/ybase)\n\n# ybase\n\nUtilities to implement a lexer for goyacc.\n\n## Example\n\n``` go\npackage main\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"unicode\"\n\n\t\"github.com/berquerant/ybase\"\n)\n\nfunc main() {\n\tinput := \"1 + 12 - (34-56)\"\n\ts := ybase.NewLexer(ybase.NewScanner(ybase.NewReader(bytes.NewBufferString(input), nil), func(r ybase.Reader) int {\n\t\tr.DiscardWhile(unicode.IsSpace)\n\t\ttop := r.Peek()\n\t\tswitch {\n\t\tcase unicode.IsDigit(top):\n\t\t\tr.NextWhile(unicode.IsDigit)\n\t\t\treturn 901\n\t\tdefault:\n\t\t\tswitch top {\n\t\t\tcase '+':\n\t\t\t\t_ = r.Next()\n\t\t\t\treturn 911\n\t\t\tcase '-':\n\t\t\t\t_ = r.Next()\n\t\t\t\treturn 912\n\t\t\tcase '(':\n\t\t\t\t_ = r.Next()\n\t\t\t\treturn 921\n\t\t\tcase ')':\n\t\t\t\t_ = r.Next()\n\t\t\t\treturn 922\n\t\t\t}\n\t\t}\n\t\treturn ybase.EOF\n\t}))\n\tfor s.DoLex(func(tok ybase.Token) { fmt.Printf(\"%d %s\\n\", tok.Type(), tok.Value()) }) != ybase.EOF {\n\t}\n\tif err := s.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\t// Output:\n\t// 901 1\n\t// 911 +\n\t// 901 12\n\t// 912 -\n\t// 921 (\n\t// 901 34\n\t// 912 -\n\t// 901 56\n\t// 922 )\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fberquerant%2Fybase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fberquerant%2Fybase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fberquerant%2Fybase/lists"}