Make public lexer bits public
This commit is contained in:
parent
837403949e
commit
7de54a9835
1 changed files with 8 additions and 4 deletions
12
src/lexer.rs
12
src/lexer.rs
|
@ -2,22 +2,26 @@
|
|||
|
||||
use characters;
|
||||
|
||||
enum Kind {
|
||||
pub enum Kind {
|
||||
LeftParen,
|
||||
RightParen,
|
||||
Identifier,
|
||||
}
|
||||
|
||||
struct Token {
|
||||
pub struct Token {
|
||||
kind: Kind,
|
||||
value: String,
|
||||
}
|
||||
|
||||
struct Lexer {
|
||||
input: str,
|
||||
pub struct Lexer {
|
||||
input: String,
|
||||
index: usize,
|
||||
}
|
||||
|
||||
impl Lexer {
|
||||
pub fn new(input: String) -> Lexer {
|
||||
Lexer { input: input, index: 0 }
|
||||
}
|
||||
}
|
||||
|
||||
impl Iterator for Lexer {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue