This commit is contained in:
greg 2017-12-01 02:58:09 -08:00
parent 9e8a3d1f08
commit 485e869c90

View File

@ -82,7 +82,7 @@ fn tokenize(input: &mut Peekable<Chars>) -> Vec<Token> {
Some('(') => tokens.push(LParen), Some('(') => tokens.push(LParen),
Some(')') => tokens.push(RParen), Some(')') => tokens.push(RParen),
Some(c) if c.is_whitespace() => continue, Some(c) if c.is_whitespace() => continue,
Some(_) => { Some(c) => {
let sym: String = input.peeking_take_while(|next| { let sym: String = input.peeking_take_while(|next| {
match *next { match *next {
'(' | ')' => false, '(' | ')' => false,
@ -90,7 +90,7 @@ fn tokenize(input: &mut Peekable<Chars>) -> Vec<Token> {
_ => true _ => true
} }
}).collect(); }).collect();
tokens.push(Symbol(sym)); tokens.push(Symbol(format!("{}{}", c, sym)));
} }
} }
} }