1
Fork 0

De-@ ParseSess uses.

This commit is contained in:
Eduard Burtescu 2014-03-09 16:54:34 +02:00
parent 555a239301
commit 90cbe0cad2
16 changed files with 90 additions and 109 deletions

View file

@ -284,8 +284,8 @@ struct ParsedItemsAndViewItems {
/* ident is handled by common.rs */
pub fn Parser(sess: @ParseSess, cfg: ast::CrateConfig, rdr: ~Reader:)
-> Parser {
pub fn Parser<'a>(sess: &'a ParseSess, cfg: ast::CrateConfig, rdr: ~Reader:)
-> Parser<'a> {
let tok0 = rdr.next_token();
let span = tok0.sp;
let placeholder = TokenAndSpan {
@ -320,8 +320,8 @@ pub fn Parser(sess: @ParseSess, cfg: ast::CrateConfig, rdr: ~Reader:)
}
}
pub struct Parser {
sess: @ParseSess,
pub struct Parser<'a> {
sess: &'a ParseSess,
cfg: CrateConfig,
// the current token:
token: token::Token,
@ -354,7 +354,7 @@ fn is_plain_ident_or_underscore(t: &token::Token) -> bool {
is_plain_ident(t) || *t == token::UNDERSCORE
}
impl Parser {
impl<'a> Parser<'a> {
// convert a token to a string using self's reader
pub fn token_to_str(token: &token::Token) -> ~str {
token::to_str(token)