Minor refactor
This commit is contained in:
parent
d3bf9294cc
commit
ae5228a6f1
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user