Lines Matching refs:Pattern
24 bool matchFilePath(StringRef Pattern, StringRef FilePath) { in matchFilePath() argument
25 assert(!Pattern.empty()); in matchFilePath()
30 if (const auto C = Pattern.back(); !strchr("?*]", C) && C != FilePath.back()) in matchFilePath()
34 const auto EOP = Pattern.size(); // End of `Pattern`. in matchFilePath()
42 switch (const auto F = FilePath[J]; Pattern[I]) { in matchFilePath()
44 if (++I == EOP || F != Pattern[I]) in matchFilePath()
52 while (++I < EOP && Pattern[I] == '*') { // Skip consecutive stars. in matchFilePath()
59 if (Pattern[I] == '\\' && ++I == EOP) in matchFilePath()
62 if (Pattern[I] == Separator) { in matchFilePath()
69 for (auto Pat = Pattern.substr(I); J < End && FilePath[J] != Separator; in matchFilePath()
78 if (I + 3 < EOP || (I + 3 == EOP && Pattern[I + 1] != '!')) { in matchFilePath()
80 if (const auto K = Pattern.find_first_of("]/", I + 1); in matchFilePath()
81 K != StringRef::npos && Pattern[K] == ']' && K > I + 1) { in matchFilePath()
86 if (Pattern[I] == '!') { in matchFilePath()
92 if (I + 2 < K && Pattern[I + 1] == '-') { in matchFilePath()
93 Match = Pattern[I] <= F && F <= Pattern[I + 2]; in matchFilePath()
96 Match = F == Pattern[I++]; in matchFilePath()
107 if (F != Pattern[I]) in matchFilePath()
115 while (I < EOP && Pattern[I] == '*') in matchFilePath()