| 176 | } |
| 177 | |
| 178 | void AsmHighlighter::highlightBlock(const QString &text) { |
| 179 | QRegularExpressionMatch match; |
| 180 | if ((match = labelPattern.match(text)).hasMatch()) { |
| 181 | setFormat(match.capturedStart(1), match.capturedLength(1), addressFormat); |
| 182 | setFormat(match.capturedStart(2), match.capturedLength(2), symbolFormat); |
| 183 | } else if ((match = instructionPattern.match(text)).hasMatch()) { |
| 184 | setFormat(match.capturedStart(1), match.capturedLength(1), addressFormat); |
| 185 | setFormat(match.capturedStart(2), match.capturedLength(2), watchRFormat); |
| 186 | setFormat(match.capturedStart(3), match.capturedLength(3), watchWFormat); |
| 187 | setFormat(match.capturedStart(4), match.capturedLength(4), breakPFormat); |
| 188 | setFormat(match.capturedStart(5), match.capturedLength(5), bytesFormat); |
| 189 | setFormat(match.capturedStart(6), match.capturedLength(6), mnemonicFormat); |
| 190 | foreach(const HighlightingRule &rule, highlightingRules) { |
| 191 | QRegularExpressionMatchIterator iter = rule.pattern.globalMatch(text, match.capturedEnd()); |
| 192 | while (iter.hasNext()) { |
| 193 | const auto& innerMatch = iter.next(); |
| 194 | if (innerMatch.hasMatch()) { |
| 195 | setFormat(innerMatch.capturedStart(), innerMatch.capturedLength(), rule.format); |
| 196 | } |
| 197 | } |
| 198 | } |
| 199 | } |
| 200 | } |
nothing calls this directly
no outgoing calls
no test coverage detected