Fixed incorrect language detection with legacy “in-package” directives.

This commit is contained in:
2017-06-20 03:01:20 +02:00
parent 178a55d29e
commit 19f2ad19b0

View File

@@ -32,8 +32,10 @@ Language::Type detectLanguage(tokenize::Tokenizer<tokenize::CaseInsensitiveToken
tokenizer.skipWhiteSpace();
}
// PDDL contains sections starting with "(define"
if (tokenizer.testAndSkip<std::string>("(") && tokenizer.testAndSkip<std::string>("define"))
// PDDL contains sections starting with (define
// Some legacy domains contain “in-package” sections, however
if (tokenizer.testAndSkip<std::string>("(")
&& (tokenizer.testAndSkip<std::string>("define") || tokenizer.testAndSkip<std::string>("in-package")))
{
tokenizer.seek(std::ios::beg);
return Language::Type::PDDL;