]> git.sesse.net Git - plocate/blobdiff - parse_trigrams.h
Remove dependency on non-POSIX header error.h.
[plocate] / parse_trigrams.h
index 9c8cdf2b62a7b80b565a5e3447fb7531260de3b2..2387c9078c3bd6c0dded9bd8d940289ecee37aa1 100644 (file)
@@ -11,7 +11,7 @@
 // One or more trigrams, with an implicit OR between them. For case-sensitive searches,
 // this is just e.g. “abc”, but for case-insensitive, it would be “abc OR abC or aBc ...” etc.
 struct TrigramDisjunction {
-       unsigned index;  // For debugging only.
+       unsigned index = -1;  // For debugging only.
 
        // The alternatives as determined by parse_trigrams().
        std::vector<uint32_t> trigram_alternatives;
@@ -58,7 +58,7 @@ static constexpr uint32_t PREMATURE_END_UNIGRAM = 0xFF000001;
 
 // Reads a unigram, taking into account escaping (\<foo> becomes <foo>).
 // Returns WILDCARD_UNIGRAM if there's an invalid unigram, ie., we found
-// a glob character (?, * or a [] group). Returns EOS_UNIGRAM if we went
+// a glob character (?, * or a [] group). Returns PREMATURE_END_UNIGRAM if we went
 // past the end of the string, e.g., a string that ends in a backslash.
 // The second element is always the length.
 std::pair<uint32_t, size_t> read_unigram(const std::string &s, size_t start);