Commit Graph

6693 Commits (f00b921de528b3455733598f8a796c5475a985ef)
 

Author SHA1 Message Date
Wilfred Hughes 6ac01365c6 Update changelog for build fix 2021-09-26 21:21:02 +07:00
Benjamin Bannier 457b63c758 Fix building of e.g., vendor/tree-sitter-haskell-src/scanner.cc
At least this parser uses C++11 (lambda expressions) and C++14 features
(lambda `auto` parameter types). Since the default C++ standard of
compilers can vary, this patch explicitly sets C++14 mode when building
any vendored C++ files.
2021-09-26 19:10:09 +07:00
Wilfred Hughes e214b818de Factor out a helper function for diffing single files 2021-09-26 12:02:48 +07:00
Wilfred Hughes 22febe6736 Documenting mercurial support 2021-09-26 11:50:26 +07:00
Wilfred Hughes 4e09fd0507 Match delimiters when converting from tree-sitter to syntax
Previously, we only handled simple cases like `(x)` where the first
and last token were the delimiter tokens. We now allow arbitrary
tokens before and after the delimiter, and wrap them in an additional
list.

This was more common in the C family parsers, but it's a general
problem. It also helps with robustness of JSX/TSX delimiter parsing of
`<`, where we now require a close `>` at the same level.
2021-09-25 22:25:05 +07:00
Wilfred Hughes df1754931b Polish readme and add more screenshots 2021-09-25 00:15:30 +07:00
Wilfred Hughes 0828089e69 Link to the source code in the introduction 2021-09-24 23:44:32 +07:00
Wilfred Hughes 48efe9d7c4 Roll version 2021-09-24 23:40:07 +07:00
Wilfred Hughes c9f85d806e Document the main tricky cases with tree diffs 2021-09-24 23:33:25 +07:00
Andrew Helwer fcb189661c
Fixed CRLF behavior for tests (#188)
* Fixed CRLF behavior for tests

* Add windows tests to CI

* Removed comment about windows tests from CI file

* Run tests on PRs

* Use windows test script in CI
2021-09-24 23:22:28 +07:00
Wilfred Hughes 3d12e56e0f Store parent node in SyntaxInfo 2021-09-23 23:16:38 +07:00
Wilfred Hughes bc4f54da65 Set benchmark path to keep `cargo package` happy 2021-09-22 22:40:53 +07:00
Wilfred Hughes 3b36e6486d Add C# support
Closes #37.
2021-09-22 22:37:53 +07:00
Wilfred Hughes 806f925948 Add 'vendor/tree-sitter-c-sharp/' from commit '4a3d9677f86aab13b7e721df22e12004416e2539'
git-subtree-dir: vendor/tree-sitter-c-sharp
git-subtree-mainline: 5991efdcc7
git-subtree-split: 4a3d9677f8
2021-09-22 22:12:22 +07:00
Wilfred Hughes 5991efdcc7 Build tree-sitter parsers in parallel 2021-09-22 22:02:07 +07:00
Wilfred Hughes 05d0234061 Add symlink needed for Haskell build 2021-09-22 20:54:51 +07:00
Wilfred Hughes f6ada434fe Add Haskell support
Fixes #36
2021-09-22 10:18:48 +07:00
Wilfred Hughes 016d2b8be2 Add 'vendor/tree-sitter-haskell/' from commit 'bf7d643b494b7c7eed909ed7fbd8447231152cb0'
git-subtree-dir: vendor/tree-sitter-haskell
git-subtree-mainline: f7042660c0
git-subtree-split: bf7d643b49
2021-09-22 09:50:50 +07:00
Martin Midtgaard 4a3d9677f8
Fixes precedence between is and as (#209)
* Fixes precedence between is and as

'is' has higher precedence than 'as'. To get the test case to parse I also had to restrict the types of expressions that can be 'constant_pattern'.

* is and as has same precedence

Better understanding of is and as precedence. They have same precedence, but are left associative. The also have the same precedence as relative operators and not the same as equallity operators.

* Added more expressions to constant_pattern

nameof and some casts are allowed in constant expressions.

* Changed nullable_type to not be able to contain it self

This was to avoid precedence problems when parsing things like "int? ?".
2021-09-22 15:55:25 +07:00
Wilfred Hughes f7042660c0 Log hashmap key size too 2021-09-22 00:39:48 +07:00
Wilfred Hughes 53f4df2697 Reduce the memory size of Edge values
This doesn't significantly impact runtime, but reduces peak memory by ~15%.
2021-09-22 00:36:02 +07:00
Wilfred Hughes ce23114634 Reduce integer size for syntax node IDs and counts
It's reasonable to assume that we won't have more than 4 billion
syntax nodes in a single file.
2021-09-22 00:28:08 +07:00
Wilfred Hughes 9675b0c6bd Log hashmap size per value 2021-09-22 00:18:09 +07:00
Wilfred Hughes 09ddf04f71 Store a content ID on syntax nodes to optimise content equality
This saves a few percent at runtime.
2021-09-21 23:57:51 +07:00
Wilfred Hughes cf926eca1a Provide a single API for initialising SyntaxInfo 2021-09-21 22:48:18 +07:00
Wilfred Hughes 72718d0502 Correct docstring now unique ID uses mutable IDs for initialisation 2021-09-21 22:46:09 +07:00
Wilfred Hughes 60150a3826 Make change private on SyntaxInfo 2021-09-21 22:42:24 +07:00
Wilfred Hughes 9b87c2fd59 Ensure unique_id values are always sequential
Previously we'd sometimes have gaps. This approach is also more
concise, rather than passing the next ID through everywhere.
2021-09-21 22:36:38 +07:00
Wilfred Hughes 8e47590ff7 Use unique_id on syntax nodes for hashing 2021-09-21 22:32:40 +07:00
Martin Jambon c7dd61284a
Merge pull request #202 from Luni-4/update-0.20
0.20
2021-09-20 18:02:51 +07:00
fn ⌃ ⌥ 08f70a92f5
Fix rest pattern with assignment expression (#197)
* Fix rest pattern with assignment expression

* Regenerate files
2021-09-20 12:40:57 +07:00
fn ⌃ ⌥ 166ead4de9
Fix error on array destructuring that includes property access (#187)
* Fix error on array destructuring that includes property access

* Regenerate files
2021-09-20 10:57:38 +07:00
Martin Midtgaard 33584d9d4b
Added support for extended property patterns (#212)
subpatterns now use expression_colon instead of name_colon. This alligns with how it is parsed in Roslyn, but resulted in me adding another conflict to the grammar.
2021-09-20 11:57:04 +07:00
Wilfred Hughes 4ba8508581 Add sample files showing a syntax error 2021-09-20 00:25:59 +07:00
Wilfred Hughes a3880cbaa9 Make SyntaxInfo fields private where possible 2021-09-20 00:09:22 +07:00
Wilfred Hughes 53569ae087 Use Syntax::new_atom consistently in Dijkstra tests 2021-09-20 00:02:41 +07:00
Wilfred Hughes a0388c7d8b Optimise equal_content by checking num_descendants first
Traversing children is costly so we avoid it where possible. This
saves a further ~5% runtime on slow_before.rs/slow_after.rs.
2021-09-19 23:57:14 +07:00
Wilfred Hughes 0d5e7279a6 Use a preallocated buffer for computing neighbours
Calculating neighbours is pretty hot, so this saves ~10% runtime on
slow_before/slow_after.rs.
2021-09-19 23:43:31 +07:00
Wilfred Hughes 8baa083fbf Make debug symbols explicit for release, for easy toggling 2021-09-19 22:47:58 +07:00
Wilfred Hughes 74def3e394 Tweak wording in diff description
Clarify grpah choices, and use 'graph vertex' and 'syntax node'
consistently to avoid confusion.
2021-09-19 22:44:46 +07:00
Wilfred Hughes c93d53af98 Discussing the major alternative projects doing tree diffing 2021-09-19 22:14:41 +07:00
Wilfred Hughes 740916d084 Separate and expand Upstream Parsers in manual 2021-09-19 14:28:05 +07:00
Wilfred Hughes d7b0c917c1 Remove regex parser 2021-09-19 12:17:25 +07:00
Wilfred Hughes 0f27c97865 Add robots.txt to manual 2021-09-19 12:08:55 +07:00
Wilfred Hughes b93f14c389 Tweak loop to be an expression 2021-09-18 11:21:04 +07:00
Wilfred Hughes 24b2121ea2 Ignore unused parameters in C++ vendored code
This is occurring in tree-sitter-cpp-src/scanner.cc. It would be
better to follow-up and upstream a fix for this.
2021-09-17 22:57:06 +07:00
Wilfred Hughes 6c08507b0d Add C++ support 2021-09-17 22:37:41 +07:00
Wilfred Hughes 3068ad64a9 Add 'vendor/tree-sitter-cpp/' from commit '9a3f2509fe5ba5a0310b5ec5aa1a7f0b595520a9'
git-subtree-dir: vendor/tree-sitter-cpp
git-subtree-mainline: 3d5bd4069f
git-subtree-split: 9a3f2509fe
2021-09-17 22:12:45 +07:00
Wilfred Hughes 3d5bd4069f Fix typo 2021-09-17 22:11:56 +07:00
jdrouhard 9a3f2509fe
Merge pull request #120 from ecnerwala/subscript-brace-list
Add support for initializer lists in subscript operator
2021-09-17 11:11:37 +07:00