File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,18 @@ impl<'a> CharReader<'a> {
55
55
column_index : 0 ,
56
56
}
57
57
}
58
+
59
+ pub fn get_line_index ( & self ) -> usize {
60
+ self . line_index
61
+ }
62
+
63
+ pub fn get_column_index ( & self ) -> usize {
64
+ self . column_index
65
+ }
66
+
67
+ pub fn get_chars ( & self ) -> Peekable < CharIndices < ' a > > {
68
+ self . chars . clone ( )
69
+ }
58
70
}
59
71
60
72
impl Iterator for CharReader < ' _ > {
@@ -216,11 +228,11 @@ pub fn extract(input: &str) -> Vec<JavaScriptSourceFeature> {
216
228
res
217
229
}
218
230
219
- fn consume_escaped_char ( it : & mut CharReader < ' _ > ) {
231
+ pub fn consume_escaped_char ( it : & mut CharReader < ' _ > ) {
220
232
it. next ( ) ;
221
233
}
222
234
223
- fn consume_identifier ( it : & mut CharReader < ' _ > ) {
235
+ pub fn consume_identifier ( it : & mut CharReader < ' _ > ) {
224
236
while it. chars . peek ( ) . is_some ( ) {
225
237
match it. chars . peek ( ) {
226
238
Some ( ( _, 'a' ..='z' | 'A' ..='Z' | '_' | '0' ..='9' ) ) => {
@@ -231,7 +243,7 @@ fn consume_identifier(it: &mut CharReader<'_>) {
231
243
}
232
244
}
233
245
234
- fn consume_line_comment ( it : & mut CharReader < ' _ > ) {
246
+ pub fn consume_line_comment ( it : & mut CharReader < ' _ > ) {
235
247
for ( _, c) in it {
236
248
match c {
237
249
'\n' | '\r' => {
@@ -242,7 +254,7 @@ fn consume_line_comment(it: &mut CharReader<'_>) {
242
254
}
243
255
}
244
256
245
- fn consume_string ( it : & mut CharReader < ' _ > , quote : char ) {
257
+ pub fn consume_string ( it : & mut CharReader < ' _ > , quote : char ) {
246
258
while let Some ( ( _, c) ) = it. next ( ) {
247
259
match c {
248
260
'\\' => {
You can’t perform that action at this time.
0 commit comments