{"id":16851911,"url":"https://github.com/cad97/rust-lexical-spec","last_synced_at":"2025-03-18T09:40:19.014Z","repository":{"id":90989772,"uuid":"257462180","full_name":"CAD97/rust-lexical-spec","owner":"CAD97","description":"A proposed lexical specification for rust-lang/rust","archived":false,"fork":false,"pushed_at":"2022-05-19T05:59:57.000Z","size":52,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-24T16:10:28.341Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/CAD97.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":"2020-04-21T02:45:51.000Z","updated_at":"2022-05-19T06:00:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"14589a10-2b0b-4b3c-9eb4-fd6544f33437","html_url":"https://github.com/CAD97/rust-lexical-spec","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/CAD97%2Frust-lexical-spec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CAD97%2Frust-lexical-spec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CAD97%2Frust-lexical-spec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CAD97%2Frust-lexical-spec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CAD97","download_url":"https://codeload.github.com/CAD97/rust-lexical-spec/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244196780,"owners_count":20414367,"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-10-13T13:34:06.021Z","updated_at":"2025-03-18T09:40:18.978Z","avatar_url":"https://github.com/CAD97.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A proposed lexical specification for rust-lang/rust\n\n- [Read the spec](./spec/index.md)\n- [See the reference implementations](./src)\n- [See the test suite](./tests)\n\n### Todo:\n\n- Reference impl for lexer cooker\n- Tests for cooked lexer\n- Cooked lexer impl based on `rustc_lexer` (and test against reference impl)\n- Cooked lexer impl based on `proc_macro2`'s standalone mode (and test against reference impl)\n- Guarantee test suite coverage of all (reachable) arms of the naive reference impl\n\n### Annoyances:\n\n- `identifier_fragment` irks me. But the current setup of matching float exponent syntax in the raw lexer\n  (`123e456`) rather than trying to do it in the lexer cooking stage by introspecing identifiers is much cleaner.\n  Thus, I think it might be a necessary evil to accept the fun edge case `0.0b·XID_Continue·after·binary·int·raw·class`.\n\n### Nice to haves:\n\n- Show semi-formally that the imperitively-specced cooking transform is context-free (regular?)\n- Generate spec text and reference impl from structured metadata\n- More structured test battery, probably homebrew rather than `insta`\n- RFC this specification\n\n### Stretch goals?\n\n- Port `rustc_lexer` to use a level similar to raw tokens?\n- Autogenerate (part of) `rustc_lexer`?\n- Rustc `libsyntax` works with decomposed raw tokens instead of composed tokens?\n  (which atm are even more composed than `proc_macro`, `libsyntax` still does token splitting rather than joining) \n- Use raw tokens in grammar spec instead of cooked tokens (`proc_macro`)?\n- `meta::tokens` uses raw tokens instead of `proc_macro`'s cooked tokens?\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcad97%2Frust-lexical-spec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcad97%2Frust-lexical-spec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcad97%2Frust-lexical-spec/lists"}