Skip to content

Commit

Permalink
Closes #290, unexpected token T_ARRAY
Browse files Browse the repository at this point in the history
  • Loading branch information
Manuel Pichler committed Jan 7, 2017
1 parent ee81e96 commit d4bf7bb
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 3 deletions.
Expand Up @@ -46,7 +46,6 @@
use PDepend\Source\AST\ASTAllocationExpression;
use PDepend\Source\AST\ASTExpression;
use PDepend\Source\AST\ASTNode;
use PDepend\Source\Tokenizer\Token;
use PDepend\Source\Tokenizer\Tokens;

/**
Expand Down Expand Up @@ -77,6 +76,8 @@ protected function isMethodName($tokenType)
switch ($tokenType) {
case Tokens::T_EMPTY:
case Tokens::T_LIST:
case Tokens::T_ARRAY:
case Tokens::T_NEW:
return true;
}
return parent::isMethodName($tokenType);
Expand Down
Expand Up @@ -478,4 +478,12 @@ public function testUniformVariableSyntax()
{
$this->assertNotNull($this->parseCodeResourceForTest());
}

/**
* @return void
*/
public function testConstantNameArray()
{
$this->assertNotNull($this->parseCodeResourceForTest());
}
}
Expand Up @@ -483,6 +483,14 @@ public function testUniformVariableSyntax()
$this->assertNotNull($this->parseCodeResourceForTest());
}

/**
* @return void
*/
public function testConstantNameArray()
{
$this->assertNotNull($this->parseCodeResourceForTest());
}

/**
* @param \PDepend\Source\Tokenizer\Tokenizer $tokenizer
* @param \PDepend\Source\Builder\Builder $builder
Expand Down
@@ -1,8 +1,8 @@
<?php
class testParserThrowsExpectedExceptionForInvalidToken
{
public function array()
public function 42()
{

}
}
}
@@ -0,0 +1,5 @@
<?php
class ConstantNames
{
const ARRAY = 42;
}
@@ -0,0 +1,5 @@
<?php
class ConstantNames
{
const ARRAY = 42;
}

0 comments on commit d4bf7bb

Please sign in to comment.