Commit graph

1363 commits

Author SHA1 Message Date
Amaan Qureshi 4b6723192e refactor(cli): replace embedded xterm colors file with ansi_colours
Some checks failed
CI / checks (push) Waiting to run
CI / sanitize (push) Failing after 11s
CI / build (push) Failing after 14s
Deploy Docs / deploy-docs (push) Has been cancelled
2025-01-25 17:20:18 -05:00
Amaan Qureshi c01bf6ea4a fix(cli): minor discrepancies with pretty printer
Some checks failed
CI / checks (push) Waiting to run
Deploy Docs / deploy-docs (push) Waiting to run
CI / sanitize (push) Failing after 11s
CI / build (push) Failing after 13s
Check Bindgen Output / check-bindgen (push) Has been cancelled
Check WASM Exports / check-wasm-exports (push) Has been cancelled
2025-01-25 03:47:26 -05:00
ObserverOfTime 5cfeba9c0d feat(bindings): add opt-in zig bindings 2025-01-25 03:47:19 -05:00
Amaan Qureshi 46f8d1267c feat(init): add a title field to grammars 2025-01-25 03:20:43 -05:00
Amaan Qureshi 4820d50336 fix(init): handle parser name replacements better when a kebab-case name is expected 2025-01-25 03:20:43 -05:00
Amaan Qureshi bde94aed4d feat(init): add a class-name field to grammars 2025-01-25 03:20:43 -05:00
Amaan Qureshi 6dbcfdf282 feat(init): add an optional funding field 2025-01-25 03:20:43 -05:00
Amaan Qureshi 4ab78ae00d fix(init): don't prepend the default filetype with a . 2025-01-25 03:20:43 -05:00
Allan Clements cda634a1c4 feat: add error information in the progress callback
This allows users to bail parsing if an error was *definitely* detected
using the progress callback, as all possible stack versions have a
non-zero error cost.

Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2025-01-25 02:47:39 -05:00
Amaan Qureshi 8bb1448a6f feat: add the semantic version to TSLanguage, and expose an API for retrieving it 2025-01-25 01:14:30 -05:00
Amaan Qureshi 3e72969ce4 fix(playground): work around lack of module support in mdbook
Some checks failed
CI / checks (push) Waiting to run
CI / sanitize (push) Failing after 11s
CI / build (push) Failing after 13s
Deploy Docs / deploy-docs (push) Has been cancelled
2025-01-22 04:09:08 -05:00
Amaan Qureshi 692332ed1c feat!: update playground with new web bindings 2025-01-21 12:36:15 -05:00
Amaan Qureshi 6941497c7a test: improve test coverage
Some checks failed
CI / checks (push) Waiting to run
CI / sanitize (push) Failing after 11s
CI / build (push) Failing after 13s
2025-01-21 01:17:03 -05:00
Yuri Astrakhan 9dbe165296 chore: a few minor lints
* do not use `&` for the format args as it cannot (yet) be optimized by the compiler
* a few format inlining
2025-01-21 00:57:58 -05:00
Yuri Astrakhan 48059b72a8 feat: remove lazy_static in favor of LazyLock
This switches to the built-in `std::sync::LazyLock`
2025-01-21 00:21:35 -05:00
Amaan Qureshi 9365586cc3 feat: allow parser balancing to be cancellable 2025-01-20 23:52:19 -05:00
Scorg 40eb26e580 build(bindings): move header to tree_sitter subdirectory
Some checks failed
CI / checks (push) Waiting to run
Deploy Docs / deploy-docs (push) Waiting to run
CI / sanitize (push) Failing after 13s
CI / build (push) Failing after 14s
This patch allows users to include the parser by the same path from
local build as well as installed location. Previously it was not
possible to include the header prior to installing the built parser.
2025-01-20 13:17:24 -05:00
ObserverOfTime a9dbb7257c feat(bindings): support free-threaded python build 2025-01-19 12:45:08 -05:00
ObserverOfTime 7bf51ae08a feat(bindings): drop python 3.9 support 2025-01-19 12:45:08 -05:00
WillLillis 3a85d4d5f3 feat(cli): improve readability of parse debug output
Some checks failed
CI / sanitize (push) Failing after 14s
CI / build (push) Failing after 16s
CI / checks (push) Has been cancelled
2025-01-13 01:13:31 -05:00
Amaan Qureshi 24f51518d1 feat(cli)!: remove migration code for tree-sitter.json
Some checks failed
CI / checks (push) Waiting to run
CI / sanitize (push) Failing after 14s
CI / build (push) Failing after 16s
Check Bindgen Output / check-bindgen (push) Has been cancelled
Check WASM Exports / check-wasm-exports (push) Has been cancelled
2025-01-12 22:11:30 -05:00
Amaan Qureshi e389d54868 chore: readd skipped test 2025-01-12 13:04:10 -05:00
Amaan Qureshi 5de314833f feat(query): structurally verify supertype queries 2025-01-12 13:04:10 -05:00
Amaan Qureshi 9d9c76e693 feat(generate): explicitly disallow non-terminals in non-terminals 2025-01-12 04:47:59 -05:00
WillLillis d65a74a667 fix(cli): correct test update option 2025-01-12 01:44:58 -05:00
WillLillis ea9c85fb94 fix(cli): fix error display, considering structured data returned from
generate command
2025-01-12 01:44:51 -05:00
WillLillis dcfc95e563 fix(cli): only remove test input's trailing '\r' if running on windows
Some checks failed
CI / checks (push) Waiting to run
CI / sanitize (push) Failing after 14s
CI / build (push) Failing after 15s
platform
2025-01-11 17:52:54 -05:00
WillLillis f47319212b feat(cli): allow test subcommand to include/exclude by corpus test file names 2025-01-11 00:58:26 -05:00
WillLillis 329dcc92a1 fix(rust): adapt to a few new nightly lints 2025-01-10 22:00:23 -05:00
WillLillis c8bd78a29c feat(playground): provide colored highlight for captures in code editor 2025-01-10 00:45:08 -05:00
WillLillis cbf960ff20 fix(cli): remove double print of generate errors
Some checks failed
CI / checks (push) Waiting to run
CI / sanitize (push) Failing after 13s
CI / build (push) Failing after 15s
2025-01-08 01:13:22 -05:00
Damien Guard 4170f71dbc
feat(generate): add .exp and .lib files to gitignore template
Some checks failed
CI / checks (push) Waiting to run
CI / sanitize (push) Failing after 14s
CI / build (push) Failing after 15s
On Windows, tree-sitter-cli creates parser.exp and parser.lib so ideally we'd exclude those automatically.
2025-01-06 16:13:39 -05:00
Amaan Qureshi ba19fe31be test: ignore flaky test for now
Some checks failed
CI / checks (push) Waiting to run
CI / sanitize (push) Failing after 14s
CI / build (push) Failing after 15s
We'll re-enable post-release & when grammars are updated
2025-01-06 01:55:15 -05:00
WillLillis 867433afd7 feat(rust): use thiserror for generate crate
Some checks failed
CI / checks (push) Waiting to run
CI / sanitize (push) Failing after 13s
CI / build (push) Failing after 16s
Check Bindgen Output / check-bindgen (push) Has been cancelled
Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2025-01-05 00:27:12 -05:00
WillLillis 5a825a0930 feat(cli): add json summary of parsing 2025-01-05 00:27:12 -05:00
Riley Bruins 19482834bd feat: add Supertype API
Introduces a new function that takes in a supertype symbol and returns
all associated subtypes. Can be used by query.c to give better errors
for invalid subtypes, as well as downstream applications like the query
LSP to give better diagnostics.
2025-01-05 00:14:09 -05:00
WillLillis 07c08432ca fix(rust): use PathBuf for --query-paths highlight option
Some checks failed
CI / checks (push) Waiting to run
CI / sanitize (push) Failing after 12s
CI / build (push) Failing after 13s
2025-01-04 04:12:24 -05:00
WillLillis 619d347f95 chore: fix doc comment 2025-01-04 04:12:24 -05:00
Amaan Qureshi efc51a596c fix(lib): don't consider unfinished captures definite when the following step is immediate
Some checks failed
CI / checks (push) Waiting to run
CI / sanitize (push) Failing after 12s
CI / build (push) Failing after 14s
When collecting captures, we were treating unfinished ones as definite
even if they had pending immediate steps that weren't yet satisfied. Now
we only mark a capture as definite if the pattern is guaranteed and
there are no pending immediate steps to check.
2025-01-04 02:03:41 -05:00
Amaan Qureshi 5f379da544 fix(lib): prevent wildcards from incorrectly marking child patterns as infallible
When a pattern appears under a wildcard parent (like "(_ (expr))"), we
were incorrectly marking it as infallible. The parent_pattern_guaranteed
flag only means the pattern will match after finding the right wildcard
parent, not that any wildcard parent will work.
2025-01-03 23:09:49 -05:00
Amaan Qureshi a7e6d01144 fix(lib): propagate last_child status to pattern alternatives in queries
Previously, when a pattern was marked as the last child in a query, its
alternatives weren't marked similarly, causing incorrect matching
behavior. Now, the `last_child` status is properly propagated through
all alternatives.
2025-01-03 21:13:29 -05:00
Will Lillis f8e77aa99d
style: move command help strings to doc comments
Some checks failed
CI / checks (push) Waiting to run
CI / sanitize (push) Failing after 13s
CI / build (push) Failing after 15s
Deploy Docs / deploy-docs (push) Has been cancelled
2025-01-03 17:29:07 -05:00
Amaan Qureshi 16be945cdd feat(cli): rework tags to use new input handler
Co-authored-by: Will Lillis <will.lillis24@gmail.com>
2025-01-03 16:16:17 -05:00
Amaan Qureshi 55fda55b9b feat(cli): rework highlight to use new input handler
Co-authored-by: Will Lillis <will.lillis24@gmail.com>
2025-01-03 16:16:17 -05:00
Amaan Qureshi 88d2f010f5 feat(cli): rework query to use new input handler
Co-authored-by: Will Lillis <will.lillis24@gmail.com>
2025-01-03 16:16:17 -05:00
Amaan Qureshi 6bad1bc6c5 feat(cli): rework parse to use new input handler
Co-authored-by: Will Lillis <will.lillis24@gmail.com>
2025-01-03 16:16:17 -05:00
Amaan Qureshi cc449ad965 feat(cli): make input handling agnostic
Co-authored-by: Will Lillis <will.lillis24@gmail.com>
2025-01-03 16:16:17 -05:00
Amaan Qureshi 3456330fe9 fix: update outdated links 2025-01-03 15:09:33 -05:00
WillLillis cd3d967f3c fix(cli): correct range in cst pretty printer
Some checks failed
CI / checks (push) Waiting to run
CI / sanitize (push) Failing after 15s
CI / build (push) Failing after 16s
2025-01-01 23:55:16 -05:00
Amaan Qureshi 22f67e2b67 fix(query): ensure immediate matches for any node when an anchor follows a wildcard node 2024-12-29 00:54:16 -05:00
Amaan Qureshi d87d4592e0 test(rust): correct expected and actual spots in assert_eq calls 2024-12-29 00:54:16 -05:00
Will Lillis 4f9869142f
fix(rust): adapt to a few new nightly lints
Some checks failed
CI / checks (push) Waiting to run
CI / sanitize (push) Failing after 14s
CI / build (push) Failing after 15s
2024-12-28 01:17:04 -05:00
Amaan Qureshi b70843a033 fix(playground): add dark theme, align ui more akin to upstream playground 2024-12-25 21:23:36 -05:00
Amaan Qureshi 5bd0d11982 fix(playground): ensure local playground is initialized 2024-12-25 21:23:36 -05:00
Amaan Qureshi bd6aa2be2b fix(playground): correct link to upstream playground 2024-12-25 21:23:36 -05:00
Amaan Qureshi dda45cfbb6 docs: move assets to correct path 2024-12-25 21:23:36 -05:00
Amaan Qureshi f3d50f273b fix(lib): add saturating subtraction to prevent integer underflow 2024-12-25 04:49:39 -05:00
Amaan Qureshi 043969ef18 docs: migrate to mdbook
Some checks failed
CI / checks (push) Waiting to run
Deploy Docs / deploy-docs (push) Waiting to run
CI / sanitize (push) Failing after 14s
CI / build (push) Failing after 15s
Check Bindgen Output / check-bindgen (push) Has been cancelled
2024-12-24 20:54:59 -05:00
WillLillis b747261929 feat(cli): display parse and edit times separately for parse --time 2024-12-23 02:06:13 -05:00
Will Lillis 5d9870ebee
feat(cli): show parse times in testing output 2024-12-23 01:22:37 -05:00
Amaan Qureshi 7d3dbc062d build: bump deps
Some checks failed
CI / sanitize (push) Failing after 14s
CI / build (push) Failing after 14s
CI / checks (push) Has been cancelled
Check Bindgen Output / check-bindgen (push) Has been cancelled
2024-12-16 01:22:58 -05:00
Amaan Qureshi 214b3dc2e6 fix(cli): handle nested tags test files
Some checks failed
Check Bindgen Output / check-bindgen (push) Waiting to run
CI / checks (push) Waiting to run
CI / sanitize (push) Failing after 12s
CI / build (push) Failing after 13s
2024-12-16 00:25:43 -05:00
Amaan Qureshi 2374bca62a fix(cli): gracefully handle OOB assertions 2024-12-16 00:15:02 -05:00
Ramkumar Ramachandra 07aaf2322e
fix: keep highlight names list consistent in the docs and cli
Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2024-12-15 23:29:43 -05:00
Gabriel Holodak f279d10aa2 fix(cli): count skipped tests correctly
Some checks failed
Check Bindgen Output / check-bindgen (push) Waiting to run
CI / checks (push) Waiting to run
CI / sanitize (push) Failing after 14s
CI / build (push) Failing after 15s
2024-12-15 16:09:51 -05:00
Gabriel Holodak 8de3a2ee13 fix(cli): replace nerd font symbols with unicode symbols 2024-12-15 16:09:51 -05:00
Jonathan Raphaelson 8368f9994d
feat: add flag to output css classes instead of inline styles in HTML highlighter output
Some checks failed
Check Bindgen Output / check-bindgen (push) Waiting to run
CI / checks (push) Waiting to run
CI / sanitize (push) Failing after 13s
CI / build (push) Failing after 14s
Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2024-12-15 01:43:22 -05:00
Riley Bruins 495fe2a6c5
feat: support querying missing nodes
Some checks failed
Check Bindgen Output / check-bindgen (push) Waiting to run
CI / checks (push) Waiting to run
CI / sanitize (push) Failing after 13s
CI / build (push) Failing after 14s
Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2024-12-14 14:57:36 -05:00
kylegoetz cd94dbd57f
feat(cli): don't validate email addresses in init command
Some checks failed
CI / sanitize (push) Failing after 14s
CI / build (push) Failing after 15s
Check Bindgen Output / check-bindgen (push) Has been cancelled
CI / checks (push) Has been cancelled
Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2024-12-12 20:00:48 -05:00
Amaan Qureshi ea9aa018b3
feat(cli): add nushell completions 2024-12-10 19:35:58 -05:00
Will Lillis c7b218838d
fix: minor issues with CI
* update ctor

