Commit graph

326 commits

Author SHA1 Message Date
Will Lillis
5fd818babe fix(generate): use correct state id when adding terminal states to
non terminal extras
2025-09-04 04:15:51 -04:00
Will Lillis
310c0b86a7 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>
2025-09-04 00:59:44 -04:00
Amaan Qureshi
6cb9486b28 test(fixtures): bump javascript grammar to 0.25.0 2025-09-04 00:59:01 -04:00
Will Lillis
62f93e221d feat(test): pin fixture grammars to specific commits 2025-08-31 01:05:42 -04:00
Amaan Qureshi
b7f36a13ba fix(lib): check if an ERROR node is named before assuming it's the builtin error node 2025-08-28 17:13:57 -04:00
Max Brunsfeld
f91255a201
Fix crash w/ goto_previous_sibling when parent node has leading extra child (#4472)
* Fix crash w/ goto_previous_sibling when parent node has leading extra
child Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>

Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>

* Fix lint

Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>

---------

Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
2025-05-27 16:56:33 -07:00
Max Brunsfeld
dedcc5255a
Ignore external tokens that are zero-length and extra (#4213)
Co-authored-by: Anthony <anthony@zed.dev>
2025-02-17 15:07:44 -08:00
WillLillis
dcfc95e563 fix(cli): only remove test input's trailing '\r' if running on windows
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 2025-01-06 20:52:19 -05:00
Max Brunsfeld
201b41cf11
feat: add 'reserved word' construct
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
Amaan Qureshi
cad2d03101 chore: remove unnecessary fuzz and profile helpers 2024-10-08 21:07:41 -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
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
dundargoc
bf9154febe docs: small fixes
Co-authored-by: Wang <bonede@qq.com>
Co-authored-by: Sebastiaan Speck <12570668+sebastiaanspeck@users.noreply.github.com>
2024-02-16 00:15:49 +01: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
f9e5696bcb
ci: rework fuzzer script 2023-07-24 00:44:44 -04:00
Amaan Qureshi
fc0e3a34ba
test: update C tests from upstream 2023-07-15 20:07:46 -04:00
Andrew Helwer
89edb2ddca
fix(fuzzer): only use rule strings for fuzz dictionary
The `find_literals` function can also pick up tokens in `precedences`
2023-07-10 19:12:24 -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