@@ -261,13 +261,13 @@ pub enum Float<'a> {
261
261
} ,
262
262
/// A parsed and separated floating point value
263
263
Val {
264
- /// Whether or not the `integral` and `decimal ` are specified in hex
264
+ /// Whether or not the `integral` and `fractional ` are specified in hex
265
265
hex : bool ,
266
266
/// The float parts before the `.`
267
267
integral : Cow < ' a , str > ,
268
268
/// The float parts after the `.`
269
- decimal : Option < Cow < ' a , str > > ,
270
- /// The exponent to multiple this `integral.decimal ` portion of the
269
+ fractional : Option < Cow < ' a , str > > ,
270
+ /// The exponent to multiple this `integral.fractional ` portion of the
271
271
/// float by. If `hex` is true this is `2^exponent` and otherwise it's
272
272
/// `10^exponent`
273
273
exponent : Option < Cow < ' a , str > > ,
@@ -673,7 +673,7 @@ impl<'a> Lexer<'a> {
673
673
}
674
674
}
675
675
676
- // A number can optionally be after the decimal so only actually try to
676
+ // A number can optionally be after the dot so only actually try to
677
677
// parse one if it's there.
678
678
if it. clone ( ) . next ( ) == Some ( & b'.' ) {
679
679
it. next ( ) ;
@@ -1079,7 +1079,7 @@ impl Token {
1079
1079
hex,
1080
1080
} => {
1081
1081
let src = self . src ( s) ;
1082
- let ( integral, decimal , exponent) = match src. find ( '.' ) {
1082
+ let ( integral, fractional , exponent) = match src. find ( '.' ) {
1083
1083
Some ( i) => {
1084
1084
let integral = & src[ ..i] ;
1085
1085
let rest = & src[ i + 1 ..] ;
@@ -1106,7 +1106,7 @@ impl Token {
1106
1106
}
1107
1107
} ;
1108
1108
let mut integral = Cow :: Borrowed ( integral. strip_prefix ( '+' ) . unwrap_or ( integral) ) ;
1109
- let mut decimal = decimal . and_then ( |s| {
1109
+ let mut fractional = fractional . and_then ( |s| {
1110
1110
if s. is_empty ( ) {
1111
1111
None
1112
1112
} else {
@@ -1117,8 +1117,8 @@ impl Token {
1117
1117
exponent. map ( |s| Cow :: Borrowed ( s. strip_prefix ( '+' ) . unwrap_or ( s) ) ) ;
1118
1118
if has_underscores {
1119
1119
* integral. to_mut ( ) = integral. replace ( "_" , "" ) ;
1120
- if let Some ( decimal ) = & mut decimal {
1121
- * decimal . to_mut ( ) = decimal . replace ( "_" , "" ) ;
1120
+ if let Some ( fractional ) = & mut fractional {
1121
+ * fractional . to_mut ( ) = fractional . replace ( "_" , "" ) ;
1122
1122
}
1123
1123
if let Some ( exponent) = & mut exponent {
1124
1124
* exponent. to_mut ( ) = exponent. replace ( "_" , "" ) ;
@@ -1130,7 +1130,7 @@ impl Token {
1130
1130
Float :: Val {
1131
1131
hex,
1132
1132
integral,
1133
- decimal ,
1133
+ fractional ,
1134
1134
exponent,
1135
1135
}
1136
1136
}
@@ -1501,7 +1501,7 @@ mod tests {
1501
1501
get_float( "1.2" ) ,
1502
1502
Float :: Val {
1503
1503
integral: "1" . into( ) ,
1504
- decimal : Some ( "2" . into( ) ) ,
1504
+ fractional : Some ( "2" . into( ) ) ,
1505
1505
exponent: None ,
1506
1506
hex: false ,
1507
1507
} ,
@@ -1510,7 +1510,7 @@ mod tests {
1510
1510
get_float( "1.2e3" ) ,
1511
1511
Float :: Val {
1512
1512
integral: "1" . into( ) ,
1513
- decimal : Some ( "2" . into( ) ) ,
1513
+ fractional : Some ( "2" . into( ) ) ,
1514
1514
exponent: Some ( "3" . into( ) ) ,
1515
1515
hex: false ,
1516
1516
} ,
@@ -1519,7 +1519,7 @@ mod tests {
1519
1519
get_float( "-1_2.1_1E+0_1" ) ,
1520
1520
Float :: Val {
1521
1521
integral: "-12" . into( ) ,
1522
- decimal : Some ( "11" . into( ) ) ,
1522
+ fractional : Some ( "11" . into( ) ) ,
1523
1523
exponent: Some ( "01" . into( ) ) ,
1524
1524
hex: false ,
1525
1525
} ,
@@ -1528,7 +1528,7 @@ mod tests {
1528
1528
get_float( "+1_2.1_1E-0_1" ) ,
1529
1529
Float :: Val {
1530
1530
integral: "12" . into( ) ,
1531
- decimal : Some ( "11" . into( ) ) ,
1531
+ fractional : Some ( "11" . into( ) ) ,
1532
1532
exponent: Some ( "-01" . into( ) ) ,
1533
1533
hex: false ,
1534
1534
} ,
@@ -1537,7 +1537,7 @@ mod tests {
1537
1537
get_float( "0x1_2.3_4p5_6" ) ,
1538
1538
Float :: Val {
1539
1539
integral: "12" . into( ) ,
1540
- decimal : Some ( "34" . into( ) ) ,
1540
+ fractional : Some ( "34" . into( ) ) ,
1541
1541
exponent: Some ( "56" . into( ) ) ,
1542
1542
hex: true ,
1543
1543
} ,
@@ -1546,7 +1546,7 @@ mod tests {
1546
1546
get_float( "+0x1_2.3_4P-5_6" ) ,
1547
1547
Float :: Val {
1548
1548
integral: "12" . into( ) ,
1549
- decimal : Some ( "34" . into( ) ) ,
1549
+ fractional : Some ( "34" . into( ) ) ,
1550
1550
exponent: Some ( "-56" . into( ) ) ,
1551
1551
hex: true ,
1552
1552
} ,
@@ -1555,7 +1555,7 @@ mod tests {
1555
1555
get_float( "1." ) ,
1556
1556
Float :: Val {
1557
1557
integral: "1" . into( ) ,
1558
- decimal : None ,
1558
+ fractional : None ,
1559
1559
exponent: None ,
1560
1560
hex: false ,
1561
1561
} ,
@@ -1564,7 +1564,7 @@ mod tests {
1564
1564
get_float( "0x1p-24" ) ,
1565
1565
Float :: Val {
1566
1566
integral: "1" . into( ) ,
1567
- decimal : None ,
1567
+ fractional : None ,
1568
1568
exponent: Some ( "-24" . into( ) ) ,
1569
1569
hex: true ,
1570
1570
} ,
0 commit comments