Allow supplying an error destination via the compiler driver
Allows replacing stderr with a buffer from the client. Also, some refactoring around run_compiler.
This commit is contained in:
parent
322b5530ba
commit
e8a4db25ac
6 changed files with 56 additions and 33 deletions
|
@ -38,10 +38,6 @@ pub struct JsonEmitter {
|
|||
}
|
||||
|
||||
impl JsonEmitter {
|
||||
pub fn basic() -> JsonEmitter {
|
||||
JsonEmitter::stderr(None, Rc::new(CodeMap::new()))
|
||||
}
|
||||
|
||||
pub fn stderr(registry: Option<Registry>,
|
||||
code_map: Rc<CodeMap>) -> JsonEmitter {
|
||||
JsonEmitter {
|
||||
|
@ -50,6 +46,20 @@ impl JsonEmitter {
|
|||
cm: code_map,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn basic() -> JsonEmitter {
|
||||
JsonEmitter::stderr(None, Rc::new(CodeMap::new()))
|
||||
}
|
||||
|
||||
pub fn new(dst: Box<Write + Send>,
|
||||
registry: Option<Registry>,
|
||||
code_map: Rc<CodeMap>) -> JsonEmitter {
|
||||
JsonEmitter {
|
||||
dst: dst,
|
||||
registry: registry,
|
||||
cm: code_map,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Emitter for JsonEmitter {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue