mirror of
https://github.com/SpaceManiac/SpacemanDMM.git
synced 2025-12-23 05:36:47 +00:00
Handle octal numeral corner cases better
This commit is contained in:
parent
5857a2e154
commit
f0eda65079
1 changed files with 1 additions and 2 deletions
|
|
@ -368,7 +368,6 @@ impl<'ctx, R: Read> Lexer<'ctx, R> {
|
|||
Some(ch) if ch == b'.' || ch == b'e' => {
|
||||
integer = false;
|
||||
exponent |= ch == b'e';
|
||||
radix = 10; // undo octal radix in case of 0.9
|
||||
buf.push(ch as char);
|
||||
}
|
||||
Some(ch) if (ch == b'+' || ch == b'-') && exponent => {
|
||||
|
|
@ -382,7 +381,7 @@ impl<'ctx, R: Read> Lexer<'ctx, R> {
|
|||
return Err(self.error("expected INF"));
|
||||
}
|
||||
}
|
||||
Some(ch) if (ch as char).is_digit(radix) => buf.push(ch as char),
|
||||
Some(ch) if (ch as char).is_digit(::std::cmp::max(radix, 10)) => buf.push(ch as char),
|
||||
ch => { self.put_back(ch); return Ok((integer, radix, buf)) }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue