Skip to content

Commit e7eae87

Browse files
committed
small diff
1 parent 6bf71e7 commit e7eae87

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

compiler/parser/src/lexer.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,6 @@ use std::str::FromStr;
1717
use unic_emoji_char::is_emoji_presentation;
1818
use 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)]
3421
struct IndentationLevel {
3522
tabs: usize,
@@ -161,6 +148,19 @@ pub static KEYWORDS: phf::Map<&'static str, Tok> =
161148
pub type Spanned = (Location, Tok, Location);
162149
pub 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.
166166
pub struct NewlineHandler<T: Iterator<Item = char>> {

0 commit comments

Comments
 (0)