[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:
parent
b0b4699476
commit
a23b917785
6 changed files with 144 additions and 2 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue