Commit graph

6118 commits

Author SHA1 Message Date
Alex Pinkus
679a841183 Add pointer indirection to AnalysisStateSet
Profiling the `ts_query__analyze_patterns` function shows that it
spends a lot of time copying items in its various state sets. These
state sets are kept sorted, and the items are fairly large, so any time
that we insert new entries near the front of the array, a lot of calls
to memcpy must occur.

In advance of more sophisticated rework, one easy win is to hide the
large `AnalysisStateSet` objects behind pointers, so that the size of
each item in the list goes from 68 to 8 bytes, and add an object pool to
reuse allocations. This shows a significant performance improvement for
grammars that have a lot of states in them.
2022-01-10 20:07:14 -08:00
Andrew Helwer
80c34d62ab Fixed rust build, updated docs 2022-01-07 10:36:25 -05:00
Andrew Helwer
3ab6d1b937 Improve diff further 2022-01-07 10:17:53 -05:00
Andrew Helwer
bfb692d2f7 Improve diff 2022-01-07 10:16:20 -05:00
Andrew Helwer
ace81f6267 Don't log when counting codepoints 2022-01-07 10:13:57 -05:00
Andrew Helwer
0a52e90b01 Fixed pointer type 2022-01-07 10:13:57 -05:00
Andrew Helwer
75aa295b66 get_column now counts codepoints 2022-01-07 10:13:57 -05:00
Max Brunsfeld
e81976d27a
Merge pull request #1570 from hickford/patch-1
Add link to Protocol Buffers grammar
2022-01-03 09:41:21 -08:00
Max Brunsfeld
b2fe125213
Merge pull request #1571 from 414owen/add-realloc-to-wasm-exports
Add realloc to wasm exports
2022-01-03 09:01:13 -08:00
Owen Shepherd
1aa6541476
Add realloc to wasm exports 2022-01-03 16:07:39 +00:00
M Hickford
4c6175b70a
Add link to Protocol Buffers grammar 2022-01-02 21:18:12 +00:00
James McCoy
8e698371a2
config: Bump minimum serde_json version to 1.0.45
This is the version which introduced Map's append function, used in
Config::add.
2022-01-01 23:27:42 -05:00
Max Brunsfeld
4ee52ee99e 0.20.2 2021-12-31 17:23:08 -08:00
Max Brunsfeld
5d8a1ace56 web: 0.20.2 2021-12-30 17:14:04 -08:00
Max Brunsfeld
f010781efa lib: 0.20.2 2021-12-30 16:35:21 -08:00
Max Brunsfeld
3b7c4e62d2 🎨 subtree.h 2021-12-30 16:33:26 -08:00
Max Brunsfeld
8df0b8de7e Convert more fixture grammars from JSON to JS 2021-12-30 16:27:02 -08:00
Max Brunsfeld
622359b400 Simplify allocation-recording in test suite using new ts_set_allocator API 2021-12-30 16:09:07 -08:00
Max Brunsfeld
e01ea9ff51
Merge pull request #1544 from mkvoya/dynamic-allocator
Allow to change the allocator dynamically
2021-12-28 13:39:11 -08:00
Max Brunsfeld
0a85746cc4
Merge pull request #1473 from thestr4ng3r/big-endian
Make SubtreeInlineData work on Big-Endian
2021-12-26 21:03:26 -08:00
Florian Märkl
d5d99e0bfb Address feedback 2021-12-24 17:07:32 +01:00
Florian Märkl
2024f27534 Make SubtreeInlineData work on Big-Endian 2021-12-24 16:47:10 +01:00
Mingkai Dong
8e4d4ef8b9 Replace allocator struct with function pointers 2021-12-24 09:28:23 +08:00
Max Brunsfeld
1d77b9ea47 cli: Fix parsing of test files with newlines in test names
Fixes #1527
2021-12-23 14:14:27 -08:00
Max Brunsfeld
ddeaa0c7f5
Merge pull request #1483 from furunkel/patch-1
Don't use zero maxlen for snprintf in ts_subtree__write_to_string
2021-12-23 10:52:20 -08:00
Michael Davis
e7f0cc4e24
add python test case for tag testing 2021-12-18 11:07:46 -06:00
Michael Davis
dba7a13808
refactor out get_tag_positions helper function 2021-12-18 11:07:42 -06:00
Michael Davis
47dc88b647
add tags config fixture test helper 2021-12-18 11:07:18 -06:00
Michael Davis
067f742ad3
run test_tag in 'tree-sitter test' when tags test dir exists 2021-12-18 11:07:18 -06:00
Michael Davis
7df82c825f
add module for testing tags 2021-12-18 11:07:11 -06:00
Michael Davis
26899f7246
add getter for TagsContext parser 2021-12-18 09:44:05 -06:00
Mingkai Dong
486ea2569d Avoid allocator from being switched more than once 2021-12-18 16:45:18 +08:00
Mingkai Dong
b9b051e933 Remove ts_allocator from api.h
Since we have exposed the function to set allocator, we don't need to
expose the global variable in `api.h`.
2021-12-18 11:26:37 +08:00
Mingkai Dong
578bf74bf3 Add TSAllocator and ts_set_allocator in api.h 2021-12-18 09:53:58 +08:00
Mingkai Dong
b516f96f37 Fix declaration of ts_toggle_allocation_recording 2021-12-18 00:33:49 +08:00
Mingkai Dong
e742186c25 Allow to change the allocator dynamically 2021-12-17 20:16:20 +08:00
Patrick Thomson
7bac34c925
Merge pull request #1539 from tree-sitter/tag-modules
Support @module as a highlight key.
2021-12-16 10:56:05 -05:00
Patrick Thomson
f5d1c0b860 Support @module as a highlight key.
Some languages have the notion of modules, and to represent those
we've started to use a `@module` tag, as discussed in
https://github.com/elixir-lang/tree-sitter-elixir/issues/15.
Because historically we've used the constructor highlight color for
modules in JS/Ruby, it's defined to map to the same color.
2021-12-15 17:33:57 -05:00
Max Brunsfeld
8bbf75a067
Merge pull request #1538 from rski/master
fix crash on empty sexp in test, ()
2021-12-15 11:59:30 -08:00
Romanos Skiadas
4784ecaf0a fix crash on empty sexp in test, ()
Now this no longer crashes:

