|
|
@ -328,29 +328,15 @@ fn read_query(language: &str, filename: &str) -> String {
|
|
|
|
|
|
|
|
|
|
|
|
let query = load_runtime_file(language, filename).unwrap_or_default();
|
|
|
|
let query = load_runtime_file(language, filename).unwrap_or_default();
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: the collect() is not ideal
|
|
|
|
// replaces all "; inherits <language>(,<language>)*" with the queries of the given language(s)
|
|
|
|
let inherits = INHERITS_REGEX
|
|
|
|
INHERITS_REGEX
|
|
|
|
.captures_iter(&query)
|
|
|
|
.replace_all(&query, |captures: ®ex::Captures| {
|
|
|
|
.flat_map(|captures| {
|
|
|
|
|
|
|
|
captures[1]
|
|
|
|
captures[1]
|
|
|
|
.split(',')
|
|
|
|
.split(',')
|
|
|
|
.map(str::to_owned)
|
|
|
|
.map(|language| format!("\n{}\n", read_query(language, filename)))
|
|
|
|
.collect::<Vec<_>>()
|
|
|
|
.collect::<String>()
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.collect::<Vec<_>>();
|
|
|
|
.to_string()
|
|
|
|
|
|
|
|
|
|
|
|
if inherits.is_empty() {
|
|
|
|
|
|
|
|
return query;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let mut queries = inherits
|
|
|
|
|
|
|
|
.iter()
|
|
|
|
|
|
|
|
.map(|language| read_query(language, filename))
|
|
|
|
|
|
|
|
.collect::<Vec<_>>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
queries.push(query);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
queries.concat()
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
impl LanguageConfiguration {
|
|
|
|
impl LanguageConfiguration {
|
|
|
|