various: translation resources from cg backend
Extend `CodegenBackend` trait with a function returning the translation resources from the codegen backend, which can be added to the complete list of resources provided to the emitter. Signed-off-by: David Wood <david.wood@huawei.com>
This commit is contained in:
@@ -226,10 +226,7 @@ pub struct ParseSess {
|
||||
|
||||
impl ParseSess {
|
||||
/// Used for testing.
|
||||
pub fn new(
|
||||
locale_resources: &'static [&'static str],
|
||||
file_path_mapping: FilePathMapping,
|
||||
) -> Self {
|
||||
pub fn new(locale_resources: Vec<&'static str>, file_path_mapping: FilePathMapping) -> Self {
|
||||
let fallback_bundle = fallback_fluent_bundle(locale_resources, false);
|
||||
let sm = Lrc::new(SourceMap::new(file_path_mapping));
|
||||
let handler = Handler::with_tty_emitter(
|
||||
@@ -268,7 +265,7 @@ impl ParseSess {
|
||||
}
|
||||
|
||||
pub fn with_silent_emitter(fatal_note: Option<String>) -> Self {
|
||||
let fallback_bundle = fallback_fluent_bundle(&[], false);
|
||||
let fallback_bundle = fallback_fluent_bundle(Vec::new(), false);
|
||||
let sm = Lrc::new(SourceMap::new(FilePathMapping::empty()));
|
||||
let fatal_handler =
|
||||
Handler::with_tty_emitter(ColorConfig::Auto, false, None, None, None, fallback_bundle);
|
||||
|
||||
Reference in New Issue
Block a user