diff options
| author | klutzy <klutzytheklutzy@gmail.com> | 2013-12-31 23:17:59 +0900 |
|---|---|---|
| committer | klutzy <klutzytheklutzy@gmail.com> | 2014-01-01 19:10:43 +0900 |
| commit | fe10c63326eee6220900dcbb92197ccf26e2025b (patch) | |
| tree | d19b12845e153c61d0d68267b50e93afc2f4f3a4 /src/libsyntax/parse | |
| parent | a52cdfdfce58c3fda80d4503a2b198546f96b6c0 (diff) | |
| download | rust-fe10c63326eee6220900dcbb92197ccf26e2025b.tar.gz rust-fe10c63326eee6220900dcbb92197ccf26e2025b.zip | |
syntax::diagnostic: Remove unnecessary traits
This removes trait `handler` and `span_handler`, and renames `HandlerT` to `Handler`, `CodemapT` to `SpanHandler`.
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/comments.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/parse/lexer.rs | 14 | ||||
| -rw-r--r-- | src/libsyntax/parse/mod.rs | 6 |
3 files changed, 11 insertions, 11 deletions
diff --git a/src/libsyntax/parse/comments.rs b/src/libsyntax/parse/comments.rs index 0704bf913d7..b1390253d19 100644 --- a/src/libsyntax/parse/comments.rs +++ b/src/libsyntax/parse/comments.rs @@ -342,7 +342,7 @@ pub struct lit { // it appears this function is called only from pprust... that's // probably not a good thing. pub fn gather_comments_and_literals(span_diagnostic: - @mut diagnostic::span_handler, + @mut diagnostic::SpanHandler, path: @str, srdr: &mut io::Reader) -> (~[cmnt], ~[lit]) { diff --git a/src/libsyntax/parse/lexer.rs b/src/libsyntax/parse/lexer.rs index d48c1d9d8d7..8b7ef6d9cf8 100644 --- a/src/libsyntax/parse/lexer.rs +++ b/src/libsyntax/parse/lexer.rs @@ -11,7 +11,7 @@ use ast; use codemap::{BytePos, CharPos, CodeMap, Pos, Span}; use codemap; -use diagnostic::span_handler; +use diagnostic::SpanHandler; use ext::tt::transcribe::{tt_next_token}; use ext::tt::transcribe::{dup_tt_reader}; use parse::token; @@ -29,7 +29,7 @@ pub trait reader { fn is_eof(@mut self) -> bool; fn next_token(@mut self) -> TokenAndSpan; fn fatal(@mut self, ~str) -> !; - fn span_diag(@mut self) -> @mut span_handler; + fn span_diag(@mut self) -> @mut SpanHandler; fn peek(@mut self) -> TokenAndSpan; fn dup(@mut self) -> @mut reader; } @@ -41,7 +41,7 @@ pub struct TokenAndSpan { } pub struct StringReader { - span_diagnostic: @mut span_handler, + span_diagnostic: @mut SpanHandler, src: @str, // The absolute offset within the codemap of the next character to read pos: BytePos, @@ -57,7 +57,7 @@ pub struct StringReader { peek_span: Span } -pub fn new_string_reader(span_diagnostic: @mut span_handler, +pub fn new_string_reader(span_diagnostic: @mut SpanHandler, filemap: @codemap::FileMap) -> @mut StringReader { let r = new_low_level_string_reader(span_diagnostic, filemap); @@ -66,7 +66,7 @@ pub fn new_string_reader(span_diagnostic: @mut span_handler, } /* For comments.rs, which hackily pokes into 'pos' and 'curr' */ -pub fn new_low_level_string_reader(span_diagnostic: @mut span_handler, +pub fn new_low_level_string_reader(span_diagnostic: @mut SpanHandler, filemap: @codemap::FileMap) -> @mut StringReader { // Force the initial reader bump to start on a fresh line @@ -118,7 +118,7 @@ impl reader for StringReader { fn fatal(@mut self, m: ~str) -> ! { self.span_diagnostic.span_fatal(self.peek_span, m) } - fn span_diag(@mut self) -> @mut span_handler { self.span_diagnostic } + fn span_diag(@mut self) -> @mut SpanHandler { self.span_diagnostic } fn peek(@mut self) -> TokenAndSpan { // XXX(pcwalton): Bad copy! TokenAndSpan { @@ -139,7 +139,7 @@ impl reader for TtReader { fn fatal(@mut self, m: ~str) -> ! { self.sp_diag.span_fatal(self.cur_span, m); } - fn span_diag(@mut self) -> @mut span_handler { self.sp_diag } + fn span_diag(@mut self) -> @mut SpanHandler { self.sp_diag } fn peek(@mut self) -> TokenAndSpan { TokenAndSpan { tok: self.cur_tok.clone(), diff --git a/src/libsyntax/parse/mod.rs b/src/libsyntax/parse/mod.rs index 73240a9effd..8aedc146240 100644 --- a/src/libsyntax/parse/mod.rs +++ b/src/libsyntax/parse/mod.rs @@ -14,7 +14,7 @@ use ast; use codemap::{Span, CodeMap, FileMap, FileSubstr}; use codemap; -use diagnostic::{span_handler, mk_span_handler, mk_handler, Emitter}; +use diagnostic::{SpanHandler, mk_span_handler, mk_handler, Emitter}; use parse::attr::parser_attr; use parse::lexer::reader; use parse::parser::Parser; @@ -41,7 +41,7 @@ pub mod obsolete; // info about a parsing session. pub struct ParseSess { cm: @codemap::CodeMap, // better be the same as the one in the reader! - span_diagnostic: @mut span_handler, // better be the same as the one in the reader! + span_diagnostic: @mut SpanHandler, // better be the same as the one in the reader! /// Used to determine and report recursive mod inclusions included_mod_stack: ~[Path], } @@ -55,7 +55,7 @@ pub fn new_parse_sess(demitter: Option<@Emitter>) -> @mut ParseSess { } } -pub fn new_parse_sess_special_handler(sh: @mut span_handler, +pub fn new_parse_sess_special_handler(sh: @mut SpanHandler, cm: @codemap::CodeMap) -> @mut ParseSess { @mut ParseSess { |
