Report fatal lexer errors in --cfg
command line arguments
This commit is contained in:
parent
ed937594d3
commit
041212f8fb
5 changed files with 37 additions and 7 deletions
|
@ -174,9 +174,14 @@ impl ParseSess {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn with_silent_emitter() -> Self {
|
||||
pub fn with_silent_emitter(fatal_note: Option<String>) -> Self {
|
||||
let sm = Lrc::new(SourceMap::new(FilePathMapping::empty()));
|
||||
let handler = Handler::with_emitter(false, None, Box::new(SilentEmitter));
|
||||
let fatal_handler = Handler::with_tty_emitter(ColorConfig::Auto, false, None, None);
|
||||
let handler = Handler::with_emitter(
|
||||
false,
|
||||
None,
|
||||
Box::new(SilentEmitter { fatal_handler, fatal_note }),
|
||||
);
|
||||
ParseSess::with_span_handler(handler, sm)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue