|
| 1 | +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT |
| 2 | +// file at the top-level directory of this distribution and at |
| 3 | +// http://rust-lang.org/COPYRIGHT. |
| 4 | +// |
| 5 | +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or |
| 6 | +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license |
| 7 | +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your |
| 8 | +// option. This file may not be copied, modified, or distributed |
| 9 | +// except according to those terms. |
| 10 | + |
| 11 | +//! A JSON emitter for errors. |
| 12 | +
|
| 13 | +use codemap::{Span, CodeMap}; |
| 14 | +use diagnostics::registry::Registry; |
| 15 | +use errors::{Level, DiagnosticBuilder, RenderSpan}; |
| 16 | +use errors::emitter::Emitter; |
| 17 | + |
| 18 | +use std::rc::Rc; |
| 19 | + |
| 20 | +pub struct JsonEmitter { |
| 21 | + todo: i32 |
| 22 | +} |
| 23 | + |
| 24 | +impl JsonEmitter { |
| 25 | + pub fn basic() -> JsonEmitter { |
| 26 | + JsonEmitter { |
| 27 | + todo: 42, |
| 28 | + } |
| 29 | + } |
| 30 | + |
| 31 | + pub fn stderr(registry: Option<Registry>, |
| 32 | + code_map: Rc<CodeMap>) -> JsonEmitter { |
| 33 | + JsonEmitter { |
| 34 | + todo: 42, |
| 35 | + } |
| 36 | + } |
| 37 | +} |
| 38 | + |
| 39 | +impl Emitter for JsonEmitter { |
| 40 | + fn emit(&mut self, span: Option<Span>, msg: &str, code: Option<&str>, lvl: Level) { |
| 41 | + unimplemented!(); |
| 42 | + |
| 43 | + } |
| 44 | + |
| 45 | + fn custom_emit(&mut self, sp: RenderSpan, msg: &str, lvl: Level) { |
| 46 | + unimplemented!(); |
| 47 | + |
| 48 | + } |
| 49 | + |
| 50 | + fn emit_struct(&mut self, db: &DiagnosticBuilder) { |
| 51 | + unimplemented!(); |
| 52 | + } |
| 53 | +} |
0 commit comments