1
Fork 0

factor out common lines

This commit is contained in:
Benjamin Peterson 2012-09-27 15:03:44 -04:00
parent 7e7411e620
commit 459fe6ad55

View file

@ -2227,17 +2227,11 @@ impl parser {
}
let lo = self.span.lo;
if self.eat_keyword(~"unsafe") {
self.expect(token::LBRACE);
let {inner, next} = maybe_parse_inner_attrs_and_next(self,
parse_attrs);
return (inner, self.parse_block_tail_(lo, unsafe_blk, next));
} else {
self.expect(token::LBRACE);
let {inner, next} = maybe_parse_inner_attrs_and_next(self,
parse_attrs);
return (inner, self.parse_block_tail_(lo, default_blk, next));
}
let us = self.eat_keyword(~"unsafe");
self.expect(token::LBRACE);
let {inner, next} = maybe_parse_inner_attrs_and_next(self,
parse_attrs);
return (inner, self.parse_block_tail_(lo, if us { unsafe_blk } else { default_blk }, next));
}
fn parse_block_no_value() -> blk {