Commit graph

3990 commits

Author SHA1 Message Date
Nicholas Yang
8131e7635e Added documentation on web-tree-sitter edge cases 2022-08-21 17:55:04 -04:00
Max Brunsfeld
a882d0b036
Merge pull request #1836 from nmote/extra-alias
Avoid extracting default alias for extras
2022-08-13 21:10:34 -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
Max Brunsfeld
3739b7794e
Merge pull request #1819 from slackner/uint16-production-id
query: Use uint16_t for production_id in AnalysisSubgraphNode struct
2022-07-26 14:01:22 -07:00
Sebastian Lackner
2174288e30 query: Use uint16_t for production_id in AnalysisSubgraphNode struct 2022-07-26 21:50:38 +02:00
Max Brunsfeld
1f1b1eb450
Merge pull request #1797 from tree-sitter/sibling-patterns-inside-errors
Fix performance pitfall when matching "non-rooted" patterns in the presence of errors
2022-07-08 08:46:33 -07:00
Max Brunsfeld
79eaa68793 Don't match nested wildcard patterns against error nodes 2022-07-07 18:11:52 -07:00
Max Brunsfeld
254edb0ec8 Include captured summary information in stack debug graphs 2022-07-07 17:53:54 -07:00
Max Brunsfeld
548c12fb88 Fix bug where patterns with top-level alternatives were not considered 'rooted' 2022-07-07 17:53:54 -07:00
Max Brunsfeld
1401767689 query: Don't attempt to match top-level sibling patterns directly in ERROR nodes
Co-authored-by: Keith Simmons <keith@zed.dev>
2022-07-07 15:27:00 -07:00
Max Brunsfeld
01df16ca9f lib: 0.20.8 2022-06-27 15:07:40 -07:00
Max Brunsfeld
b37f915520
Merge pull request #1783 from tree-sitter/empty-external-tokens-after-errors
Allow empty external tokens during error recovery, if they change the scanner's state
2022-06-25 17:31:35 -07:00
Max Brunsfeld
8b5ff2ec8f Loosen randomized changed range assertions on newline characters
For now, don't error if the scope changes for a newline character.
2022-06-25 17:13:46 -07:00
Max Brunsfeld
3ac36b0cbe Handle backslashes in token names when printing DOT debug graphs 2022-06-25 17:13:11 -07:00
Max Brunsfeld
04381dcea3 Add more python error recovery tests 2022-06-24 19:07:40 -07:00
Max Brunsfeld
5aa2f4dc8c Log when ignoring an empty external token after an error 2022-06-24 19:07:27 -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
c0e1991f6b 🎨 ts_parser__lex 2022-06-24 14:24:21 -07:00
Max Brunsfeld
ca902065cb Fix bug when stack versions merge after reducing a non-terminal extra 2022-06-24 14:24:21 -07:00
Max Brunsfeld
be463c7789 Update test script with flags for new randomized test options 2022-06-24 14:24:21 -07:00
Max Brunsfeld
db91399ea7 lib: 0.20.7 2022-06-22 16:03:21 -07:00
Max Brunsfeld
58b719541b Fix failure to match queries with wildcard at root with range restrictions 2022-06-22 15:54:06 -07:00
Max Brunsfeld
46a2a5933f
Merge pull request #1748 from jamessan/cli-min-ts-ver
cli: Bump tree-sitter dependency to 0.20.3
2022-06-04 13:35:57 -07:00
Max Brunsfeld
efe009f47d
Merge pull request #1759 from rhysd/doc-alias
Add C API names as document aliases in Rust docs
2022-05-31 14:45:18 -07:00
Max Brunsfeld
1c9d2c5bb0
Merge pull request #1763 from rhysd/fix-doc-warning
cli: fix warnings from `cargo doc`
2022-05-31 14:44:29 -07:00
rhysd
21c6cd8c22 cli: fix warnings from cargo doc 2022-05-31 10:59:30 +09:00
rhysd
08899428f3 Add C APIs as document aliases 2022-05-30 21:36:11 +09:00
James McCoy
d11841f6ba
cli: Bump tree-sitter dependency to 0.20.3
tree-sitter/tree-sitter#1504 added the capture_quantifiers API and its
usage in tree-sitter-cli, so the version should express the dependency.
2022-05-17 11:07:55 -04:00
Max Brunsfeld
b729029a40
Merge pull request #1747 from Cycatz/master
Add link to Org language parser
2022-05-16 09:51:42 -07:00
Cycatz
369c88713c
Add link to Org language parser 2022-05-16 15:58:33 +00:00
Max Brunsfeld
6192d29610
Merge pull request #1738 from rhysd/patch-2
Add link to JSON parser in document
2022-05-03 10:30:11 -07:00
Linda_pp
d9365a8fd6
Add link to JSON parser in document 2022-05-04 00:01:02 +09:00
Max Brunsfeld
cfbafabe6f
Merge pull request #1643 from fengT-T/master
Fix: Set https proxy for npm cli install script
2022-04-26 09:54:04 -07:00
Max Brunsfeld
465ceead0f
Merge pull request #1677 from siegel/master
Fixed warning/error when compiling with `clang -Os`.
2022-04-03 15:30:06 -07:00
Max Brunsfeld
bd3d84162f
Merge pull request #1692 from alebastr/alt-arch-fixes
Fix build and tests on alternative architectures
2022-04-03 15:29:12 -07:00
Aleksei Bavshin
fe33599f46
lib: fix incorrect int ptr cast on big-endian architectures
`*usize` -> `*u32` conversion on 64-bit big-endian machine takes high
halfword of the value. As a consequence, any result returned via
`count` is unexpectedly shifted left:

    u32   = 00 00 00 01             // 1
    usize = 00 00 00 01 00 00 00 00 // 4294967296

Fixes following test failure:
```
$ cargo test -- tests::corpus_test
<...>
running 13 tests
memory allocation of 206158430208 bytes failed
error: test failed, to rerun pass '--lib'
```
2022-03-23 00:47:01 -07:00
Aleksei Bavshin
cdf2ecd176
tags: fix incorrect uses of i8 instead of c_char
Fixes build on aarch64, ppc64le and other platforms that have c_char
defined as u8.
2022-03-23 00:01:51 -07:00
Aleksei Bavshin
b27b4665ac
test: fix incorrect uses of i8 instead of c_char
Fixes build on aarch64, ppc64le and other platforms that have c_char
defined as u8.
2022-03-23 00:00:26 -07:00
Rich Siegel
150eb2966b Fixed warning/error when compiling with clang -Os.
DISCUSSION:

When compiling with `-Os` for "smallest, fastest", an error is reported in `parser.c`:

```
/Users/siegel/git/tree-sitter/lib/src/./parser.c:1368:10: error: unused variable 'did_merge' [-Werror,-Wunused-variable]
    bool did_merge = ts_stack_merge(self->stack, version, previous_version_count);
         ^
1 error generated.
```

This is because with `NDEBUG` set,  `assert(e)` collapses to `(void)0`,
which in turn means that `did_merge` does not actually get consumed.
This seems to get caught when compiling with `-Os`, but not otherwise.

Compiler version:
```
Apple clang version 13.0.0 (clang-1300.0.29.30)
Target: arm64-apple-darwin21.3.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
```
2022-03-04 18:00:16 -05:00
Max Brunsfeld
ccd6bf554d 0.20.6 2022-03-02 20:50:52 -08:00
Max Brunsfeld
1b2e90f647 libs: 0.20.6 2022-03-02 20:50:29 -08:00
Max Brunsfeld
8decec3774 Properly incorporate lookahead bytes when recovering via missing token 2022-03-02 17:12:25 -08:00
Max Brunsfeld
7170ec7c96 Improve randomized testing setup
* Allow iterations to be specified via an env var
* Randomly decide the edit count, with a maximum
  specified via an env var.
* Instead of separate env vars for starting seed + trial, just accept a seed
* Remove some noisy output
2022-03-02 17:12:25 -08:00
Max Brunsfeld
4bf5149a18 Run cargo test directly on CI 2022-03-02 17:12:25 -08:00
Max Brunsfeld
a6a102bec9 Set CLI as default workspace member 2022-03-02 16:36:14 -08:00
Max Brunsfeld
4b93326898 Don't generate primary states array if it will be unused due to abi version setting 2022-03-02 14:57:59 -08:00
Max Brunsfeld
621eb04cb1 tags: 0.20.2 2022-03-02 14:48:58 -08:00
Max Brunsfeld
09d08e8f8b 0.20.5 2022-03-02 14:43:53 -08:00
Max Brunsfeld
fcbef45899 libs: 0.20.5 2022-03-02 14:43:16 -08:00