@@ -10,7 +10,6 @@ mod native {
1010 range:: Range ,
1111 tree:: Tree ,
1212 } ;
13- use core:: sync:: atomic:: AtomicUsize ;
1413 use std:: convert:: TryFrom ;
1514
1615 pub struct Parser {
@@ -33,12 +32,6 @@ mod native {
3332 // self.inner.take_wasm_store()
3433 // }
3534
36- #[ allow( clippy:: missing_safety_doc) ]
37- #[ inline]
38- pub unsafe fn cancellation_flag ( & self ) -> Option < & AtomicUsize > {
39- self . inner . cancellation_flag ( )
40- }
41-
4235 #[ inline]
4336 pub fn language ( & self ) -> Option < Language > {
4437 self . inner . language ( ) . map ( |l| ( * l) . clone ( ) ) . map ( Into :: into)
@@ -56,17 +49,17 @@ mod native {
5649 }
5750
5851 #[ inline]
59- pub fn parse_utf16 (
52+ pub fn parse_utf16_le (
6053 & mut self ,
6154 text : impl AsRef < [ u16 ] > ,
6255 old_tree : Option < & Tree > ,
6356 ) -> Result < Option < Tree > , ParserError > {
6457 let old_tree = old_tree. map ( |tree| & tree. inner ) ;
65- Ok ( self . inner . parse_utf16 ( text, old_tree) . map ( Into :: into) )
58+ Ok ( self . inner . parse_utf16_le ( text, old_tree) . map ( Into :: into) )
6659 }
6760
6861 #[ inline]
69- pub fn parse_utf16_with < T > (
62+ pub fn parse_utf16_le_with < T > (
7063 & mut self ,
7164 mut callback : impl FnMut ( u32 , Point ) -> T ,
7265 old_tree : Option < & Tree > ,
@@ -76,7 +69,7 @@ mod native {
7669 {
7770 let mut callback = |offset, inner| callback ( u32:: try_from ( offset) . unwrap ( ) , Point { inner } ) ;
7871 let old_tree = old_tree. map ( |tree| & tree. inner ) ;
79- Ok ( self . inner . parse_utf16_with ( & mut callback, old_tree) . map ( Into :: into) )
72+ Ok ( self . inner . parse_utf16_le_with_options ( & mut callback, old_tree, None ) . map ( Into :: into) )
8073 }
8174
8275 #[ inline]
@@ -90,7 +83,7 @@ mod native {
9083 {
9184 let mut callback = |offset, inner| callback ( u32:: try_from ( offset) . unwrap ( ) , Point { inner } ) ;
9285 let old_tree = old_tree. map ( |tree| & tree. inner ) ;
93- Ok ( self . inner . parse_with ( & mut callback, old_tree) . map ( Into :: into) )
86+ Ok ( self . inner . parse_with_options ( & mut callback, old_tree, None ) . map ( Into :: into) )
9487 }
9588
9689 #[ cfg( unix) ]
@@ -104,12 +97,6 @@ mod native {
10497 self . inner . reset ( )
10598 }
10699
107- #[ allow( clippy:: missing_safety_doc) ]
108- #[ inline]
109- pub unsafe fn set_cancellation_flag ( & mut self , flag : Option < & AtomicUsize > ) {
110- self . inner . set_cancellation_flag ( flag) ;
111- }
112-
113100 #[ inline]
114101 pub fn set_included_ranges ( & mut self , ranges : & [ Range ] ) -> Result < ( ) , IncludedRangesError > {
115102 let ranges = ranges. iter ( ) . map ( |range| range. inner ) . collect :: < Vec < _ > > ( ) ;
@@ -127,20 +114,10 @@ mod native {
127114 self . inner . set_logger ( logger)
128115 }
129116
130- #[ inline]
131- pub fn set_timeout_micros ( & mut self , timeout_micros : f64 ) {
132- self . inner . set_timeout_micros ( timeout_micros as u64 )
133- }
134-
135117 #[ inline]
136118 pub fn stop_printing_dot_graphs ( & mut self ) {
137119 self . inner . stop_printing_dot_graphs ( )
138120 }
139-
140- #[ inline]
141- pub fn timeout_micros ( & self ) -> f64 {
142- self . inner . timeout_micros ( ) as f64
143- }
144121 }
145122
146123 impl From < tree_sitter:: Parser > for Parser {
@@ -235,26 +212,26 @@ mod wasm {
235212 . map_err ( Into :: into)
236213 }
237214
238- // #[inline]
239- // pub fn parse_utf16 (
240- // &mut self,
241- // text : impl AsRef<[u16]>,
242- // old_tree : Option<&Tree>,
243- // ) -> Result<Option<Tree>, ParserError> {
244- // unimplemented!()
245- // }
215+ #[ inline]
216+ pub fn parse_utf16_le (
217+ & mut self ,
218+ _text : impl AsRef < [ u16 ] > ,
219+ _old_tree : Option < & Tree > ,
220+ ) -> Result < Option < Tree > , ParserError > {
221+ unimplemented ! ( )
222+ }
246223
247- // #[inline]
248- // pub fn parse_utf16_with <T>(
249- // &mut self,
250- // callback : impl FnMut(u32, Point) -> T + 'static,
251- // old_tree : Option<&Tree>,
252- // ) -> Result<Option<Tree>, ParserError>
253- // where
254- // T: AsRef<[u16]>,
255- // {
256- // unimplemented!()
257- // }
224+ #[ inline]
225+ pub fn parse_utf16_le_with < T > (
226+ & mut self ,
227+ _callback : impl FnMut ( u32 , Point ) -> T + ' static ,
228+ _old_tree : Option < & Tree > ,
229+ ) -> Result < Option < Tree > , ParserError >
230+ where
231+ T : AsRef < [ u16 ] > ,
232+ {
233+ unimplemented ! ( )
234+ }
258235
259236 #[ inline]
260237 pub fn parse_with < T > (
0 commit comments