File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change 2
2
refs/heads/master: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
5
- refs/heads/try: 272c5ab0e9573e6e85a1d576a3c95b5213cf5c61
5
+ refs/heads/try: 4fb675be2f42a828fb5a6570b9aad2c65f4598b9
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
8
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
Original file line number Diff line number Diff line change @@ -428,17 +428,25 @@ impl Parser {
428
428
while i < 4 u {
429
429
match self . next_char ( ) {
430
430
'0' to '9' => {
431
- n = n * 10 u +
432
- ( self . ch as uint ) - ( '0' as uint ) ;
433
- }
434
- _ => return self . error ( ~"invalid \\u escape")
431
+ n = n * 16 u + ( self . ch as uint )
432
+ - ( '0' as uint ) ;
433
+ } ,
434
+ 'a' | 'A' => n = n * 16 u + 10 u,
435
+ 'b' | 'B' => n = n * 16 u + 11 u,
436
+ 'c' | 'C' => n = n * 16 u + 12 u,
437
+ 'd' | 'D' => n = n * 16 u + 13 u,
438
+ 'e' | 'E' => n = n * 16 u + 14 u,
439
+ 'f' | 'F' => n = n * 16 u + 15 u,
440
+ _ => return self . error (
441
+ ~"invalid \\u escape ( unrecognized hex) ")
435
442
}
436
443
i += 1 u;
437
444
}
438
445
439
446
// Error out if we didn't parse 4 digits.
440
447
if i != 4 u {
441
- return self . error ( ~"invalid \\u escape") ;
448
+ return self . error (
449
+ ~"invalid \\u escape ( not four digits) ") ;
442
450
}
443
451
444
452
str:: push_char ( res, n as char ) ;
You can’t perform that action at this time.
0 commit comments