remove superfluous is_float variable

This commit is contained in:
ConnorSkees 2020-04-28 15:49:19 -04:00
parent bc09e49c89
commit 03316161a8

View File

@ -69,18 +69,16 @@ pub(crate) fn eat_number<I: Iterator<Item = Token>>(
} }
let mut dec = String::new(); let mut dec = String::new();
let mut is_float = false;
let next_tok = *toks.peek().unwrap(); let next_tok = *toks.peek().unwrap();
if next_tok.kind == '.' { if next_tok.kind == '.' {
toks.next(); toks.next();
is_float = true;
eat_whole_number(toks, &mut dec); eat_whole_number(toks, &mut dec);
}
if dec.is_empty() && is_float { if dec.is_empty() {
return Err(("Expected digit.", next_tok.pos()).into()); return Err(("Expected digit.", next_tok.pos()).into());
}
} }
let mut times_ten = String::new(); let mut times_ten = String::new();