mirror of
https://github.com/Noratrieb/dilaria.git
synced 2026-01-15 18:05:03 +01:00
small api changes
This commit is contained in:
parent
b3fde273d6
commit
78f8382502
3 changed files with 8 additions and 10 deletions
|
|
@ -104,7 +104,7 @@ pub struct Lexer<'code> {
|
|||
}
|
||||
|
||||
impl<'code> Lexer<'code> {
|
||||
pub fn lex(code: &'code str) -> Self {
|
||||
pub fn new(code: &'code str) -> Self {
|
||||
Self {
|
||||
code: code.char_indices().peekable(),
|
||||
src: code,
|
||||
|
|
@ -416,7 +416,7 @@ mod test {
|
|||
type StdString = std::string::String;
|
||||
|
||||
fn lex_types(str: &str) -> Vec<TokenType> {
|
||||
let lexer = Lexer::lex(str);
|
||||
let lexer = Lexer::new(str);
|
||||
lexer.map(|token| token.unwrap().kind).collect::<Vec<_>>()
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue