a structural diff that understands syntax 🟥🟩
 
 
 
 
 
Go to file
Patrick Förster 0fb72fb1b2
Fix version numbers for Swift, Python and C (#142)
2024-07-18 16:33:20 +07:00
.github Remove unused update workflow 2024-04-01 14:46:06 +07:00
benches BREAKING: Don't check in generated parser.c file (#114) 2024-04-01 14:31:04 +07:00
bindings BREAKING: Don't check in generated parser.c file (#114) 2024-04-01 14:31:04 +07:00
examples Add parser benchmark 2022-01-29 10:42:34 +07:00
src BREAKING: Don't check in generated parser.c file (#114) 2024-04-01 14:31:04 +07:00
test/corpus Support more general URIs in hyperlinks (#134) (#135) 2024-06-23 16:03:58 +07:00
.clang-format Simplify parsing of special LaTeX commands 2021-12-27 13:22:53 +07:00
.editorconfig BREAKING: Don't check in generated parser.c file (#114) 2024-04-01 14:31:04 +07:00
.gitattributes BREAKING: Don't check in generated parser.c file (#114) 2024-04-01 14:31:04 +07:00
.gitignore BREAKING: Don't check in generated parser.c file (#114) 2024-04-01 14:31:04 +07:00
.prettierrc Reformat grammar.js 2024-04-28 09:20:40 +07:00
CHANGELOG.md Add support for parsing hyperlinks (#133) 2024-06-22 09:50:56 +07:00
Cargo.toml Fix version numbers for Swift, Python and C (#142) 2024-07-18 16:33:20 +07:00
LICENSE Simplify parsing of special LaTeX commands 2021-12-27 13:22:53 +07:00
Makefile Fix version numbers for Swift, Python and C (#142) 2024-07-18 16:33:20 +07:00
Package.swift BREAKING: Don't check in generated parser.c file (#114) 2024-04-01 14:31:04 +07:00
README.md BREAKING: Don't check in generated parser.c file (#114) 2024-04-01 14:31:04 +07:00
binding.gyp BREAKING: Don't check in generated parser.c file (#114) 2024-04-01 14:31:04 +07:00
grammar.js Support more general URIs in hyperlinks (#134) (#135) 2024-06-23 16:03:58 +07:00
package-lock.json Bump node-gyp-build from 4.8.0 to 4.8.1 (#122) 2024-06-22 07:51:43 +07:00
package.json Bump node-addon-api from 7.1.0 to 8.0.0 (#116) 2024-06-22 07:51:23 +07:00
pyproject.toml Fix version numbers for Swift, Python and C (#142) 2024-07-18 16:33:20 +07:00
setup.py BREAKING: Don't check in generated parser.c file (#114) 2024-04-01 14:31:04 +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.