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> {
5555 column_index : 0 ,
5656 }
5757 }
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+ }
5870}
5971
6072impl Iterator for CharReader < ' _ > {
@@ -216,11 +228,11 @@ pub fn extract(input: &str) -> Vec<JavaScriptSourceFeature> {
216228 res
217229}
218230
219- fn consume_escaped_char ( it : & mut CharReader < ' _ > ) {
231+ pub fn consume_escaped_char ( it : & mut CharReader < ' _ > ) {
220232 it. next ( ) ;
221233}
222234
223- fn consume_identifier ( it : & mut CharReader < ' _ > ) {
235+ pub fn consume_identifier ( it : & mut CharReader < ' _ > ) {
224236 while it. chars . peek ( ) . is_some ( ) {
225237 match it. chars . peek ( ) {
226238 Some ( ( _, 'a' ..='z' | 'A' ..='Z' | '_' | '0' ..='9' ) ) => {
@@ -231,7 +243,7 @@ fn consume_identifier(it: &mut CharReader<'_>) {
231243 }
232244}
233245
234- fn consume_line_comment ( it : & mut CharReader < ' _ > ) {
246+ pub fn consume_line_comment ( it : & mut CharReader < ' _ > ) {
235247 for ( _, c) in it {
236248 match c {
237249 '\n' | '\r' => {
@@ -242,7 +254,7 @@ fn consume_line_comment(it: &mut CharReader<'_>) {
242254 }
243255}
244256
245- fn consume_string ( it : & mut CharReader < ' _ > , quote : char ) {
257+ pub fn consume_string ( it : & mut CharReader < ' _ > , quote : char ) {
246258 while let Some ( ( _, c) ) = it. next ( ) {
247259 match c {
248260 '\\' => {
You can’t perform that action at this time.
0 commit comments