Attempt to move all the Sibil code to its own directory

Add a dependency to its Cargo.toml for sibiltypes.
This commit is contained in:
Eryn Wells 2017-04-14 07:50:35 -07:00
parent 5e71947128
commit cea63e8e8e
8 changed files with 3 additions and 1 deletions

35
sibil/src/lexer/token.rs Normal file
View file

@ -0,0 +1,35 @@
/* token.rs
* Eryn Wells <eryn@erynwells.me>
*/
use types::{Bool, Char, Number};
#[derive(Debug, PartialEq)]
pub enum Token {
Boolean(Bool),
Character(Char),
Comment(String),
Dot,
Id(String),
LeftParen,
LeftVectorParen,
Number(Number),
Quote,
RightParen,
String(String),
}
/// A Lex is a Token extracted from a specific position in an input. It contains useful information about the token's
/// place.
#[derive(Debug)]
pub struct Lex {
pub token: Token,
pub line: usize,
pub offset: usize,
}
impl Lex {
pub fn new(token: Token, line: usize, offset: usize) -> Lex {
Lex { token: token, line: line, offset: offset }
}
}