fix(lex): Allow an exponent 'E'

This commit is contained in:
Daniel Hofstetter 2024-12-05 15:34:35 +01:00
parent 9ebdf8cad5
commit c8095c0b4d

View file

@ -505,9 +505,9 @@ fn is_number(arg: &str) -> bool {
// optional exponent, and only if it's not the first character.
b'.' if !seen_dot && position_of_e.is_none() && i > 0 => seen_dot = true,
// Allow an exponent `e` but only at most one after the first
// Allow an exponent `e`/`E` but only at most one after the first
// character.
b'e' if position_of_e.is_none() && i > 0 => position_of_e = Some(i),
b'e' | b'E' if position_of_e.is_none() && i > 0 => position_of_e = Some(i),
_ => return false,
}