=====
a test
=====
-----
()

...

tree-sitter test:

1 failure:

expected / actual

  1. a test:

    (source_file)

    ()

fixes #1537
2021-12-15 19:10:26 +02:00
Max Brunsfeld
836d753c73 Fix include_bytes error when building cli outside of source tree
Refs #1523
2021-12-13 14:22:33 -08:00
Max Brunsfeld
2032133f8a
Merge pull request #1532 from oxisto/patch-1
Added bindings for Java and Kotlin to `index.md`
2021-12-13 13:23:27 -08:00
Max Brunsfeld
f8583f50a5
Merge pull request #1534 from maco/add_elixir
add link to in-development Elixir parser
2021-12-13 10:31:17 -08:00
Mackenzie Morgan
4238c6c7dc add link to in-development Elixir parser 2021-12-13 13:25:17 -05:00
Christian Banse
0a1dbdd340
Added bindings for Java and Kotlin to index.md 2021-12-11 13:26:06 +01:00
Max Brunsfeld
b9b77f4375 tags: Remove unused field 2021-12-09 22:39:27 -08:00
Max Brunsfeld
25f64e1eb6 Place tighter limits on the work done during query analysis 2021-12-09 22:18:21 -08:00
Max Brunsfeld
8de8c64c95 Remove unnecessary types from binding.rs 2021-12-09 21:02:15 -08:00
Max Brunsfeld
9f535f95bd Always include playground.html in the CLI binary
Fixes #1523
2021-12-06 16:52:14 -08:00
Max Brunsfeld
65746afeff playground: Make query error underlines render in safari 2021-11-22 16:04:45 -08:00