lex() function in lexer module

This commit is contained in:
Eryn Wells 2017-01-02 12:00:31 -05:00
parent 3dd170ec69
commit bf03cb8ef9
2 changed files with 7 additions and 1 deletions

View file

@ -49,6 +49,10 @@ enum NewlineState { N, Ne, New, Newl, Newli, Newlin, Newline }
#[derive(Clone, PartialEq, Debug)]
enum SpaceState { S, Sp, Spa, Spac, Space }
pub fn lex(input: &str) -> Lexer {
Lexer::new(&input)
}
pub struct Lexer {
input: String,
begin: usize,