1
0
mirror of https://github.com/danog/PHP-Parser.git synced 2024-11-26 20:04:48 +01:00

Preserve case of "static" class name

This commit is contained in:
nikic 2014-08-11 21:44:50 +02:00
parent c0340053d1
commit ef121e690c
3 changed files with 3 additions and 3 deletions

View File

@ -678,7 +678,7 @@ function_call:
;
class_name:
T_STATIC { $$ = Name['static']; }
T_STATIC { $$ = Name[$1]; }
| name { $$ = $1; }
;

View File

@ -2167,7 +2167,7 @@ class Parser extends ParserAbstract
}
protected function reduceRule289($attributes) {
$this->semValue = new Node\Name('static', $attributes);
$this->semValue = new Node\Name($this->semStack[$this->stackPos-(1-1)], $attributes);
}
protected function reduceRule290($attributes) {

View File

@ -343,6 +343,6 @@ EOC;
$this->assertEquals('SELF', (string)$methodStmt->stmts[0]->class);
$this->assertEquals('PARENT', (string)$methodStmt->stmts[1]->class);
$this->assertEquals('static', (string)$methodStmt->stmts[2]->class);
$this->assertEquals('STATIC', (string)$methodStmt->stmts[2]->class);
}
}