@@ -17,19 +17,6 @@ use std::str::FromStr;
1717use unic_emoji_char:: is_emoji_presentation;
1818use unic_ucd_ident:: { is_xid_continue, is_xid_start} ;
1919
20- #[ inline]
21- pub fn make_tokenizer ( source : & str ) -> impl Iterator < Item = LexResult > + ' _ {
22- make_tokenizer_located ( source, Location :: new ( 0 , 0 ) )
23- }
24-
25- pub fn make_tokenizer_located (
26- source : & str ,
27- start_location : Location ,
28- ) -> impl Iterator < Item = LexResult > + ' _ {
29- let nlh = NewlineHandler :: new ( source. chars ( ) ) ;
30- Lexer :: new ( nlh, start_location)
31- }
32-
3320#[ derive( Clone , Copy , PartialEq , Debug , Default ) ]
3421struct IndentationLevel {
3522 tabs : usize ,
@@ -161,6 +148,19 @@ pub static KEYWORDS: phf::Map<&'static str, Tok> =
161148pub type Spanned = ( Location , Tok , Location ) ;
162149pub type LexResult = Result < Spanned , LexicalError > ;
163150
151+ #[ inline]
152+ pub fn make_tokenizer ( source : & str ) -> impl Iterator < Item = LexResult > + ' _ {
153+ make_tokenizer_located ( source, Location :: new ( 0 , 0 ) )
154+ }
155+
156+ pub fn make_tokenizer_located (
157+ source : & str ,
158+ start_location : Location ,
159+ ) -> impl Iterator < Item = LexResult > + ' _ {
160+ let nlh = NewlineHandler :: new ( source. chars ( ) ) ;
161+ Lexer :: new ( nlh, start_location)
162+ }
163+
164164// The newline handler is an iterator which collapses different newline
165165// types into \n always.
166166pub struct NewlineHandler < T : Iterator < Item = char > > {
0 commit comments