{"id":17038813,"url":"https://github.com/azdavis/language-util","last_synced_at":"2025-04-12T13:52:56.751Z","repository":{"id":65535492,"uuid":"344004014","full_name":"azdavis/language-util","owner":"azdavis","description":"Various utility crates that might be useful when implementing a programming language.","archived":false,"fork":false,"pushed_at":"2025-03-13T01:01:00.000Z","size":250,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-26T08:37:13.170Z","etag":null,"topics":["language-server","programming-language"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/azdavis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2021-03-03T04:43:48.000Z","updated_at":"2025-03-13T01:01:03.000Z","dependencies_parsed_at":"2023-10-13T03:44:21.573Z","dependency_job_id":"9c875b2a-81a6-49d0-bc24-8f53e99dff6d","html_url":"https://github.com/azdavis/language-util","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/azdavis%2Flanguage-util","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azdavis%2Flanguage-util/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azdavis%2Flanguage-util/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azdavis%2Flanguage-util/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/azdavis","download_url":"https://codeload.github.com/azdavis/language-util/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248576403,"owners_count":21127389,"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":["language-server","programming-language"],"created_at":"2024-10-14T08:57:54.676Z","updated_at":"2025-04-12T13:52:56.746Z","avatar_url":"https://github.com/azdavis.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# language-util\n\nVarious utility crates that might be useful when implementing a programming language in Rust.\n\nMany of these crates used to be from [c0ls][] or [Millet][], but they are generic enough that they were moved out of it so that they may be re-used in other language servers.\n\n## `always`\n\nAssert, but only in debug mode. Otherwise just log.\n\n## `apply-changes`\n\nApply a sequence of text changes to a text.\n\n## `chain-map`\n\nA map optimized for the use-case of cloning and adding a few elements to the clone.\n\n## `char-name`\n\nReport the name of some punctuation characters.\n\n## `event-parse`\n\nA generic framework for writing event-based parsers. Such parsers are ones that take as input a flat list of tokens, and produce as output a flat list of events. Events describe how to build a structured syntax tree from the flat list of tokens:\n\n- Start a tree node\n- Consume some tokens\n- Finish the node\n\nThis also lets us handle trivia (whitespace, comments) in one place rather than all over the parser.\n\n## `identifier-case`\n\nTurn `PascalCase` into `snake_case` and vice versa.\n\n## `pattern-match`\n\nDetermine whether a sequence of patterns is exhaustive or if any of the patterns are unreachable.\n\n## `str-process`\n\nProcess a string by each byte.\n\n## `syntax-gen`\n\nGenerates Rust code from an [ungrammar][].\n\n## `text-pos`\n\nAllows translating between byte indices and line-and-character positions in a string.\n\n## `token`\n\nA simple token type (text + token kind) and a simple trait for trivia.\n\n## `topo-sort`\n\nGeneric topological sorting. Useful for when you have many interdependent things and would like to know what order to process them in.\n\n## `uniq`\n\nUnique identifiers, and their generation.\n\n## `paths`\n\nTypes for working with paths, notably:\n\n- A wrapper type for `PathBuf` that guarantees the inner `PathBuf` is absolute.\n- A type that transforms these absolute path buffers into cheap IDs.\n\n## `str-util`\n\nSome common string utilities, like:\n\n- Small strings, just a re-export of `smol_str::SmolStr`.\n- Names, aka non-empty `SmolStr`s.\n\n## `text-size-util`\n\nA wrapper around the `text-size` crate to add some helpers, primarily `WithRange`, a pair of a value and a text range.\n\n## `fmt-util`\n\nA small utility crate for formatting.\n\n## `diagnostic`\n\nA small crate defining primarily the overall `Diagnostic` type, which a language server reports to a client.\n\n## `fast-hash`\n\nA thin wrapper over `FxHash{Map, Set}` with some extra helper functions. These types use `FxHasher`, which is a very fast, but not HashDOS-resistant, hashing algorithm used in Firefox and `rustc`.\n\n## `idx`\n\nA utility crate for an `Idx` type, a cheap copyable type that can index into slices.\n\n## `elapsed`\n\nA small utility crate for timing function calls.\n\n## `code-h2-md-map`\n\nConverts a Markdown file with many level 2 headings with inline code, followed by arbitrary Markdown, into a mapping.\n\nGiven a file like this:\n\n```md\n# Characters\n\nThis is information about characters from _Castle in the Sky_.\n\n## `Sheeta`\n\nA girl who lived on a farm until her parents died, after which she was abducted by the government. She fell out of their airship, and was saved by her magic necklace and a boy, Pazu.\n\n## `Pazu`\n\nA boy who worked in the mines, until he met Sheeta after she fell from the sky. They then went on an adventure to the titular castle and defeated their enemy, Muska.\n\n## `Muska`\n\nAn agent of the government, who wants Sheeta's necklace and the floating castle's power.\n```\n\nThis crate will turn it into a mapping like this:\n\n```json\n{\n  \"Sheeta\": \"A girl who lived on a farm...\",\n  \"Pazu\": \"A boy who worked in the mines...\",\n  \"Muska\": \"An agent of the government...\"\n}\n```\n\n## `write-rs-tokens`\n\nWrite Rust tokens to a file, as part of a build script.\n\n[c0ls]: https://github.com/azdavis/c0ls\n[millet]: https://github.com/azdavis/millet\n[ungrammar]: https://github.com/rust-analyzer/ungrammar\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazdavis%2Flanguage-util","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fazdavis%2Flanguage-util","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazdavis%2Flanguage-util/lists"}