Changeset View
Changeset View
Standalone View
Standalone View
src/lib/rule.cpp
Show First 20 Lines • Show All 606 Lines • ▼ Show 20 Line(s) | 597 | if (result.capturedStart() == offset) { | |||
---|---|---|---|---|---|
607 | /** | 607 | /** | ||
608 | * else: ignore the implicit 0 group we always capture, no need to allocate stuff for that | 608 | * else: ignore the implicit 0 group we always capture, no need to allocate stuff for that | ||
609 | */ | 609 | */ | ||
610 | return MatchResult(offset + result.capturedLength()); | 610 | return MatchResult(offset + result.capturedLength()); | ||
611 | } | 611 | } | ||
612 | 612 | | |||
613 | /** | 613 | /** | ||
614 | * no match | 614 | * no match | ||
615 | * the pattern of a dynamic regex depends on the previous contexts | ||||
616 | * so that skipOffset cannot be computed | ||||
615 | */ | 617 | */ | ||
616 | return MatchResult(offset, result.capturedStart()); | 618 | return MatchResult(offset, m_dynamic ? 0 : result.capturedStart()); | ||
617 | } | 619 | } | ||
618 | 620 | | |||
619 | 621 | | |||
620 | bool StringDetect::doLoad(QXmlStreamReader& reader) | 622 | bool StringDetect::doLoad(QXmlStreamReader& reader) | ||
621 | { | 623 | { | ||
622 | m_string = reader.attributes().value(QStringLiteral("String")).toString(); | 624 | m_string = reader.attributes().value(QStringLiteral("String")).toString(); | ||
623 | m_caseSensitivity = Xml::attrToBool(reader.attributes().value(QStringLiteral("insensitive"))) ? Qt::CaseInsensitive : Qt::CaseSensitive; | 625 | m_caseSensitivity = Xml::attrToBool(reader.attributes().value(QStringLiteral("insensitive"))) ? Qt::CaseInsensitive : Qt::CaseSensitive; | ||
624 | m_dynamic = Xml::attrToBool(reader.attributes().value(QStringLiteral("dynamic"))); | 626 | m_dynamic = Xml::attrToBool(reader.attributes().value(QStringLiteral("dynamic"))); | ||
Show All 39 Lines |