Changeset View
Changeset View
Standalone View
Standalone View
src/utils/katecommandrangeexpressionparser.cpp
Show All 40 Lines | 35 | { | |||
---|---|---|---|---|---|
41 | m_forwardSearch2.setPattern(QStringLiteral("/[^/]*/?")); // no group | 41 | m_forwardSearch2.setPattern(QStringLiteral("/[^/]*/?")); // no group | ||
42 | m_backwardSearch.setPattern(QStringLiteral("\\?([^?]*)\\??")); | 42 | m_backwardSearch.setPattern(QStringLiteral("\\?([^?]*)\\??")); | ||
43 | m_backwardSearch2.setPattern(QStringLiteral("\\?[^?]*\\??")); // no group | 43 | m_backwardSearch2.setPattern(QStringLiteral("\\?[^?]*\\??")); // no group | ||
44 | m_base.setPattern(QLatin1String("(?:") + m_mark.pattern() + QLatin1String(")|(?:") + | 44 | m_base.setPattern(QLatin1String("(?:") + m_mark.pattern() + QLatin1String(")|(?:") + | ||
45 | m_line.pattern() + QLatin1String(")|(?:") + | 45 | m_line.pattern() + QLatin1String(")|(?:") + | ||
46 | m_thisLine.pattern() + QLatin1String(")|(?:") + | 46 | m_thisLine.pattern() + QLatin1String(")|(?:") + | ||
47 | m_lastLine.pattern() + QLatin1String(")|(?:") + | 47 | m_lastLine.pattern() + QLatin1String(")|(?:") + | ||
48 | m_forwardSearch2.pattern() + QLatin1String(")|(?:") + | 48 | m_forwardSearch2.pattern() + QLatin1String(")|(?:") + | ||
49 | m_backwardSearch2.pattern() + QLatin1String(")")); | 49 | m_backwardSearch2.pattern() + QLatin1Char(')')); | ||
50 | m_offset.setPattern(QLatin1String("[+-](?:") + m_base.pattern() + QLatin1String(")?")); | 50 | m_offset.setPattern(QLatin1String("[+-](?:") + m_base.pattern() + QLatin1String(")?")); | ||
51 | 51 | | |||
52 | // The position regexp contains two groups: the base and the offset. | 52 | // The position regexp contains two groups: the base and the offset. | ||
53 | // The offset may be empty. | 53 | // The offset may be empty. | ||
54 | m_position.setPattern(QLatin1String("(") + m_base.pattern() + QLatin1String(")((?:") + m_offset.pattern() + QLatin1String(")*)")); | 54 | m_position.setPattern(QLatin1Char('(') + m_base.pattern() + QLatin1String(")((?:") + m_offset.pattern() + QLatin1String(")*)")); | ||
55 | 55 | | |||
56 | // The range regexp contains seven groups: the first is the start position, the second is | 56 | // The range regexp contains seven groups: the first is the start position, the second is | ||
57 | // the base of the start position, the third is the offset of the start position, the | 57 | // the base of the start position, the third is the offset of the start position, the | ||
58 | // fourth is the end position including a leading comma, the fifth is end position | 58 | // fourth is the end position including a leading comma, the fifth is end position | ||
59 | // without the comma, the sixth is the base of the end position, and the seventh is the | 59 | // without the comma, the sixth is the base of the end position, and the seventh is the | ||
60 | // offset of the end position. The third and fourth groups may be empty, and the | 60 | // offset of the end position. The third and fourth groups may be empty, and the | ||
61 | // fifth, sixth and seventh groups are contingent on the fourth group. | 61 | // fifth, sixth and seventh groups are contingent on the fourth group. | ||
62 | m_cmdRange.setPattern(QLatin1String("^(") + m_position.pattern() + QLatin1String(")((?:,(") + m_position.pattern() + QLatin1String("))?)")); | 62 | m_cmdRange.setPattern(QLatin1String("^(") + m_position.pattern() + QLatin1String(")((?:,(") + m_position.pattern() + QLatin1String("))?)")); | ||
▲ Show 20 Lines • Show All 111 Lines • Show Last 20 Lines |