File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed
branches/try/src/rustc/syntax/parse Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change 2
2
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5
- refs/heads/try: 6224fdcd08bf94f0410e804ff8f144fc5494ec6d
5
+ refs/heads/try: 19c651f4a18597b72113777a9122fc1f2a1ac6bb
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
Original file line number Diff line number Diff line change @@ -416,6 +416,21 @@ fn parse_ret_ty(p: parser) -> (ast::ret_style, @ast::ty) {
416
416
}
417
417
}
418
418
419
+ fn parse_region ( p : parser ) -> ast:: region {
420
+ alt p. token {
421
+ token:: IDENT ( sid, _) if p. look_ahead ( 1 u) == token:: DOT {
422
+ let string = p. get_str ( sid) ;
423
+ p. bump ( ) ; p. bump ( ) ;
424
+ if string == "self" {
425
+ ast:: re_self
426
+ } else {
427
+ ast:: re_named ( string)
428
+ }
429
+ }
430
+ _ { ast : : re_inferred }
431
+ }
432
+ }
433
+
419
434
fn parse_ty ( p : parser , colons_before_params : bool ) -> @ast:: ty {
420
435
let lo = p. span . lo ;
421
436
@@ -467,6 +482,11 @@ fn parse_ty(p: parser, colons_before_params: bool) -> @ast::ty {
467
482
let t = ast:: ty_vec ( parse_mt ( p) ) ;
468
483
expect ( p, token:: RBRACKET ) ;
469
484
t
485
+ } else if p. token == token:: BINOP ( token:: AND ) {
486
+ p. bump ( ) ;
487
+ let region = parse_region ( p) ;
488
+ let mt = parse_mt ( p) ;
489
+ ast:: ty_rptr ( region, mt)
470
490
} else if eat_word ( p, "fn" ) {
471
491
let proto = parse_fn_ty_proto ( p) ;
472
492
alt proto {
You can’t perform that action at this time.
0 commit comments