diff --git a/lib/PhpParser/Lexer.php b/lib/PhpParser/Lexer.php index 82b90c3..5a38516 100644 --- a/lib/PhpParser/Lexer.php +++ b/lib/PhpParser/Lexer.php @@ -278,6 +278,10 @@ class Lexer if (defined('T_ONUMBER')) { $tokenMap[T_ONUMBER] = Tokens::T_DNUMBER; } + // HHVM also has a separate token for the __COMPILER_HALT_OFFSET__ constant + if (defined('T_COMPILER_HALT_OFFSET')) { + $tokenMap[T_COMPILER_HALT_OFFSET] = Tokens::T_STRING; + } return $tokenMap; } diff --git a/test/code/parser/stmt/haltCompilerOffset.test b/test/code/parser/stmt/haltCompilerOffset.test new file mode 100644 index 0000000..6b47548 --- /dev/null +++ b/test/code/parser/stmt/haltCompilerOffset.test @@ -0,0 +1,34 @@ +Use of __HALT_COMPILER_OFFSET__ constant +----- +