sibil/src/lexer.rs

37 lines
518 B
Rust
Raw Normal View History

//! # Lexer
2016-12-20 17:38:44 -08:00
use characters;
enum Kind {
LeftParen,
RightParen,
Identifier,
}
struct Token {
kind: Kind,
value: String,
}
2016-12-20 17:38:44 -08:00
struct Lexer {
input: str,
}
impl Lexer {
}
impl Iterator for Lexer {
type Item = Token;
fn next(&mut self) -> Option<Token> {
None
}
}
pub fn hello(person: &str) {
println!("Hello, {}!", person);
for (idx, c) in person.char_indices() {
println!(" {}, {} -> {}", c, idx, characters::identifier_initials().contains(&c));
}
}