@@ -198,11 +198,6 @@ pub enum QueryErrorKind {
198198 Structure ,
199199}
200200
201- trait TextCallback < ' a > {
202- fn call ( & mut self , node : Node ) ;
203- fn next_chunk ( & mut self ) -> Option < & ' a [ u8 ] > ;
204- }
205-
206201#[ derive( Debug ) ]
207202enum TextPredicate {
208203 CaptureEqString ( u32 , String , bool ) ,
@@ -1836,14 +1831,6 @@ impl<'a, 'tree, T: TextProvider<'a>> Iterator for QueryMatches<'a, 'tree, T> {
18361831 }
18371832}
18381833
1839- impl < ' a , ' tree , T : TextProvider < ' a > > QueryCaptures < ' a , ' tree , T > {
1840- pub fn set_byte_range ( & mut self , start : usize , end : usize ) {
1841- unsafe {
1842- ffi:: ts_query_cursor_set_byte_range ( self . ptr , start as u32 , end as u32 ) ;
1843- }
1844- }
1845- }
1846-
18471834impl < ' a , ' tree , T : TextProvider < ' a > > Iterator for QueryCaptures < ' a , ' tree , T > {
18481835 type Item = ( QueryMatch < ' a , ' tree > , usize ) ;
18491836
@@ -1876,6 +1863,34 @@ impl<'a, 'tree, T: TextProvider<'a>> Iterator for QueryCaptures<'a, 'tree, T> {
18761863 }
18771864}
18781865
1866+ impl < ' a , ' tree , T : TextProvider < ' a > > QueryMatches < ' a , ' tree , T > {
1867+ pub fn set_byte_range ( & mut self , start : usize , end : usize ) {
1868+ unsafe {
1869+ ffi:: ts_query_cursor_set_byte_range ( self . ptr , start as u32 , end as u32 ) ;
1870+ }
1871+ }
1872+
1873+ pub fn set_point_range ( & mut self , start : Point , end : Point ) {
1874+ unsafe {
1875+ ffi:: ts_query_cursor_set_point_range ( self . ptr , start. into ( ) , end. into ( ) ) ;
1876+ }
1877+ }
1878+ }
1879+
1880+ impl < ' a , ' tree , T : TextProvider < ' a > > QueryCaptures < ' a , ' tree , T > {
1881+ pub fn set_byte_range ( & mut self , start : usize , end : usize ) {
1882+ unsafe {
1883+ ffi:: ts_query_cursor_set_byte_range ( self . ptr , start as u32 , end as u32 ) ;
1884+ }
1885+ }
1886+
1887+ pub fn set_point_range ( & mut self , start : Point , end : Point ) {
1888+ unsafe {
1889+ ffi:: ts_query_cursor_set_point_range ( self . ptr , start. into ( ) , end. into ( ) ) ;
1890+ }
1891+ }
1892+ }
1893+
18791894impl < ' cursor , ' tree > fmt:: Debug for QueryMatch < ' cursor , ' tree > {
18801895 fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
18811896 write ! (
0 commit comments