MCPcopy Create free account
hub / github.com/Cubitect/cubiomes-viewer / nextBlockRule

Method nextBlockRule

src/scripts.cpp:429–450  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

427}
428
429BlockRule *LuaHighlighter::nextBlockRule(const QString& text, int *pos, int *next)
430{
431 BlockRule *rule = nullptr;
432 int min = INT_MAX;
433 int end = 0;
434 for (int i = 0, n = blockrules.size(); i < n; i++)
435 {
436 QRegularExpressionMatch m = blockrules[i].start.match(text, *pos);
437 if (m.hasMatch() && m.capturedStart() < min)
438 {
439 rule = &blockrules[i];
440 min = m.capturedStart();
441 end = m.capturedEnd();
442 }
443 }
444 if (rule)
445 {
446 *pos = min;
447 *next = end;
448 }
449 return rule;
450}
451
452void LuaHighlighter::highlightBlock(const QString& text)
453{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected