CPP: Improve the regexp.

This commit is contained in:
Geoffrey White
2019-04-09 12:54:03 +01:00
parent d70e7ceafe
commit 13ed50f049
2 changed files with 5 additions and 1 deletions

View File

@@ -30,7 +30,7 @@ private predicate looksLikeCode(string line) {
)
) or (
// Match comment lines that look like preprocessor code
trimmed.regexpMatch("#(include|define|undef|if|ifdef|ifndef|elif|else|endif|error)(\\s.*|)")
trimmed.regexpMatch("#\\s*(include|define|undef|if|ifdef|ifndef|elif|else|endif|error|pragma)\\b.*")
)
) and (
// Exclude lines that start with '>' or contain '@{' or '@}'.