You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'+' | '-'if float_parse.state != HexFloatParseState::Exponent => panic!("never happens: + or - always are after a p character in hex literal"),
119
-
'+' | '-'if float_parse.exponent_neg.is_some() => returnErr(location.to_error(format!("{ERR_PREFIX}maximum one sign is allowed in a number literal."))),
returnErr(location.to_error(format!("{ERR_PREFIX}maximum one sign is allowed in a number literal.")))
123
+
}
120
124
'-' => float_parse.exponent_neg = Some(true),
121
125
'+' => float_parse.exponent_neg = Some(false),
122
126
_ if float_parse.state == HexFloatParseState::Exponent && ch.is_ascii_digit() => float_parse.push(ch),
123
-
_ if float_parse.state == HexFloatParseState::Exponent => returnErr(location.to_error(format!("{ERR_PREFIX}invalid character for exponent. Expected an ascii digit, but found '{ch}'"))),
127
+
_ if float_parse.state == HexFloatParseState::Exponent => {
128
+
returnErr(location.to_error(format!(
129
+
"{ERR_PREFIX}invalid character for exponent. Expected an ascii digit, but found '{ch}'"
130
+
)))
131
+
}
124
132
_ if ch.is_ascii_hexdigit() => float_parse.push(ch),
'.'if float_parse.state == HexFloatParseState::Decimal => returnErr(location.to_error(format!("{ERR_PREFIX}maximum one '.' in number constant, but 2 were found."))),
127
-
'.'if float_parse.state == HexFloatParseState::Exponent => returnErr(location.to_error(format!("{ERR_PREFIX}exponent must be an integer, but found a period."))),
128
-
'p' | 'P'if float_parse.state == HexFloatParseState::Exponent => returnErr(location.to_error(format!("{ERR_PREFIX}maximum one 'p' in number constant, but 2 were found."))),
Copy file name to clipboardExpand all lines: src/lexer/types/lexing_state.rs
+4-1Lines changed: 4 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,10 @@ impl Ident {
36
36
self.is_number()
37
37
&& matchself.0.chars().last(){
38
38
Some('p' | 'P') => self.0.starts_with("0x"),
39
-
Some('e' | 'E') => !self.0.starts_with("0x"),/* if the number expression starts with 0 and contains an exponent, the number is considered decimal, not octal. */
39
+
Some('e' | 'E') => !self.0.starts_with("0x"),/* if the number expression starts
40
+
* with 0 and contains */
41
+
// an exponent, the number is considered decimal, not
0 commit comments