{"id":51472457,"url":"https://github.com/tachyons/tree-sitter-lexc","last_synced_at":"2026-07-06T19:01:26.355Z","repository":{"id":366830343,"uuid":"1278046980","full_name":"tachyons/tree-sitter-lexc","owner":"tachyons","description":"TreeSitter parser for HFST lexc","archived":false,"fork":false,"pushed_at":"2026-06-23T12:48:58.000Z","size":38,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-23T14:25:03.838Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/tachyons.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-23T12:15:18.000Z","updated_at":"2026-06-23T12:49:05.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/tachyons/tree-sitter-lexc","commit_stats":null,"previous_names":["tachyons/tree-sitter-lexc"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/tachyons/tree-sitter-lexc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tachyons%2Ftree-sitter-lexc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tachyons%2Ftree-sitter-lexc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tachyons%2Ftree-sitter-lexc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tachyons%2Ftree-sitter-lexc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tachyons","download_url":"https://codeload.github.com/tachyons/tree-sitter-lexc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tachyons%2Ftree-sitter-lexc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35202786,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-06T02:00:07.184Z","response_time":106,"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":[],"created_at":"2026-07-06T19:01:25.528Z","updated_at":"2026-07-06T19:01:26.312Z","avatar_url":"https://github.com/tachyons.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tree-sitter-lexc\n\nA [Tree-sitter](https://tree-sitter.github.io/tree-sitter/) grammar for [lexc](https://wiki.apertium.org/wiki/Lexc) — the lexicon compiler format used by finite-state morphology tools such as [HFST](https://hfstol.readthedocs.io/) and [Foma](https://fomafst.github.io/).\n\n## Features\n\n- Parses `Multichar_Symbols` / `Alphabet` declarations\n- Parses `LEXICON` sections with entries (upper/lower string pairs, continuations, comments)\n- Syntax highlighting via `queries/highlights.scm`\n- Supports `%`-escaped characters and flag diacritics (`@U.feat.val@`)\n\n## Example\n\n```lexc\nMultichar_Symbols\n%\u003cn%\u003e %\u003cpl%\u003e %\u003csg%\u003e\n\nLEXICON Root\nNounRoot ;\n\nLEXICON NounRoot\ncat%\u003cn%\u003e RegNounInfl ;  ! A noun\n\nLEXICON RegNounInfl\n%\u003cn%\u003e%\u003csg%\u003e:   # ;\n%\u003cn%\u003e%\u003cpl%\u003e:s  # ;\n```\n\n## Usage\n\n### CLI\n\n```sh\ntree-sitter parse file.lexc\ntree-sitter highlight file.lexc\n```\n\n### Node.js\n\n```js\nimport Parser from \"tree-sitter\";\nimport Lexc from \"tree-sitter-lexc\";\n\nconst parser = new Parser();\nparser.setLanguage(Lexc);\n\nconst tree = parser.parse(`\nLEXICON Root\nNounRoot ;\n`);\nconsole.log(tree.rootNode.toString());\n```\n\n### Rust\n\n```rust\nlet code = r#\"\nLEXICON Root\nNounRoot ;\n\"#;\nlet mut parser = tree_sitter::Parser::new();\nparser\n    .set_language(\u0026tree_sitter_lexc::LANGUAGE.into())\n    .expect(\"Error loading Lexc parser\");\nlet tree = parser.parse(code, None).unwrap();\nassert!(!tree.root_node().has_error());\n```\n\n## Syntax Highlighting\n\nThe grammar ships with a `queries/highlights.scm` for editor integration.\n\n| Capture | Meaning |\n|---|---|\n| `@keyword` | `Multichar_Symbols`, `LEXICON`, etc. |\n| `@type` | Lexicon section names and continuation references |\n| `@string` | Entry forms (upper/lower pairs) |\n| `@string.special` | Declared multichar symbols |\n| `@constant.builtin` | End-of-string marker `#` |\n| `@comment` | `! ...` line comments |\n\n## Known Limitations\n\nPlain-word no-colon entries (e.g. `dog RegNounInfl ;`) cannot be fully disambiguated without an external scanner, since a plain word is lexically identical to a continuation lexicon name. Entries that contain `%`-escaped symbols or a `:` separator parse correctly. This is sufficient for syntax highlighting purposes.\n\n## Development\n\n```sh\n# Generate the parser after editing grammar.js\ntree-sitter generate\n\n# Run tests\nnpm test        # Node.js\ncargo test      # Rust\n\n# Test highlighting\ntree-sitter highlight path/to/file.lexc\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftachyons%2Ftree-sitter-lexc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftachyons%2Ftree-sitter-lexc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftachyons%2Ftree-sitter-lexc/lists"}