{"id":22549917,"url":"https://github.com/openmodelica/tree-sitter-modelica","last_synced_at":"2025-04-10T02:01:48.253Z","repository":{"id":68758572,"uuid":"452803691","full_name":"OpenModelica/tree-sitter-modelica","owner":"OpenModelica","description":"A tree-sitter parser for Modelica","archived":false,"fork":false,"pushed_at":"2024-04-18T10:11:09.000Z","size":346,"stargazers_count":6,"open_issues_count":2,"forks_count":5,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-03-24T03:35:06.395Z","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OpenModelica.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":"2022-01-27T18:46:03.000Z","updated_at":"2024-12-13T03:22:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"eeea342f-6231-49a2-8ead-7e99121f9c5a","html_url":"https://github.com/OpenModelica/tree-sitter-modelica","commit_stats":{"total_commits":10,"total_committers":5,"mean_commits":2.0,"dds":0.7,"last_synced_commit":"695804c544a0c9bb8afc435d59672ec078d64208"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenModelica%2Ftree-sitter-modelica","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenModelica%2Ftree-sitter-modelica/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenModelica%2Ftree-sitter-modelica/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenModelica%2Ftree-sitter-modelica/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OpenModelica","download_url":"https://codeload.github.com/OpenModelica/tree-sitter-modelica/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248142959,"owners_count":21054671,"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-12-07T16:10:25.258Z","updated_at":"2025-04-10T02:01:48.192Z","avatar_url":"https://github.com/OpenModelica.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![build-parser](https://github.com/OpenModelica/tree-sitter-modelica/actions/workflows/build-parser.yml/badge.svg)](https://github.com/OpenModelica/tree-sitter-modelica/actions/workflows/build-parser.yml)\n\n# tree-sitter-modelica\n\nAn [open-source](OSMC-License.txt) Modelica\n([Modelica Language Specification v3.5](https://specification.modelica.org/maint/3.5/MLS.html))\ngrammar and highlighting-query for\n[tree-sitter](https://github.com/tree-sitter/tree-sitter).\n\n## Dependencies\n\n  - Node.js\n  - Docker\n\n## Installation\n\n```bash\nnpm install\nnpm run build\n```\n\nTo generate the C code to parse Modelica run:\n\n```bash\nnpx tree-sitter generate\n```\n\n\u003e [!NOTE]\n\u003e If you have ./node_modules/.bin in your `PATH` environment variable you can skip `npx`\n\u003e ```bash\n\u003e tree-sitter generate\n\u003e ```\n\n## Unit Tests\n\nThere is a number of tests included. To run all tests defined in [test/](./test/) just run:\n\n```bash\nnpx tree-sitter test\n```\n\n### Examples\n\nTo test the parser on a Modelica file run:\n\n```bash\nnpx tree-sitter parse examples/SimpleMath.mo\n```\n\n## Highlighting\n\nThere is also a highlighting query included.\nMake sure that the\n[tree-sitter per-user configuration](https://tree-sitter.github.io/tree-sitter/syntax-highlighting#per-user-configuration)\nare pointing to the parent directory of `tree-sitter-modelica`.\nSo if this directory is in `/home/USER/workspace/tree-sitter-modelica` add\n`/home/USER/workspace` to the parser directories:\n\n**config.json**\n```json\n{\n  \"parser-directories\": [\n    \"/home/USER/workspace\"\n  ],\n}\n```\n\nTo test the highlighting configure run:\n\n```bash\nnpx tree-sitter highlight examples/SimpleMath.mo\n```\n\n## Usage\n\nUse [Web Tree-sitter](https://github.com/tree-sitter/tree-sitter/blob/master/lib/binding_web/README.md)\n`tree-sitter-modelica.wasm` in your application:\n\n```typescript\nimport * as Parser from 'web-tree-sitter'\n\nawait Parser.init()\nconst parser = new Parser\n\nconst Modelica = await Parser.Language.load(`tree-sitter-modelica.wasm`)\nparser.setLanguage(Modelica)\n```\n\n## Current Status\n\nTree-sitter-modelica has been tested on a \"Save Total\" version of the\n[Modelica.Fluid.Examples.DrumBoiler.DrumBoiler](./examples/DrumBoiler.mo) which was\nsuccessfully parsed and highlighted.\n\n```bash\nnpx tree-sitter parse examples/DrumBoiler.mo\nnpx tree-sitter highlight examples/DrumBoiler.mo\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenmodelica%2Ftree-sitter-modelica","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenmodelica%2Ftree-sitter-modelica","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenmodelica%2Ftree-sitter-modelica/lists"}