SkipFunctionBodiesScope; improve fuzzy

This commit is contained in:
Fangrui Song 2018-08-26 17:22:45 -07:00
parent 99fe7c7624
commit 368bd9a283
2 changed files with 4 additions and 3 deletions

View File

@ -97,9 +97,10 @@ std::unique_ptr<ClangTranslationUnit> ClangTranslationUnit::Create(
/*CacheCodeCompletionResults=*/true, g_config->index.comments, /*CacheCodeCompletionResults=*/true, g_config->index.comments,
/*AllowPCHWithCompilerErrors=*/true, /*AllowPCHWithCompilerErrors=*/true,
#if LLVM_VERSION_MAJOR >= 7 #if LLVM_VERSION_MAJOR >= 7
SkipFunctionBodiesScope::None, diagnostic ? SkipFunctionBodiesScope::None
: SkipFunctionBodiesScope::PreambleAndMainFile,
#else #else
false, !diagnostic,
#endif #endif
/*SingleFileParse=*/false, /*SingleFileParse=*/false,
/*UserFilesAreVolatile=*/true, false, /*UserFilesAreVolatile=*/true, false,

View File

@ -31,7 +31,7 @@ void CalculateRoles(std::string_view s, int roles[], int *class_set) {
if (cur == Other) if (cur == Other)
return None; return None;
// U(U)L is Head while U(U)U is Tail // U(U)L is Head while U(U)U is Tail
return pre == Other || (cur == Upper && (pre == Lower || suc != Upper)) return pre == Other || (cur == Upper && (pre == Lower || suc == Lower))
? Head ? Head
: Tail; : Tail;
}; };