difftastic/vendored_parsers/tree-sitter-latex
Wilfred Hughes 56bf026c49 Add missing files for latex build 2025-01-21 21:49:18 +07:00
..
.github
benches
bindings
examples
src Add missing files for latex build 2025-01-21 21:49:18 +07:00
test/corpus
.clang-format
.editorconfig
.gitattributes
.gitignore
.prettierrc
CHANGELOG.md
Cargo.toml
LICENSE
Makefile
Package.swift
README.md
binding.gyp
grammar.js
package-lock.json
package.json Merge commit '7b06f6ed394308e7407a1703d2724128c45fc9d7' 2025-01-21 08:39:54 +07:00
pyproject.toml
setup.py
tree-sitter.json Merge commit '7b06f6ed394308e7407a1703d2724128c45fc9d7' 2025-01-21 08:39:54 +07:00

README.md

tree-sitter-latex

CI npm

This repo provides a LaTeX grammar for the tree-sitter parser generator.

Originally, this grammar is based off the parser of the 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 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.