* pass empty `RUSTFLAGS` when installing cross, overriding
the default `-D warnings`

* fix some clippy lints

* create `target` directory before curling wasmtime lib
2024-12-03 16:41:38 -05:00
Novus Nota e445532a1f
feat(cli): verify assertions for every carat in tests, not just the first one
Some checks failed
CI / sanitize (push) Failing after 13s
CI / build (push) Failing after 14s
Check Bindgen Output / check-bindgen (push) Has been cancelled
CI / checks (push) Has been cancelled
Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2024-11-28 23:25:49 -05:00
ObserverOfTime 473f0a1a4d feat(bindings): update some binding files
Some checks failed
CI / sanitize (push) Failing after 12s
CI / build (push) Failing after 13s
Check Bindgen Output / check-bindgen (push) Has been cancelled
CI / checks (push) Has been cancelled
- setup.py
- binding.gyp
2024-11-25 09:45:13 -05:00
ObserverOfTime a08c4b58ab fix(bindings): include headers & queries in python sdist 2024-11-25 09:45:13 -05:00
Peter Oliver 8eb4407200
feat(make,cmake): install queries along with parser libraries
Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
2024-11-25 07:59:25 -05:00
Amaan Qureshi 274e60a523
fix: clippy lints
Some checks failed
CI / sanitize (push) Failing after 14s
CI / build (push) Failing after 15s
Check Bindgen Output / check-bindgen (push) Has been cancelled
CI / checks (push) Has been cancelled
2024-11-16 03:20:59 -05:00
Riley Bruins 78e5144f3f feat: generate schema in tree-sitter.json
Some checks failed
Check Bindgen Output / check-bindgen (push) Waiting to run
CI / checks (push) Waiting to run
CI / sanitize (push) Failing after 13s
CI / build (push) Failing after 14s
2024-11-16 00:38:58 -05:00
Riley Bruins fa6c1471ef
fix(lib): correct escape detection for invalid anonymous nodes
The current quotation escape checker fails in the case that
there is an anonymous node that is just an escaped backslash (it thinks
the backslash escapes the quote, when really it is just an escaped
backslash itself. See the added test case for an example of this).

