@@ -10,7 +10,6 @@ mod native {
10
10
range:: Range ,
11
11
tree:: Tree ,
12
12
} ;
13
- use core:: sync:: atomic:: AtomicUsize ;
14
13
use std:: convert:: TryFrom ;
15
14
16
15
pub struct Parser {
@@ -33,12 +32,6 @@ mod native {
33
32
// self.inner.take_wasm_store()
34
33
// }
35
34
36
- #[ allow( clippy:: missing_safety_doc) ]
37
- #[ inline]
38
- pub unsafe fn cancellation_flag ( & self ) -> Option < & AtomicUsize > {
39
- self . inner . cancellation_flag ( )
40
- }
41
-
42
35
#[ inline]
43
36
pub fn language ( & self ) -> Option < Language > {
44
37
self . inner . language ( ) . map ( |l| ( * l) . clone ( ) ) . map ( Into :: into)
@@ -56,17 +49,17 @@ mod native {
56
49
}
57
50
58
51
#[ inline]
59
- pub fn parse_utf16 (
52
+ pub fn parse_utf16_le (
60
53
& mut self ,
61
54
text : impl AsRef < [ u16 ] > ,
62
55
old_tree : Option < & Tree > ,
63
56
) -> Result < Option < Tree > , ParserError > {
64
57
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) )
66
59
}
67
60
68
61
#[ inline]
69
- pub fn parse_utf16_with < T > (
62
+ pub fn parse_utf16_le_with < T > (
70
63
& mut self ,
71
64
mut callback : impl FnMut ( u32 , Point ) -> T ,
72
65
old_tree : Option < & Tree > ,
@@ -76,7 +69,7 @@ mod native {
76
69
{
77
70
let mut callback = |offset, inner| callback ( u32:: try_from ( offset) . unwrap ( ) , Point { inner } ) ;
78
71
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) )
80
73
}
81
74
82
75
#[ inline]
@@ -90,7 +83,7 @@ mod native {
90
83
{
91
84
let mut callback = |offset, inner| callback ( u32:: try_from ( offset) . unwrap ( ) , Point { inner } ) ;
92
85
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) )
94
87
}
95
88
96
89
#[ cfg( unix) ]
@@ -104,12 +97,6 @@ mod native {
104
97
self . inner . reset ( )
105
98
}
106
99
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
-
113
100
#[ inline]
114
101
pub fn set_included_ranges ( & mut self , ranges : & [ Range ] ) -> Result < ( ) , IncludedRangesError > {
115
102
let ranges = ranges. iter ( ) . map ( |range| range. inner ) . collect :: < Vec < _ > > ( ) ;
@@ -127,20 +114,10 @@ mod native {
127
114
self . inner . set_logger ( logger)
128
115
}
129
116
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
-
135
117
#[ inline]
136
118
pub fn stop_printing_dot_graphs ( & mut self ) {
137
119
self . inner . stop_printing_dot_graphs ( )
138
120
}
139
-
140
- #[ inline]
141
- pub fn timeout_micros ( & self ) -> f64 {
142
- self . inner . timeout_micros ( ) as f64
143
- }
144
121
}
145
122
146
123
impl From < tree_sitter:: Parser > for Parser {
@@ -235,26 +212,26 @@ mod wasm {
235
212
. map_err ( Into :: into)
236
213
}
237
214
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
+ }
246
223
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
+ }
258
235
259
236
#[ inline]
260
237
pub fn parse_with < T > (
0 commit comments