about summary refs log tree commit diff
path: root/src/libsyntax/parse/parser.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-03-17 02:11:56 -0700
committerbors <bors@rust-lang.org>2014-03-17 02:11:56 -0700
commite4c91e6c7cfc03246a422576ab41ac74125fd3b8 (patch)
treebf813a516c3fdfd864e1ae3422b93f22da28bdf6 /src/libsyntax/parse/parser.rs
parentb6d5b8f6ff7b9feaf8f11e2624c6eeeeb5b3a9d9 (diff)
parente2ebc8f81138bcad019f43a3af0cddb0dc0dcfbc (diff)
downloadrust-e4c91e6c7cfc03246a422576ab41ac74125fd3b8.tar.gz
rust-e4c91e6c7cfc03246a422576ab41ac74125fd3b8.zip
auto merge of #12735 : eddyb/rust/at-exodus-chapter-11, r=cmr
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
-rw-r--r--src/libsyntax/parse/parser.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index f52effb8c81..27c86956499 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -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)
@@ -4150,7 +4150,7 @@ impl Parser {
                     outer_attrs: &[ast::Attribute],
                     id_sp: Span)
                     -> (ast::Item_, Vec<ast::Attribute> ) {
-        let mut prefix = Path::new(self.sess.cm.span_to_filename(self.span));
+        let mut prefix = Path::new(self.sess.span_diagnostic.cm.span_to_filename(self.span));
         prefix.pop();
         let mod_path = Path::new(".").join_many(self.mod_path_stack.as_slice());
         let dir_path = prefix.join(&mod_path);