a structural diff that understands syntax 🟥🟩
 
 
 
 
 
Go to file
Patrick Förster 107435ada4
Add luacode and asy as verbatim environments (#141)
Adds the following source code environments:
- `asy`
- `asydef`
- `luacode`
- `luacode*`

Fixes #140.
2024-07-18 17:35:26 +07:00
.github Add luacode and asy as verbatim environments (#141) 2024-07-18 17:35:26 +07:00
benches BREAKING: Don't check in generated parser.c file (#114) 2024-04-01 14:31:04 +07:00
bindings Fix including grammar.json in gitignore (#143) 2024-07-18 16:36:02 +07:00
examples Add parser benchmark 2022-01-29 10:42:34 +07:00
src Add luacode and asy as verbatim environments (#141) 2024-07-18 17:35:26 +07:00
test/corpus Add luacode and asy as verbatim environments (#141) 2024-07-18 17:35:26 +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 Fix including grammar.json in gitignore (#143) 2024-07-18 16:36:02 +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 Add luacode and asy as verbatim environments (#141) 2024-07-18 17:35:26 +07:00
package-lock.json Add luacode and asy as verbatim environments (#141) 2024-07-18 17:35:26 +07:00
package.json Add luacode and asy as verbatim environments (#141) 2024-07-18 17:35:26 +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.