about summary refs log tree commit diff
path: root/src/comp/syntax/parse/parser.rs
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2012-01-13 16:05:58 -0800
committerBrian Anderson <banderson@mozilla.com>2012-01-13 16:06:56 -0800
commitced0aa13d385df40f21dcb8471326b2a6b08ba0f (patch)
tree05158b52a4a724704fbfc998eed34b5fc34ac7c5 /src/comp/syntax/parse/parser.rs
parentbb1e8d2339cfb360c845b7435e97b4f5eb241991 (diff)
downloadrust-ced0aa13d385df40f21dcb8471326b2a6b08ba0f.tar.gz
rust-ced0aa13d385df40f21dcb8471326b2a6b08ba0f.zip
rustc: Extract driver::diagnostic from syntax::codemap
Diffstat (limited to 'src/comp/syntax/parse/parser.rs')
-rw-r--r--src/comp/syntax/parse/parser.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/comp/syntax/parse/parser.rs b/src/comp/syntax/parse/parser.rs
index ad8eb0d5175..097ac8e7162 100644
--- a/src/comp/syntax/parse/parser.rs
+++ b/src/comp/syntax/parse/parser.rs
@@ -10,6 +10,7 @@ import util::interner;
 import ast::{node_id, spanned};
 import front::attr;
 import lexer::reader;
+import driver::diagnostic;
 
 tag restriction {
     UNRESTRICTED;
@@ -71,11 +72,11 @@ impl parser for parser {
         self.span_fatal(self.span, m);
     }
     fn span_fatal(sp: span, m: str) -> ! {
-        codemap::emit_error(some((self.sess.cm, sp)), m);
+        diagnostic::emit_error(some((self.sess.cm, sp)), m);
         fail;
     }
     fn warn(m: str) {
-        codemap::emit_warning(some((self.sess.cm, self.span)), m);
+        diagnostic::emit_warning(some((self.sess.cm, self.span)), m);
     }
     fn get_str(i: token::str_num) -> str {
         interner::get(*self.reader.interner, i)
@@ -92,7 +93,7 @@ fn new_parser_from_file(sess: parse_sess, cfg: ast::crate_cfg, path: str,
         src
       }
       result::err(e) {
-        codemap::emit_error(none, e);
+        diagnostic::emit_error(none, e);
         fail;
       }
     };
@@ -2525,7 +2526,7 @@ fn parse_crate_from_file(input: str, cfg: ast::crate_cfg, sess: parse_sess) ->
     } else if str::ends_with(input, ".rs") {
         parse_crate_from_source_file(input, cfg, sess)
     } else {
-        codemap::emit_error(none, "unknown input file type: " + input);
+        diagnostic::emit_error(none, "unknown input file type: " + input);
         fail
     }
 }