Commit graph

68 commits

Author SHA1 Message Date
Max Brunsfeld
f38f5d1d22 Tweak readmes 2020-05-12 16:16:48 -07:00
Max Brunsfeld
40262483a9 Change query syntax for predicates
Signed-off-by: Patrick Thomson <patrickt@github.com>
2020-05-11 12:35:51 -07:00
Max Brunsfeld
21175142af
Merge pull request #583 from tree-sitter/tags
Add a 'tags' crate, for computing ctags-style code navigation tags
2020-04-03 11:20:51 -07:00
Alberto González Palomo
bc0d53d4f0
Clarify where to put cc dependency for build script. (#586) 2020-03-30 09:43:41 -07:00
Max Brunsfeld
8eac81b8df Merge branch 'master' into tags 2020-03-25 12:49:15 -07:00
Max Brunsfeld
f453178ca2 rust: Remove unnecessary dependencies from core library 2020-03-16 14:46:05 -07:00
Luca Barbato
21de99de87
Remove non-building doctests (#578) 2020-03-16 14:35:27 -07:00
Max Brunsfeld
0457736766 rust: add handling of arbitrary predicate operators 2020-03-13 13:02:34 -07:00
Max Brunsfeld
90cacca040 rust: Simplify and generalize handling of set! and is? predicates 2020-03-10 10:42:22 -07:00
Max Brunsfeld
048b8c87a7
Merge pull request #561 from ubolonton/fix-out-of-bounds-access
Fix out-of-bounds array access in `Language` APIs
2020-02-27 09:27:18 -08:00
Tuấn-Anh Nguyễn
5f68fba61c Mark the return value of TreeCursor::field_name static 2020-02-27 22:36:13 +07:00
Tuấn-Anh Nguyễn
23261c4f6f Make ts_language_symbol_name return NULL for out-of-bound ids 2020-02-27 22:24:00 +07:00
Tuấn-Anh Nguyễn
c719e24a45 Make ts_language_field_name_for_id return NULL for out-of-bound id 2020-02-27 21:19:08 +07:00
Max Brunsfeld
33492ca9df query: Add not-eq? predicate in rust & wasm binding 2020-02-19 21:36:30 -08:00
Max Brunsfeld
b2e79f6438 rust: In queries, allow set! w/ capture and constant 2020-02-14 20:50:07 -08:00
Max Brunsfeld
56e52c76f9 rust: Add Hash for Point, Range and Node 2020-02-13 16:03:02 -08:00
Max Brunsfeld
631710bada Implement Default for Point, Eq for Node 2020-02-11 15:58:35 -08:00
Max Brunsfeld
a1c3de1b99 rust: Add Language::node_kind_is_visible API 2020-01-31 12:04:18 -08:00
Max Brunsfeld
64996976f4 rust: Add Language::id_for_node_kind method 2020-01-29 16:48:08 -08:00
Max Brunsfeld
e232ed04d1 Fix lifetimes on QueryCursor methods
Closes #530
2020-01-28 09:14:09 -08:00
Max Brunsfeld
7de36a33eb Remove halt_on_error API 2020-01-27 15:36:09 -08:00
Max Brunsfeld
9f63139a10 Fix error when set_included_ranges is called with an invalid range list 2020-01-17 10:31:28 -08:00
Max Brunsfeld
f3747863df Add ts_query_disable_pattern API 2020-01-15 17:08:55 -08:00
Tuấn-Anh Nguyễn
8e6220a0c5 Allow QueryCursor::matches' text_callback to return any AsRef<[u8]> (#488) 2019-11-17 10:40:06 -08:00
Max Brunsfeld
ce633a85c6 Improve ts_language_symbol_for_name function 2019-11-15 14:21:13 -08:00
Max Brunsfeld
b4a2f4ed60 Fix debug/release conditional compilation flags for free() 2019-11-15 10:09:22 -08:00
Max Brunsfeld
967da88371 Avoid unnecessary recompiles between debug & test builds
This makes development much quicker when switching back and forth
between compiling with RLS while editing and running tests with
`cargo test`.
2019-11-14 13:34:25 -08:00
Max Brunsfeld
1909ae2cee binding_rust: Improve node children APIs
Closes #480
2019-11-08 14:20:10 -08:00
Max Brunsfeld
c6d1bd2b04 Fix a few rustdoc links 2019-11-08 12:43:26 -08:00
Max Brunsfeld
d68dfa78b2 Add misssing docs to rust binding 2019-11-08 12:29:26 -08:00
Max Brunsfeld
a7824cf59d Fix docs for ts_node_is_extra
Fixes #446
2019-11-05 09:49:16 -08:00
Max Brunsfeld
e14e285a10 cli: Check queries when running tree-sitter test 2019-10-18 14:44:16 -07:00
Max Brunsfeld
b79295e1a0 🔥 Everything related to property sheets 2019-10-17 11:00:31 -07:00
Max Brunsfeld
324c259cbb rust: Create readable messages for query syntax errors 2019-10-14 12:30:22 -07:00
Max Brunsfeld
a45dc67390 Loosen unnecessary lifetime restriction in rust QueryCursor APIs 2019-10-14 12:30:22 -07:00
Max Brunsfeld
f490befcde Add ts_query_disable_capture API 2019-10-14 12:30:22 -07:00
Matthew Krupcale
ee9a3c0ebb lib: remove utf8proc dependency (#436)
* Remove dependency on utf8proc

This removes the only external dependency on utf8proc for UTF-8 decoding. It does so by implementing its own UTF-8 decoder. This decoder is both faster and has a simpler API.

 * .gitmodules: remove utf8proc submodule
 * docs/section-2-using-parsers.md: remove requirement for utf8proc submodule
 * docs/section-6-contributing.md: likewise
 * lib/Cargo.toml: remove utf8proc subdirectory package include
 * lib/README.md: remove utf8proc subdirectory description
 * lib/binding_rust/build.rs: remove utf8proc compiler include directory
 * lib/src/lexer.c: remove utf8proc dependencies and types
 * lib/src/lib.c: remove utf8proc dependency
 * lib/src/unicode.h: define types for Unicode decoders
 * lib/src/utf16.{c,h}: implement more readable UTF-16 decoder
 * lib/src/utf8.{c,h}: implement fast UTF-8 decoder
 * lib/utf8proc: remove utf8proc submodule directory
 * script/build-lib: remove utf8proc compiler include directory
 * script/build-wasm: likewise

* Optimize ts_lexer__get_lookahead.

Try to favor non-failure code path and assign lookahead values directly to lexer

 * lib/src/lexer.c: optimize for non-failure code path

* Fix some compiler errors

 * lib/src/lexer.c: cast from signed to unsigned for decode_next result
 * lib/src/utf16.c: fix non-constant initializers for older compilers

* Remove some missed remnants of utf8proc

 * docs/section-2-using-parsers.md: only two include paths necessary now
 * lib/src/lib.c: no need to define UTF8PROC_STATIC

* Use ICU's utf8 and utf16 decoding routines

* Remove unnecessary casts when calling icu macros

* Check buffer length before attempting to decode a unicode character

* Use new unicode function when parsing Queries

Co-Authored-By: Matthew Krupcale <mkrupcale@matthewkrupcale.com>

* Mark libicu files as vendored for GitHub's stats
2019-10-14 11:18:39 -07:00
Max Brunsfeld
015be68c94 rust: Generalize text_callback type for query methods 2019-10-03 12:53:14 -07:00
Max Brunsfeld
9872a083b7 rust: Change QueryCursor::captures to expose the full match 2019-10-03 12:45:58 -07:00
Max Brunsfeld
27149902f8 Handle is?, is-not?, and set! predicate functions in queries 2019-09-25 10:21:20 -07:00
Max Brunsfeld
b15e90bd26 Handle set! predicate function in queries 2019-09-24 11:54:24 -07:00
Max Brunsfeld
070f11b8bf Use ptr::NonNull in Rust bindings 2019-09-23 17:00:52 -07:00
Max Brunsfeld
d9b8bae629 rust: Include pattern indices when iterating query captures 2019-09-18 14:22:55 -07:00
Max Brunsfeld
82955759c0 Add an API for getting a pattern's start offset in the source code 2019-09-17 16:19:58 -07:00
Max Brunsfeld
2d1ca8bc9f Fix match return order fom ts_query_cursor_next_match 2019-09-17 14:52:27 -07:00
Max Brunsfeld
d4d554b2ae Add wasm bindings for predicates 2019-09-16 10:25:44 -07:00
Max Brunsfeld
096126d039 Allow predicates in queries, to match on nodes' text 2019-09-15 22:06:51 -07:00
Max Brunsfeld
a1fec71b19 Tweak QueryCursor to allow iterating either matches or captures
For syntax highlighting, we want to iterate over all of the captures in 
order, and don't care about grouping the captures by pattern.
2019-09-13 15:19:04 -07:00
Max Brunsfeld
c71de5bd81 Tweak query interface
* Rename TSQueryContext -> TSQueryCursor
* Remove the permanent association between the cursor and its query. The 
cursor can now be used again for a different query.
2019-09-11 17:33:48 -07:00
Max Brunsfeld
c8c75782e3 Allow tree queries to execute within a limited range 2019-09-11 16:49:29 -07:00