Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 1 addition & 66 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,68 +30,7 @@
<hr/>
<br/>

## Example

Extract all function declarations with their names and bodies:

```
(function_declaration
name: (identifier) @name
body: (statement_block) @body) @fn
```

Plotnik infers a typed output structure from your query:

```
{ fn: Node, name: Node, body: Node }
```

## Features

- **Recursion** — match nested structures of arbitrary depth
- **Type inference** — output types derived automatically from query structure
- **Named expressions** — define reusable subqueries with `Name = expr`
- **Partial matching** — queries match subtrees, no need to specify every child
- **Sequences** — `{a b c}` for ordered matches with optional adjacency anchors
- **Alternations** — `[a b]` with merge or tagged union output styles
- **Quantifiers** — `?`, `*`, `+` map to optional and array types
- **Field constraints** — `field: expr` and negated `!field`
- **Supertypes** — `(expression/identifier)` for grammar hierarchies

## Installation

```sh
cargo install plotnik-cli
```

Or build from source:

```sh
git clone https://github.com/plotnik-lang/plotnik.git
cd plotnik
cargo build --release
```

## Usage

```sh
# Parse and inspect a query
plotnik debug --query-text '(function_declaration) @fn' --query-ast

# Parse source file and show AST
plotnik debug --source-file example.ts --source-ast

# Run query against source
plotnik debug --query-text '(identifier) @id' --source-file example.ts --result

# List supported languages
plotnik langs

# Show documentation
plotnik docs reference
```

## Roadmap
## Roadmap 🚀

**Ignition** _(the parser)_

Expand Down Expand Up @@ -120,7 +59,3 @@ plotnik docs reference
- [ ] Bindings (TypeScript, Python, Ruby)
- [ ] LSP server
- [ ] Editor support (VSCode, Zed, Neovim)

## License

[MIT](LICENSE.md)