Fix parsing of wildcard patterns at the ends of documents

- Remove special EOF handling from lexer
- Explicitly exclude the EOF character from all-inclusive character sets.
This commit is contained in:
Max Brunsfeld 2014-09-11 13:10:23 -07:00
parent a2b80098b2
commit 68d6e242ee
8 changed files with 98 additions and 39 deletions

View file

@ -87,6 +87,7 @@ size_t CharacterSet::hash_code() const {
result ^= hash<size_t>()(included_chars.size());
for (auto &c : included_chars)
result ^= hash<uint32_t>()(c);
result <<= 1;
result ^= hash<size_t>()(excluded_chars.size());
for (auto &c : excluded_chars)
result ^= hash<uint32_t>()(c);
@ -118,6 +119,8 @@ string CharacterSet::to_string() const {
CharacterSet &CharacterSet::include_all() {
includes_all = true;
included_chars = {};
excluded_chars = { 0 };
return *this;
}