Minor refactor

This commit is contained in:
Timothy Warren 2019-11-06 14:55:32 -05:00
parent d3bf9294cc
commit ae5228a6f1

View File

@ -526,13 +526,14 @@ class Row {
{ {
continue; continue;
} }
$charEnd = $charStart + $charLen;
// Probably not great to create a closure in a loop like this, but // Probably not great to create a closure in a loop like this, but
// this halves the boilerplate for each type of syntax // this halves the boilerplate for each type of syntax
$highlightRange = function (int $hl) use ($charLen, $charStart, $charEnd, &$offset) { $highlightRange = function (int $hl) use ($charLen, $charStart, &$offset) {
array_replace_range($this->hl, $charStart, $charLen, $hl); array_replace_range($this->hl, $charStart, $charLen, $hl);
$offset = $charEnd;
// Update the offset to the end of the current token
$offset = $charStart + $charLen;
}; };
// Start of multiline comment/single line comment // Start of multiline comment/single line comment