Metadata-Version: 2.4
Name: tree-sitter-gosu
Version: 0.1.1
Summary: A Tree-sitter grammar that parses Gosu, a statically typed, JVM-based general-purpose programming language.
License: MIT License
         
         Copyright (c) 2026 Ron Webb
         
         Permission is hereby granted, free of charge, to any person obtaining a copy
         of this software and associated documentation files (the "Software"), to deal
         in the Software without restriction, including without limitation the rights
         to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
         copies of the Software, and to permit persons to whom the Software is
         furnished to do so, subject to the following conditions:
         
         The above copyright notice and this permission notice shall be included in all
         copies or substantial portions of the Software.
         
         THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
         IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
         FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
         AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
         LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
         OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
         SOFTWARE.
License-File: LICENSE
Author: Ron Webb
Author-email: ron@ronella.xyz
Requires-Python: >=3.14
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.14
Requires-Dist: env-dir-bootstrap (>=1.0.0,<2.0.0)
Requires-Dist: logenrich (>=1.0.1,<2.0.0)
Requires-Dist: tree-sitter (>=0.26.0,<0.27.0)
Description-Content-Type: text/markdown

# tree-sitter-gosu

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
[![Version](https://img.shields.io/badge/version-0.1.1-blue.svg)](CHANGELOG.md)

A Tree-sitter grammar that parses Gosu, a statically typed, JVM-based general-purpose programming language.

## Requirements

- Python `>=3.14`
- Poetry `2.2`
- Node.js (for `tree-sitter-cli`, used to regenerate the parser from `grammar.js`)
- A C compiler (MSVC on Windows, GCC/Clang on Linux/macOS) to build the native extension and run
  `tree-sitter test`/`tree-sitter parse`

## Installation

```bash
poetry install
```

## Usage

```python
import tree_sitter
import tree_sitter_gosu

language = tree_sitter.Language(tree_sitter_gosu.language())
parser = tree_sitter.Parser(language)
tree = parser.parse(b"class Foo { function bar(): int { return 1 } }")
```

## Development

### Install dependencies

```bash
poetry install
```

### Run tests with coverage

```bash
poetry run pytest --cov=tree_sitter_gosu tests --cov-report html
```

### Format and lint

```bash
poetry run black tree_sitter_gosu; poetry run pylint tree_sitter_gosu
```

### Regenerate the parser from grammar.js

```bash
npm install
npx tree-sitter generate
npx tree-sitter test
```

## Configuration

Set the `TREE_SITTER_GOSU_CONFIG_DIR` environment variable to override the default configuration directory.

## License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

