function Scanner::adjustColumnAndLine
Increases columns and lines count according to the given string
Parameters
string $buffer String to analyze:
Return value
void
2 calls to Scanner::adjustColumnAndLine()
- Scanner::consumeUntil in vendor/
mck89/ peast/ lib/ Peast/ Syntax/ Scanner.php - Consumes characters until one of the given characters is found
- Scanner::skipWhitespacesAndComments in vendor/
mck89/ peast/ lib/ Peast/ Syntax/ Scanner.php - Skips whitespaces and comments from the current scan position. If comments handling is enabled, the array of parsed comments
File
-
vendor/
mck89/ peast/ lib/ Peast/ Syntax/ Scanner.php, line 1774
Class
- Scanner
- Base class for scanners.
Namespace
Peast\SyntaxCode
protected function adjustColumnAndLine($buffer) {
$lines = preg_split($this->linesSplitter, $buffer);
$linesCount = count($lines) - 1;
$this->line += $linesCount;
$columns = mb_strlen($lines[$linesCount], "UTF-8");
if ($linesCount) {
$this->column = $columns;
}
else {
$this->column += $columns;
}
}