Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/latex-lsp/tree-sitter-latex
LaTeX grammar for tree-sitter
https://github.com/latex-lsp/tree-sitter-latex
Last synced: 7 days ago
JSON representation
LaTeX grammar for tree-sitter
- Host: GitHub
- URL: https://github.com/latex-lsp/tree-sitter-latex
- Owner: latex-lsp
- License: mit
- Created: 2021-02-28T14:29:11.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-10-11T18:04:21.000Z (about 1 month ago)
- Last Synced: 2024-10-13T15:21:34.586Z (about 1 month ago)
- Language: JavaScript
- Size: 66.9 MB
- Stars: 98
- Watchers: 7
- Forks: 24
- Open Issues: 21
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# tree-sitter-latex
[![CI](https://github.com/latex-lsp/tree-sitter-latex/workflows/CI/badge.svg)](https://github.com/latex-lsp/tree-sitter-latex/actions)
[![npm](https://img.shields.io/npm/v/@pfoerster/tree-sitter-latex)](https://www.npmjs.com/package/@pfoerster/tree-sitter-latex)This repo provides a [LaTeX](https://www.latex-project.org/) grammar for the [tree-sitter](https://github.com/tree-sitter/tree-sitter) parser generator.
Originally, this grammar is based off the parser of the [`texlab`](https://github.com/latex-lsp/texlab) language server and primarily focuses on the constructs that are relevant for the language server.
This repository does not provide the accompanying highlighting definitions, instead they live in the [`nvim-treesitter`](https://github.com/nvim-treesitter/nvim-treesitter/tree/master/queries/latex) repository.
To generate the parser, run
```
npx tree-sitter generate
```after checking out the repository.
## Limitations
As widely known, parsing LaTeX is Turing complete so there is no way to handle every construct in a `tree-sitter` grammar. Instead, the grammar relies on a best effort approach while focusing on the LaTeX specific constructs like environments or sections instead of dealing with TeX internals like catcode.