This commit ensures the node identification logic keeps track of the
number of backslashes seen so it can accurately determine if the
quotation is escaped or not.
2024-11-15 23:49:06 -05:00
crvdgc 15c2957993 fix(xtask): bring back language and example filter 2024-11-12 19:09:49 -05:00
Will Lillis 5d1be545c4
fix(lib): correct next sibling of zero width node 2024-11-12 18:17:45 -05:00
Amaan Qureshi d73b66cbbc fix(cmake): use current source dir for EXISTS check 2024-11-10 04:00:32 +01:00
Amaan Qureshi ac4595e808 feat(node): update bindings when necessary 2024-11-10 03:55:58 +01:00
Amaan Qureshi 134233f33a feat(node): support single-file executables via bun build --compile 2024-11-10 03:47:32 +01:00
WillLillis 05b6871a02 feat(loader): support multi-barreled file extensions 2024-11-10 03:44:33 +01:00
ObserverOfTime 1d5502d7b2 chore(bindings): update go binding version 2024-11-09 21:03:38 +01:00
ObserverOfTime 2d5a4b6bd6 chore(bindings): include tree-sitter.json file 2024-11-09 21:03:38 +01:00
ObserverOfTime 8588c96691 fix(bindings): fix scanner check in binding.gyp
Some checks failed
CI / sanitize (push) Failing after 14s
CI / build (push) Failing after 14s
Check Bindgen Output / check-bindgen (push) Has been cancelled
CI / checks (push) Has been cancelled
Use `fs.existsSync` rather than `fs.exists`
2024-11-03 06:02:39 -05:00
ObserverOfTime 66a1bc50fa fix(bindings): update CMakeLists.txt file
Some checks failed
Check Bindgen Output / check-bindgen (push) Waiting to run
CI / checks (push) Waiting to run
CI / sanitize (push) Failing after 13s
CI / build (push) Failing after 14s
2024-11-02 13:17:11 -04:00
Amaan Qureshi 310a9f0704 fix: disallow tokens that match the empty string 2024-11-02 03:36:11 -04:00
WillLillis 5b5cf5a5e5 fix(lib): check point, byte ranges in ts_query_cursor_set
range functions
2024-11-02 03:06:07 -04:00
ObserverOfTime 02ff0af69c build(bindings): rename cmake test target
Some checks failed
Check Bindgen Output / check-bindgen (push) Waiting to run
CI / checks (push) Waiting to run
CI / sanitize (push) Failing after 14s
CI / build (push) Failing after 14s
CTest creates a test target which breaks the build when the parser is
included via FetchContent in a CMake project that uses CTest
2024-10-31 23:12:28 -04:00
Amaan Qureshi 500f4326d5 feat: add the ability to specify a custom decode function 2024-10-31 22:51:40 -04:00
Amaan Qureshi e27160b118 feat(rust): remove usage of deprecated functions 2024-10-31 21:58:35 -04:00
Sam Estep f3f7230ee3
fix(cli): pass all fields to tree-sitter.json in init 2024-10-30 17:09:21 -04:00
Amaan Qureshi 350fff24bf fix(lib): simplify edge cases with zero-width tokens
Some checks failed
CI / sanitize (push) Failing after 13s
CI / build (push) Failing after 13s
CI / checks (push) Has been cancelled
2024-10-28 13:57:29 +00:00
ObserverOfTime 3661689389 feat(bindings): drop language name from node
Some checks failed
CI / checks (push) Waiting to run
CI / sanitize (push) Failing after 12s
CI / build (push) Failing after 12s
2024-10-26 23:53:58 +00:00
Amaan Qureshi ce93d8fd9b feat!: bump internal abi to 15 2024-10-26 17:02:00 +00:00
ObserverOfTime d3a127a48f chore(bindings): more small changes
Some checks failed
CI / sanitize (push) Failing after 14s
CI / build (push) Failing after 14s
CI / checks (push) Has been cancelled
- Rename cmakelists.txt to cmakelists.cmake
- Bump node-addon-api version in package.json
- Remove License classifier from pyproject.toml
- Move require call to top level in Node.js test
2024-10-20 16:55:27 +00:00
ObserverOfTime f9a4e8ecdc fix(init): use current path if unspecified 2024-10-19 19:28:51 +00:00
ObserverOfTime 8681960fbc chore(bindings): correct editorconfig indent size 2024-10-19 18:31:46 +00:00