Metadata-Version: 2.4
Name: tree-sitter-orca
Version: 0.2.0
Summary: Parser for input file for the Orca quantum chemistry package
Author-email: Kalman Szenes <szenes.kalman@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/kszenes/tree-sitter-orca
Keywords: incremental,parsing,tree-sitter,orca
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Compilers
Classifier: Topic :: Text Processing :: Linguistic
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: build>=1.3.0
Requires-Dist: twine>=6.1.0
Provides-Extra: core
Requires-Dist: tree-sitter~=0.24; extra == "core"

# Tree-sitter ORCA

A [Tree-sitter](https://tree-sitter.github.io/tree-sitter/) grammar for [ORCA](https://www.faccts.de/orca/) quantum chemistry input files.

ORCA is a quantum chemistry package for electronic structure calculations.
This grammar parses ORCA input files (`.inp`) including simple command lines, input blocks, geometry specifications as well as complex workflows using compound scripts.
In addition, it provides queries to support syntax highlighting, proper indentation and code folding.

## Demo

<img width="690" height="729" alt="SCR-20250808-ufgv" src="https://github.com/user-attachments/assets/a4dbca4a-0545-4cb6-bdcb-a1a989b401ac" />

## Installation

### PyPI

```bash
pip install tree-sitter-orca
```

### Neovim with nvim-treesitter

#### Enable Parser

Add to your `init.lua`:

```lua
-- Define ORCA '*.inp' extension
vim.filetype.add({
	extension = {
		inp = "inp",
	},
})
-- Enable custom tree-sitter parser
local parser_config = require "nvim-treesitter.parsers".get_parser_configs()
parser_config.orca = {
  install_info = {
    url = "https://github.com/kszenes/tree-sitter-orca",
    files = { "src/parser.c" },
    branch = "main",
  },
  filetype = "inp",
}
```

Install the parser in Neovim using

```
:TSUpdate orca
```

You should now be able to inspect the abstract syntax tree from within Neovim using `:TSInspect`

#### Syntax Highlighting

Create syntax highlighting:

```bash
mkdir -p ~/.config/nvim/queries/orca
ln -s /path/to/tree-sitter-orca/queries/highlights.scm ~/.config/nvim/queries/orca/highlights.scm
```

