@@ -1392,14 +1392,14 @@ impl<T: Iterator<char>> Parser<T> {
1392
1392
1393
1393
// A leading '0' must be the only digit before the decimal point.
1394
1394
match self . ch_or_null ( ) {
1395
- '0' .. '9' => return self . error ( InvalidNumber ) ,
1395
+ '0' ... '9' => return self . error ( InvalidNumber ) ,
1396
1396
_ => ( )
1397
1397
}
1398
1398
} ,
1399
- '1' .. '9' => {
1399
+ '1' ... '9' => {
1400
1400
while !self . eof ( ) {
1401
1401
match self . ch_or_null ( ) {
1402
- c @ '0' .. '9' => {
1402
+ c @ '0' ... '9' => {
1403
1403
accum *= 10 ;
1404
1404
accum += ( c as u64 ) - ( '0' as u64 ) ;
1405
1405
@@ -1423,14 +1423,14 @@ impl<T: Iterator<char>> Parser<T> {
1423
1423
1424
1424
// Make sure a digit follows the decimal place.
1425
1425
match self . ch_or_null ( ) {
1426
- '0' .. '9' => ( ) ,
1426
+ '0' ... '9' => ( ) ,
1427
1427
_ => return self . error ( InvalidNumber )
1428
1428
}
1429
1429
1430
1430
let mut dec = 1.0 ;
1431
1431
while !self . eof ( ) {
1432
1432
match self . ch_or_null ( ) {
1433
- c @ '0' .. '9' => {
1433
+ c @ '0' ... '9' => {
1434
1434
dec /= 10.0 ;
1435
1435
res += ( ( ( c as int ) - ( '0' as int ) ) as f64 ) * dec;
1436
1436
self . bump ( ) ;
@@ -1457,12 +1457,12 @@ impl<T: Iterator<char>> Parser<T> {
1457
1457
1458
1458
// Make sure a digit follows the exponent place.
1459
1459
match self . ch_or_null ( ) {
1460
- '0' .. '9' => ( ) ,
1460
+ '0' ... '9' => ( ) ,
1461
1461
_ => return self . error ( InvalidNumber )
1462
1462
}
1463
1463
while !self . eof ( ) {
1464
1464
match self . ch_or_null ( ) {
1465
- c @ '0' .. '9' => {
1465
+ c @ '0' ... '9' => {
1466
1466
exp *= 10 ;
1467
1467
exp += ( c as uint ) - ( '0' as uint ) ;
1468
1468
@@ -1488,7 +1488,7 @@ impl<T: Iterator<char>> Parser<T> {
1488
1488
while i < 4 && !self . eof ( ) {
1489
1489
self . bump ( ) ;
1490
1490
n = match self . ch_or_null ( ) {
1491
- c @ '0' .. '9' => n * 16 + ( ( c as u16 ) - ( '0' as u16 ) ) ,
1491
+ c @ '0' ... '9' => n * 16 + ( ( c as u16 ) - ( '0' as u16 ) ) ,
1492
1492
'a' | 'A' => n * 16 + 10 ,
1493
1493
'b' | 'B' => n * 16 + 11 ,
1494
1494
'c' | 'C' => n * 16 + 12 ,
@@ -1530,11 +1530,13 @@ impl<T: Iterator<char>> Parser<T> {
1530
1530
'r' => res. push ( '\r' ) ,
1531
1531
't' => res. push ( '\t' ) ,
1532
1532
'u' => match try!( self . decode_hex_escape ( ) ) {
1533
- 0xDC00 .. 0xDFFF => return self . error ( LoneLeadingSurrogateInHexEscape ) ,
1533
+ 0xDC00 ... 0xDFFF => {
1534
+ return self . error ( LoneLeadingSurrogateInHexEscape )
1535
+ }
1534
1536
1535
1537
// Non-BMP characters are encoded as a sequence of
1536
1538
// two hex escapes, representing UTF-16 surrogates.
1537
- n1 @ 0xD800 .. 0xDBFF => {
1539
+ n1 @ 0xD800 ... 0xDBFF => {
1538
1540
match ( self . next_char ( ) , self . next_char ( ) ) {
1539
1541
( Some ( '\\' ) , Some ( 'u' ) ) => ( ) ,
1540
1542
_ => return self . error ( UnexpectedEndOfHexEscape ) ,
@@ -1768,7 +1770,7 @@ impl<T: Iterator<char>> Parser<T> {
1768
1770
'n' => { self . parse_ident ( "ull" , NullValue ) }
1769
1771
't' => { self . parse_ident ( "rue" , BooleanValue ( true ) ) }
1770
1772
'f' => { self . parse_ident ( "alse" , BooleanValue ( false ) ) }
1771
- '0' .. '9' | '-' => self . parse_number ( ) ,
1773
+ '0' ... '9' | '-' => self . parse_number ( ) ,
1772
1774
'"' => match self . parse_str ( ) {
1773
1775
Ok ( s) => StringValue ( s) ,
1774
1776
Err ( e) => Error ( e) ,
0 commit comments