]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
ComponentRepeat: wire X{0,N} and (X?){N} the same
authorJustin Viiret <justin.viiret@intel.com>
Mon, 4 Jan 2016 04:23:28 +0000 (15:23 +1100)
committerMatthew Barr <matthew.barr@intel.com>
Tue, 1 Mar 2016 00:22:45 +0000 (11:22 +1100)
src/parser/ComponentRepeat.cpp

index 5ce703acbcc84e08c6852280b84df5ba19b85ef1..670cee37e1d69b926f6b7d0708b3f8c36ffd19d9 100644 (file)
@@ -349,18 +349,7 @@ void ComponentRepeat::precalc_firsts() {
 
     assert(!m_firsts.empty()); // notePositions should already have run
     const vector<PositionInfo> &f = m_firsts.front();
-
-    if (sub_comp->empty()) {
-        // Emptiable: all our repeats contribute to firsts.
-        // Each repeat's firsts is spliced in at the location of the epsilon
-        // (if any) in the previous repeat's firsts.
-        for (const auto &e : m_firsts) {
-            replaceEpsilons(firsts_cache, e);
-        }
-    } else {
-        // Not emptiable: firsts come from our first repeat only.
-        firsts_cache.insert(firsts_cache.end(), f.begin(), f.end());
-    }
+    firsts_cache.insert(firsts_cache.end(), f.begin(), f.end());
 }
 
 static