Skip to content

Commit

Permalink
Add :: as another separator for composed identifiers in PHP. Fixes #749
Browse files Browse the repository at this point in the history
…, #653.
  • Loading branch information
isagalaev committed Mar 10, 2015
1 parent 5e12a7a commit d49e9fb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/languages/php.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ function(hljs) {
PREPROCESSOR,
VARIABLE,
{
// swallow class members to avoid parsing them as keywords
begin: /->+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/
// swallow composed identifiers to avoid parsing them as keywords
begin: /(::|->)+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/
},
{
className: 'function',
Expand Down
2 changes: 1 addition & 1 deletion test/detect/php/default.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ line description';
}

$this->var = 0 - self::$st;
$this->list = list(Array("1"=> 2, 2=>self::ME));
$this->list = list(Array("1"=> 2, 2=>self::ME, 3 => \Location\Web\URI::class));

return [
'uri' => $uri,
Expand Down

0 comments on commit d49e9fb

Please sign in to comment.