Add -xc compiler flag for pure-C external scanners

This commit is contained in:
Max Brunsfeld 2019-01-15 16:12:30 -08:00
parent ceff3936ef
commit 0ee11584a7

View file

@ -188,7 +188,7 @@ impl Loader {
.arg(parser_path);
if let Some(scanner_path) = scanner_path.as_ref() {
if scanner_path.extension() == Some("c".as_ref()) {
command.arg(scanner_path);
command.arg("-xc").arg("-std=c99").arg(scanner_path);
} else {
command.arg("-xc++").arg(scanner_path);
}
@ -271,7 +271,11 @@ impl Loader {
}
self.language_repos.push(LanguageRepo {
name: package_json.name.split_at("tree-sitter-".len()).1.to_string(),
name: package_json
.name
.split_at("tree-sitter-".len())
.1
.to_string(),
path: parser_path.to_owned(),
language: None,
configurations,