Andrew Hlynskyi
65dc922944
fix(cli): Panic on broken pipe for: 'tree-sitter parse ... | head'
...
Introduce a concept of ignored errors when the Error wrapper struct
contains None instead of Vec of String messages.
2021-05-31 18:34:09 +03:00
Andrew Hlynskyi
4c5459814e
Cut dangling closing bracket in the playground tree
2021-05-31 14:12:22 +03:00
Max Brunsfeld
d72771a19f
Make ::set_{byte,point}_range methods take a Range
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-05-28 14:21:11 -07:00
Max Brunsfeld
7f4eb9a222
Provide ::set_{byte,point}_range on both query iterators
2021-05-28 14:07:54 -07:00
Max Brunsfeld
97dfee6325
Add QueryMatch::nodes_for_capture_index
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-05-28 12:38:30 -07:00
Max Brunsfeld
dab11134c2
Add Query::capture_index_for_name method
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-05-28 12:27:50 -07:00
Max Brunsfeld
851f55afce
Report non-rooted matches that intersect cursor's range restriction
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-05-28 11:58:38 -07:00
Max Brunsfeld
919e9745a6
Add ts_tree_cursor_goto_first_child_for_point function
...
This function (and the similar `ts_tree_cursor_goto_first_child_for_byte`)
allows you to efficiently seek the tree cursor to a given position,
exploiting the tree's internal balancing, without having to visit
all of the preceding siblings of each node.
2021-05-27 12:30:19 -07:00
Max Brunsfeld
036aceed57
In script/generate-bindings, add flags for latest bindgen
2021-05-25 18:02:39 -07:00
Max Brunsfeld
fda35894d4
Stop matching new patterns past the end of QueryCursor's range
...
This restores the original signatures of the `set_byte_range` and
`set_point_range` functions. Now, the QueryCursor will properly report
matches that intersect, but are not fully contained by its range.
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-05-25 18:02:35 -07:00
Max Brunsfeld
f597cc6a75
Preserve matches that contain the QueryCursor's start byte
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2021-05-25 13:06:24 -07:00
Max Brunsfeld
a61f25bc58
Add APIs for advancing a QueryCursor to an arbitrary position
2021-05-24 21:07:59 -07:00
Max Brunsfeld
0c7b37a9fd
Merge pull request #1126 from jiyee/master
...
FIX: node-tree-sitter url
2021-05-24 11:26:32 -07:00
Douglas Creager
78010722a4
query: Allow unlimited pending matches
...
Well, not completely unlimited — we're still using a 16-bit counter to
keep track of them. But we longer have a static maximum of 32 pending
matches when executing a query.
2021-05-24 11:02:58 -04:00
Jiyee Sheng
6ceecb3928
FIX: node-tree-sitter url
2021-05-24 16:28:08 +08:00
Max Brunsfeld
8c3d1466ec
Allow QueryCursor's text callback to return an iterator
2021-05-23 21:05:26 -07:00
Max Brunsfeld
b1c2723327
Merge pull request #1125 from ahlinc/fix/build-wasm-in-docker
...
fix(cli): Correct fallback on docker compilation for all platforms, fixes #1124
2021-05-23 12:09:36 -07:00
Andrew Hlynskyi
0ae70289ae
fix(cli): Correct fallback on docker compilation for all platforms, fixes #1124
2021-05-23 17:04:34 +03:00
Max Brunsfeld
0e445c47fa
rust: Parser and QueryCursor are Sync
...
These objects are not generally intended to be shared betwen threads,
but they meet the Rust definition of Sync: all of their methods are
that take a shared reference to `self` are safe to call from multiple
threads simultaneously. In other words, there is no interior
mutability.
2021-05-21 21:14:24 -07:00
Max Brunsfeld
e4e5ffe517
Merge pull request #1109 from nhasabni/nhasabni/ts_node_child_field_name
...
Adding API to get field name of a TSNode
2021-05-21 20:41:17 -07:00
Niranjan Hasabnis
c0e2b43d34
Fixing Rust formatting issue
2021-05-21 15:43:10 +00:00
Claudi Lleyda Moltó
8e4509e47b
Fix: cast pointers to void * when printing
...
To avoid undefined behaviour, pointers should be cast to `void *` when
printed with `%p`.
2021-05-21 12:36:58 +02:00
Niranjan Hasabnis
c31acb8fec
Changing API name; Adding unit test and Rust bindings
2021-05-21 01:50:10 +00:00
Niranjan Hasabnis
bd06b1a8b3
Merge branch 'nhasabni/ts_node_child_field_name' of https://github.com/nhasabni/tree-sitter into nhasabni/ts_node_child_field_name
2021-05-20 23:37:03 +00:00
Niranjan Hasabnis
e2b8130f62
Merge branch 'tree-sitter:master' into nhasabni/ts_node_child_field_name
2021-05-20 16:35:52 -07:00
Niranjan Hasabnis
c0f7022165
Function rename
2021-05-20 23:29:25 +00:00
Max Brunsfeld
8d8690538e
0.19.5
2021-05-20 15:02:46 -07:00
Max Brunsfeld
9d0eedc01f
Remove stray entry from wasm exported-symbol list
2021-05-20 14:33:25 -07:00
Max Brunsfeld
242e089379
web: 0.19.4
2021-05-20 14:29:39 -07:00
Max Brunsfeld
5664b77535
rust: 0.19.5
2021-05-20 14:29:25 -07:00
Max Brunsfeld
e386ebc3b6
Merge pull request #1119 from tree-sitter/remove-parent-node-cache
...
Remove interior mutability for parent-node caching in Tree
2021-05-20 14:20:39 -07:00
Max Brunsfeld
399b5e4daf
Remove interior mutability for parent-node caching in Tree
...
In Rust binding, mark Tree as Sync
2021-05-20 13:56:26 -07:00
Max Brunsfeld
019148b304
Merge pull request #1118 from ahlinc/cargo-fmt
...
Apply 'cargo fmt' for the whole Rust code base
2021-05-20 12:10:50 -07:00
Max Brunsfeld
b8ff6447d7
Merge pull request #1112 from breandan/patch-1
...
Add link to Kotlin parser
2021-05-20 12:06:17 -07:00
Andrew Hlynskyi
96ad90a646
CI: Add 'cargo fmt -- --check' to ci.yml
...
The step is placed right after Rust installation to fail faster.
2021-05-19 23:21:43 +03:00
Andrew Hlynskyi
3c0152a331
chore(fmt): Apply 'cargo fmt' to the whole code base
2021-05-19 23:21:43 +03:00
Max Brunsfeld
cf06ac4f82
Merge pull request #1117 from markus-oberhumer/fix-const-correctness-part2
...
cli: Improve const-correctness of the generated parsers (part 2 of 2).
2021-05-19 08:37:48 -07:00
Markus F.X.J. Oberhumer
cc519b3121
cli: Improve const-correctness of the generated parsers (part 2 of 2).
...
This is a follow-up to my previous commit 1badd131f9 .
I've made this an extra patch as it requires a minor
API change in <tree_sitter/parser.h>.
This commit moves the remaining generated tables into
the read-only segment.
Before:
$ for f in bash c cpp go html java javascript jsdoc json php python ruby rust; do \
gcc -o $f.o -O2 -Ilib/include -c test/fixtures/grammars/$f/src/parser.c; \
done
$ size --totals *.o
text data bss dec hex filename
5353477 24472 0 5377949 520f9d (TOTALS)
After:
$ for f in bash c cpp go html java javascript jsdoc json php python ruby rust; do \
gcc -o $f.o -O2 -Ilib/include -c test/fixtures/grammars/$f/src/parser.c; \
done
$ size --totals *.o
5378147 0 0 5378147 521063 (TOTALS)
2021-05-19 12:49:57 +02:00
dependabot[bot]
b7e658138b
build(deps): bump nokogiri from 1.10.8 to 1.11.4 in /docs
...
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri ) from 1.10.8 to 1.11.4.
- [Release notes](https://github.com/sparklemotion/nokogiri/releases )
- [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md )
- [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.10.8...v1.11.4 )
Signed-off-by: dependabot[bot] <support@github.com>
2021-05-19 07:30:50 +00:00
Niranjan Hasabnis
3be4bc7abb
Syntactic improvements
2021-05-17 17:52:52 +00:00
breandan
3d8f666581
Add link to Kotlin parser
2021-05-16 21:38:05 -04:00
Niranjan Hasabnis
dffee22736
Adding API to get field name of a TSNode
...
This PR adds an API to get name of the field of TSNode's child.
It uses same set of arguments as that of ts_node_child, but returns
field name if it is found, otherwise it returns NULL.
This API is useful to implement custom printing of S-expressions such
as following:
"(binary_expression
(binary_expression_left (identifier))
(binary_expression_operator ("+"))
(binary_expression_right (identifier)
)"
Currently, ts_node_string does not allow any customization for printing.
2021-05-15 00:20:18 +00:00
Douglas Creager
6abf77a20c
web: 0.19.3
2021-05-13 15:14:56 -04:00
Max Brunsfeld
2923c9cb62
Merge pull request #1101 from camdencheek/add-dockerfile
...
Add link to Dockerfile parser
2021-05-11 08:36:59 -07:00
Camden Cheek
fbe72f2f22
Add link to Dockerfile parser
2021-05-11 08:52:32 -06:00
Max Brunsfeld
335190cc1d
Merge pull request #1089 from tree-sitter/wasm-fix
...
binding_web: Call correct function to reset parser
2021-05-03 11:47:05 -07:00
Douglas Creager
04c2aa973b
binding_web: Call correct function to reset parser
2021-05-03 14:25:57 -04:00
Max Brunsfeld
fe5a29a1c6
Merge pull request #1081 from ahlinc/feat/fail-ci-on-compiler-warnings
...
feat: Fail CI on compiler warnings
2021-05-01 09:26:44 -07:00
Max Brunsfeld
2083bdcc68
Merge pull request #1084 from alemuller/patch-2
...
Add Make parser
2021-04-30 12:31:11 -07:00
Alexandre A. Muller
0970b88a9e
Add Make parser
...
Add make parser and also change Fennel list from `-` to `*` (that created a list inside a list).
2021-04-30 19:06:10 +00:00