Skip to content

Commit 5025d75

Browse files
committed
Try to fix HHVM build
1 parent c79ea6d commit 5025d75

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/PhpParser/Lexer.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ protected function resetErrors() {
9191
private function handleInvalidCharacterRange($start, $end, $line) {
9292
for ($i = $start; $i < $end; $i++) {
9393
$chr = $this->code[$i];
94+
if ($chr === 'b' || $chr === 'B') {
95+
// HHVM does not treat b" tokens correctly, so ignore these
96+
continue;
97+
}
98+
9499
if ($chr === "\0") {
95100
// PHP cuts error message after null byte, so need special case
96101
$errorMsg = 'Unexpected null byte';
@@ -99,6 +104,7 @@ private function handleInvalidCharacterRange($start, $end, $line) {
99104
'Unexpected character "%s" (ASCII %d)', $chr, ord($chr)
100105
);
101106
}
107+
102108
$this->errors[] = new Error($errorMsg, [
103109
'startLine' => $line,
104110
'endLine' => $line,

0 commit comments

Comments
 (0)