Commit graph

115 commits

Author SHA1 Message Date
Will Lillis 027136c98a fix(generate): use correct state id when adding terminal states to
non terminal extras

(cherry picked from commit 5fd818babe)
2025-09-04 04:52:45 -04:00
Will Lillis 14c4d2f8ca fix(generate): return error when single state transitions have
indirectly recursive cycles.

This can cause infinite loops in the parser near EOF.

Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
(cherry picked from commit 310c0b86a7)
2025-09-04 01:47:36 -04:00
Amaan Qureshi 22fa144016 fix(lib): check if an ERROR node is named before assuming it's the builtin error node
(cherry picked from commit b7f36a13ba)
2025-08-28 23:53:00 +02:00
tree-sitter-ci-bot[bot] 75550c8e2c
Fix crash w/ goto_previous_sibling when parent node has leading extra child (#4472) (#4473)
* Fix crash w/ goto_previous_sibling when parent node has leading extra
child Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>



* Fix lint



---------


(cherry picked from commit f91255a201)

Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
2025-05-27 17:35:57 -07:00
tree-sitter-ci-bot[bot] 02625fc959
Ignore external tokens that are zero-length and extra (#4213) (#4216)
Co-authored-by: Anthony <anthony@zed.dev>
(cherry picked from commit dedcc5255a)

Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2025-02-17 17:38:13 -08: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 16s
platform
2025-01-11 17:52:54 -05:00
Amaan Qureshi 5a2c5ed865 docs: improve docs for contributing to docs 2025-01-10 22:57:54 -05:00
Amaan Qureshi 68e707eb4f feat: support passing in a Rust regex in the grammar dsl
Some checks failed
CI / checks (push) Waiting to run
CI / sanitize (push) Failing after 14s
CI / build (push) Failing after 16s
Deploy Docs / deploy-docs (push) Has been cancelled
2025-01-06 20:52:19 -05:00
Max Brunsfeld 201b41cf11
feat: add 'reserved word' construct
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-12-23 03:06:32 -05:00
Will Lillis 5d1be545c4
fix(lib): correct next sibling of zero width node 2024-11-12 18:17:45 -05:00
Amaan Qureshi 538a197976 fix(lib): correct unexpected side effect in get_column when the lexer is at EOF 2024-10-08 23:27:42 -04:00
Ron Panduwana a83b893016 fix: handle more cases of editing subtrees that depend on column values 2024-09-29 20:36:08 -04:00
Ron Panduwana 2bb20fe2fe
feat: allow external scanners to use the logger
Some checks failed
CI / checks (push) Waiting to run
CI / sanitize (push) Failing after 13s
CI / build (push) Failing after 13s
Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2024-08-17 14:46:28 -04:00
Amaan Qureshi 6e6dcf1caf test: modernize scanner files 2024-05-05 18:31:53 -04:00
Amaan Qureshi 627617edb4 refactor(tests): migrate remaining grammar.json tests to grammar.js 2024-04-29 00:01:35 -04:00
Amaan Qureshi 9f2dc9d6b5
fix: rework parser.h includes for test grammars and multi-grammar repos 2024-02-02 10:42:39 -05:00
Amaan Qureshi fadfa19be8
chore: update javascript error trees 2024-02-02 03:06:38 -05:00
Max Brunsfeld 360059eca1 Avoid a '../' #include in test scanner 2023-11-04 12:26:00 -07:00
Andrew Hlynskyi 5e62120050 chore: fix local fixture test for C language 2023-10-16 21:45:40 +03:00
Amaan Qureshi ef9cabd4b5
fix: update javascript tests and use cpp/javascript master for fixtures 2023-09-20 11:31:53 -04:00
Amaan Qureshi a4ea4737ac fix: do not increment current_included_range_index past included_range_count in __do_advance 2023-08-27 14:16:18 +03:00
Amaan Qureshi fc0e3a34ba
test: update C tests from upstream 2023-07-15 20:07:46 -04:00
Amaan Qureshi b192200008 fix: update tests from python grammar changes 2023-07-10 14:40:18 -04:00
Max Brunsfeld 6b16a9687b Tweak ruby error test to reflect slightly different recovery 2023-06-12 13:45:43 -07:00
Andrew Hlynskyi 85a588b5b0 Fix tests, adapt to tree-sitter-json 40a81c01a40ac48744e0c8ccabbaba1920441199 2023-04-22 12:08:50 +03:00
Max Brunsfeld 25d9c989eb Update python error corpus to reflect grammar changes 2023-03-13 14:25:24 -07:00
Max Brunsfeld 8e3dc7cd7a Add tests that randomly edit files with disjoint included ranges 2022-11-14 16:04:37 -08:00
Max Brunsfeld 6b87326470
Merge pull request #1787 from kianmeng/fix-typos
Fix typos
2022-08-25 10:25:39 -07:00
Nat Mote 4e3179fbc0
Avoid extracting default alias for extras
Fixes #1834
2022-08-10 07:27:34 -07:00
Nat Mote 0113bd28a4
Test for unused extra alias
Tests the issue described in #1834
2022-08-10 07:25:48 -07:00
Kian-Meng Ang b8552ec6c4 Fix typos 2022-06-28 19:57:42 +08:00
Max Brunsfeld 04381dcea3 Add more python error recovery tests 2022-06-24 19:07:40 -07:00
Max Brunsfeld d223a81b50 Allow empty external tokens during err recovery if they change the scanner's state 2022-06-24 15:58:13 -07:00
Max Brunsfeld 0fb864c1a0 Retain information about the lexer's lookahead for the token where an error was detected 2022-02-22 09:45:26 -08:00
Max Brunsfeld 584b55df8d Delete unused code, tweak whitespace 2022-01-19 16:54:57 -08:00
Andrew Helwer e1ee261181 Changed decimal unicode codepoint to hex 2022-01-11 19:15:36 -05:00
Andrew Helwer 69ff091a87 Added includes for macos 2022-01-11 12:31:41 -05:00
Andrew Helwer 5a6530a413 Added tests 2022-01-11 12:05:37 -05:00
Max Brunsfeld 8df0b8de7e Convert more fixture grammars from JSON to JS 2021-12-30 16:27:02 -08:00
Max Brunsfeld 52b4b65adc Convert more test grammars from JSON to JS 2021-11-19 10:35:53 -08:00
Max Brunsfeld d05c665863 Convert some of the fixture grammars from JSON to JS
These tests are easier to write and maintain if the grammars are just JS,
like grammars normally are. It doesn't slow the tests down significantly
to shell out to `node` for each of these grammars.
2021-10-22 18:47:23 -06:00
Andrew Helwer 0dc1bd806f Fixed some test failures due to CRLF line endings 2021-09-24 22:42:38 -04:00
FnControlOption e030434ca7 Handle aliases in unicode property escapes in regexes 2021-08-18 22:22:46 -07:00
Max Brunsfeld a40045a419 When editing, properly invalidate trees that depend on get_column 2021-03-11 14:46:13 -08:00
Max Brunsfeld e29d3714f7 Fix behavior of Lexer.get_column when at EOF 2021-03-11 12:11:33 -08:00
Max Brunsfeld dd4cba2625 Allow symbols to be used in precedence lists 2021-03-03 13:11:05 -08:00
Max Brunsfeld 344797c110 Implement named precedence comparison 2021-02-24 16:02:56 -08:00
Max Brunsfeld 9abad258c3 Expand tests for unicode property escapes 2021-02-17 13:29:30 -08:00
Max Brunsfeld e3ba701344 Start work on handling unicode property escapes in regexes 2021-01-29 16:37:45 -08:00
Max Brunsfeld 391fc8c340 Update unit tests to expect ruby grammar change 2020-12-20 19:34:45 -08:00