Specify c language explicitly when compiling test parsers

This commit is contained in:
Max Brunsfeld 2016-12-20 17:28:28 -08:00
parent e6c82ead2c
commit 006e9fe4a6

View file

@ -97,7 +97,11 @@ const TSLanguage *load_language(const string &source_filename,
if (!external_scanner_filename.empty()) {
string extension = external_scanner_filename.substr(external_scanner_filename.rfind("."));
if (extension != ".c") compile_args.push_back("-xc++");
if (extension == ".c") {
compile_args.push_back("-xc");
} else {
compile_args.push_back("-xc++");
}
compile_args.push_back(external_scanner_filename.c_str());
}