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;
|
use characters;
|
||||||
|
|
||||||
enum Kind {
|
pub enum Kind {
|
||||||
LeftParen,
|
LeftParen,
|
||||||
RightParen,
|
RightParen,
|
||||||
Identifier,
|
Identifier,
|
||||||
}
|
}
|
||||||
|
|
||||||
struct Token {
|
pub struct Token {
|
||||||
kind: Kind,
|
kind: Kind,
|
||||||
value: String,
|
value: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
struct Lexer {
|
pub struct Lexer {
|
||||||
input: str,
|
input: String,
|
||||||
|
index: usize,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Lexer {
|
impl Lexer {
|
||||||
|
pub fn new(input: String) -> Lexer {
|
||||||
|
Lexer { input: input, index: 0 }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Iterator for Lexer {
|
impl Iterator for Lexer {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue