Commit graph

1062 commits

Author SHA1 Message Date
Max Brunsfeld
ac29eab5f9 Remove tests for LookaheadIterator compilation failures
These add noise when running tests. Let's not add unit tests for
compilation failurs.
2023-11-27 10:32:25 -08:00
Amaan Qureshi
0ff28346be
Merge pull request #2714 from MrPrezident/test_point_range_captures_fix
fix "test_point_range_captures not working"
2023-11-12 21:09:09 -08:00
MrPrezident
3c4957e940 fix "test_point_range_captures not working"
Fix for https://github.com/tree-sitter/py-tree-sitter/issues/105
2023-11-12 20:58:51 -06:00
Daumantas Kavolis
e26e23fd0e
Fix formatting 2023-10-25 10:24:35 +03:00
Daumantas Kavolis
e265929f90
Fix goto_previous_sibling with padded first children 2023-10-25 10:19:03 +03:00
Andrew Hlynskyi
a5a7564818 chore(rust): add error reporting for position funcs 2023-10-05 17:24:01 +03:00
Andrew Hlynskyi
c63f1680ad chore(rust): improve perf for position funcs 2023-10-05 17:24:01 +03:00
Andrew Hlynskyi
d95836eb35 cicd: add en extra check for non matchable skips 2023-10-05 14:39:36 +03:00
Andrew Hlynskyi
82ddb3ddcc cicd: add skips for fragile corpus tests 2023-10-05 07:59:35 +03:00
Amaan Qureshi
cc66895343
perf: cache the current language configuration to lookup later on 2023-09-21 00:52:50 -04:00
Amaan Qureshi
ef9cabd4b5
fix: update javascript tests and use cpp/javascript master for fixtures 2023-09-20 11:31:53 -04:00
Andrew Hlynskyi
524bf7e2c6
Merge pull request #2607 from ahlinc/fix-zero-deallocs
fix: `dealloc` calls on zero pointers
2023-09-03 09:45:52 +03:00
Andrew Hlynskyi
9cc1daafca chore(ffi): remove enum name prefixes from all C enum values 2023-09-03 07:38:27 +03:00
Andrew Hlynskyi
7f7084c2cb chore(test): panic on zero pointer deallocs for alloc tracked scopes 2023-09-03 07:12:11 +03:00
Andrew Hlynskyi
67a5dbdd93 fix: dealloc calls on zero pointers 2023-09-03 06:53:18 +03:00
Andrew Hlynskyi
08ac19086b chore: simplify test case after query state improvements 2023-09-02 23:12:28 +03:00
Andrew Hlynskyi
52f7eaff31 chore(rust): make Query extra predicates state fully immutable 2023-09-02 23:12:28 +03:00
Amaan Qureshi
dc5ec1cf53
refactor: remove &Option<T> where used 2023-09-01 17:23:39 -04:00
Amaan Qureshi
c5cb27e522
docs: improve predicate docs 2023-08-31 16:01:37 -04:00
Amaan Qureshi
09ac28c77d
feat!: properly handle predicates used on quantified captures 2023-08-31 16:01:36 -04:00
Andrew Hlynskyi
756e51867d doc: fix cargo doc warnings 2023-08-28 23:09:37 +03:00
Andrew Hlynskyi
0862921537 doc: Include README as top-level module documentation for all crates 2023-08-28 23:09:37 +03:00
Andrew Hlynskyi
cbce87dab1 chore: add an extra notes for hang tests 2023-08-28 14:16:36 +03:00
Andrew Hlynskyi
a9c4965dd6 cicd: exclude hang tests for exotic arches and ASAN 2023-08-28 05:39:57 +03:00
Andrew Hlynskyi
b205a1f5a2 Run parser hang test in a killable subprocess 2023-08-27 21:00:26 +03: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
Andrew Hlynskyi
60779cc1ac fix(gen): parser.c should include parser.h relatively 2023-08-26 20:57:08 +03:00
Amaan Qureshi
6d41d99990
Merge pull request #2559 from amaanq/silent-ignore-u
fix: ignore regex u flag
2023-08-25 19:25:15 -04:00
Amaan Qureshi
6969766664 fix: ignore regex u flag
It's needed for certain regex patterns in JS, and we can just silently ignore it.
2023-08-25 19:23:08 +03:00
Andrew Hlynskyi
b3fef28a10 chore(gen): add parser.c enum names to be better discoverable 2023-08-25 19:11:42 +03:00
Andrew Hlynskyi
fbfa58edc8 chore(gen): move external scanner stuff closer to the end of parser.c 2023-08-25 19:11:42 +03:00
Amaan Qureshi
1dbb986515 chore: add a test for an aliased anonymous symbol with flags 2023-08-23 16:55:12 +03:00
Andrew Hlynskyi
683fe442e4 fix(gen): cycle between aliases and anonymous symbols
An example of an error cycle in a `parser.c`:

```
static const TSSymbol ts_symbol_map[] = {
  ...
  [anon_sym_RBRACE] = anon_sym_RBRACE2,
  [anon_sym_RBRACE2] = anon_sym_RBRACE,
  ...
};
```
2023-08-23 16:51:05 +03:00
Amaan Qureshi
e3a5863287
feat: add @injection.parent to inject an injection's node with the parent language 2023-08-21 01:08:17 -04:00
Andrew Hlynskyi
ffae7d6115 fix: mark helper Rust funcs that receive raw pointers as unsafe 2023-08-20 02:12:51 +03:00
Amaan Qureshi
ac579be788
fix(safety): mark functions that potentially deref a raw pointer as unsafe 2023-08-19 18:59:11 -04:00
Amaan Qureshi
c37dd2458b
Merge pull request #2529 from amaanq/injection-self
feat: add `injection.self` to inject a node with itself
2023-08-19 12:43:10 -04:00
Andrew Hlynskyi
59b8eaf911 rust: pin serde version on 1.0.171 due to serde-rs/serde#2538 2023-08-19 16:15:47 +03:00
Amaan Qureshi
45313e0dfb
feat: add injection.self to inject a node with itself 2023-08-18 18:37:57 -04:00
Amaan Qureshi
ce4a9ef4de
feat: allow specifying an input query-paths argument 2023-08-17 22:21:20 -04:00
Amaan Qureshi
9971e5d5f5
feat: allow specifying an input captures-path argument 2023-08-17 22:20:57 -04:00
Amaan Qureshi
458b5de0fc
feat: add any-of predicate 2023-08-17 22:20:57 -04:00
Amaan Qureshi
8eb92d1c64
feat: add an --apply-all-captures argument to highlight & test 2023-08-17 22:20:57 -04:00
Andrew Hlynskyi
6616d7deeb Change edit dumps format and add indexes for all corpus tests
The new dumped edits format is `edit.<SEED>.<TEST_INDEX>.<SEED_INDEX>.<TEST_NAME>`

To cleanup edits:
- Instead of the standard:
    > rm target/scratch/edit.*

- Use the following shell command:
    > find target/scratch/ -name 'edit.*' -delete
2023-08-18 00:02:21 +03:00
Andrew Hlynskyi
caaa533b8d test: add TREE_SITTER_DUMP_EDITS env var to dump corpus edits
It dumps edits to the `target/scratch` folder in a format like `<SEED>.edit`
2023-08-17 20:55:28 +03:00
Andrew Hlynskyi
0dd85c8452 Add TREE_SITTER_GRAMMAR_DEBUG env var to use debug grammars in tests 2023-08-17 18:16:41 +03:00
Amaan Qureshi
e0434327d0
fix(render): only output SPACE for strings that are just a space 2023-08-16 13:44:44 -04:00
Amaan Qureshi
28b831456e
Merge pull request #2500 from amaanq/dsl-update
feat: improve dsl definitions
2023-08-16 02:58:41 -04:00
Amaan Qureshi
c008005f9a
feat: improve dsl definitions 2023-08-16 02:24:33 -04:00
Amaan Qureshi
ece1060d2c
feat: warn users when using non-static functions that aren't needed for tree-sitter 2023-08-16 01:59:03 -04:00