[lexer] Lex bools!

Extend the lexer to support Scheme bools like this: #t, #f, #true, #false.
Add some positive tests for this too.
This commit is contained in:
Eryn Wells 2018-08-26 13:40:27 -07:00
parent b0b4699476
commit a23b917785
6 changed files with 144 additions and 2 deletions

View file

@ -11,7 +11,12 @@ pub struct Lex {
}
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum Token { LeftParen, RightParen, Id, }
pub enum Token {
Bool(bool),
LeftParen,
RightParen,
Id
}
impl Lex {
pub fn new(token: Token, value: &str, line: usize, offset: usize) -> Lex {