1
0
mirror of https://github.com/danog/PHP-Parser.git synced 2024-11-27 04:14:44 +01:00

Rename "ns" to "name" in Stmt_UseUse

This commit is contained in:
nikic 2011-08-04 12:01:03 +02:00
parent 70306000e8
commit dd2404b57a
6 changed files with 19 additions and 19 deletions

View File

@ -140,10 +140,10 @@ use_declarations:
;
use_declaration:
namespace_name { $$ = new PHPParser_Node_Stmt_UseUse(array('ns' => $1, 'alias' => null), #line, #docComment); }
| namespace_name T_AS T_STRING { $$ = new PHPParser_Node_Stmt_UseUse(array('ns' => $1, 'alias' => $3), #line, #docComment); }
| T_NS_SEPARATOR namespace_name { $$ = new PHPParser_Node_Stmt_UseUse(array('ns' => $2, 'alias' => null), #line, #docComment); }
| T_NS_SEPARATOR namespace_name T_AS T_STRING { $$ = new PHPParser_Node_Stmt_UseUse(array('ns' => $2, 'alias' => $4), #line, #docComment); }
namespace_name { $$ = new PHPParser_Node_Stmt_UseUse(array('name' => $1, 'alias' => null), #line, #docComment); }
| namespace_name T_AS T_STRING { $$ = new PHPParser_Node_Stmt_UseUse(array('name' => $1, 'alias' => $3), #line, #docComment); }
| T_NS_SEPARATOR namespace_name { $$ = new PHPParser_Node_Stmt_UseUse(array('name' => $2, 'alias' => null), #line, #docComment); }
| T_NS_SEPARATOR namespace_name T_AS T_STRING { $$ = new PHPParser_Node_Stmt_UseUse(array('name' => $2, 'alias' => $4), #line, #docComment); }
;
constant_declaration:

View File

@ -140,10 +140,10 @@ use_declarations:
;
use_declaration:
namespace_name { $$ = Stmt_UseUse[ns: $1, alias: null]; }
| namespace_name T_AS T_STRING { $$ = Stmt_UseUse[ns: $1, alias: $3]; }
| T_NS_SEPARATOR namespace_name { $$ = Stmt_UseUse[ns: $2, alias: null]; }
| T_NS_SEPARATOR namespace_name T_AS T_STRING { $$ = Stmt_UseUse[ns: $2, alias: $4]; }
namespace_name { $$ = Stmt_UseUse[name: $1, alias: null]; }
| namespace_name T_AS T_STRING { $$ = Stmt_UseUse[name: $1, alias: $3]; }
| T_NS_SEPARATOR namespace_name { $$ = Stmt_UseUse[name: $2, alias: null]; }
| T_NS_SEPARATOR namespace_name T_AS T_STRING { $$ = Stmt_UseUse[name: $2, alias: $4]; }
;
constant_declaration:

View File

@ -1,8 +1,8 @@
<?php
/**
* @property PHPParser_Node_Name $ns Namespace/Class to alias
* @property string $alias Alias
* @property PHPParser_Node_Name $name Namespace/Class to alias
* @property null|string $alias Alias
*/
class PHPParser_Node_Stmt_UseUse extends PHPParser_Node_Stmt
{

View File

@ -1072,19 +1072,19 @@ class PHPParser_Parser
}
private function yyn18($line, $docComment) {
$this->yyval = new PHPParser_Node_Stmt_UseUse(array('ns' => $this->yyastk[$this->yysp-(1-1)], 'alias' => null), $line, $docComment);
$this->yyval = new PHPParser_Node_Stmt_UseUse(array('name' => $this->yyastk[$this->yysp-(1-1)], 'alias' => null), $line, $docComment);
}
private function yyn19($line, $docComment) {
$this->yyval = new PHPParser_Node_Stmt_UseUse(array('ns' => $this->yyastk[$this->yysp-(3-1)], 'alias' => $this->yyastk[$this->yysp-(3-3)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Stmt_UseUse(array('name' => $this->yyastk[$this->yysp-(3-1)], 'alias' => $this->yyastk[$this->yysp-(3-3)]), $line, $docComment);
}
private function yyn20($line, $docComment) {
$this->yyval = new PHPParser_Node_Stmt_UseUse(array('ns' => $this->yyastk[$this->yysp-(2-2)], 'alias' => null), $line, $docComment);
$this->yyval = new PHPParser_Node_Stmt_UseUse(array('name' => $this->yyastk[$this->yysp-(2-2)], 'alias' => null), $line, $docComment);
}
private function yyn21($line, $docComment) {
$this->yyval = new PHPParser_Node_Stmt_UseUse(array('ns' => $this->yyastk[$this->yysp-(4-2)], 'alias' => $this->yyastk[$this->yysp-(4-4)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Stmt_UseUse(array('name' => $this->yyastk[$this->yysp-(4-2)], 'alias' => $this->yyastk[$this->yysp-(4-4)]), $line, $docComment);
}
private function yyn22($line, $docComment) {

View File

@ -1471,19 +1471,19 @@ class PHPParser_ParserDebug
}
private function yyn18($line, $docComment) {
$this->yyval = new PHPParser_Node_Stmt_UseUse(array('ns' => $this->yyastk[$this->yysp-(1-1)], 'alias' => null), $line, $docComment);
$this->yyval = new PHPParser_Node_Stmt_UseUse(array('name' => $this->yyastk[$this->yysp-(1-1)], 'alias' => null), $line, $docComment);
}
private function yyn19($line, $docComment) {
$this->yyval = new PHPParser_Node_Stmt_UseUse(array('ns' => $this->yyastk[$this->yysp-(3-1)], 'alias' => $this->yyastk[$this->yysp-(3-3)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Stmt_UseUse(array('name' => $this->yyastk[$this->yysp-(3-1)], 'alias' => $this->yyastk[$this->yysp-(3-3)]), $line, $docComment);
}
private function yyn20($line, $docComment) {
$this->yyval = new PHPParser_Node_Stmt_UseUse(array('ns' => $this->yyastk[$this->yysp-(2-2)], 'alias' => null), $line, $docComment);
$this->yyval = new PHPParser_Node_Stmt_UseUse(array('name' => $this->yyastk[$this->yysp-(2-2)], 'alias' => null), $line, $docComment);
}
private function yyn21($line, $docComment) {
$this->yyval = new PHPParser_Node_Stmt_UseUse(array('ns' => $this->yyastk[$this->yysp-(4-2)], 'alias' => $this->yyastk[$this->yysp-(4-4)]), $line, $docComment);
$this->yyval = new PHPParser_Node_Stmt_UseUse(array('name' => $this->yyastk[$this->yysp-(4-2)], 'alias' => $this->yyastk[$this->yysp-(4-4)]), $line, $docComment);
}
private function yyn22($line, $docComment) {

View File

@ -433,7 +433,7 @@ class PHPParser_PrettyPrinter_Zend extends PHPParser_PrettyPrinterAbstract
}
public function pStmt_UseUse(PHPParser_Node_Stmt_UseUse $node) {
return $this->p($node->ns) . (null !== $node->alias ? ' as ' . $node->alias : '');
return $this->p($node->name) . (null !== $node->alias ? ' as ' . $node->alias : '');
}
public function pStmt_Interface(PHPParser_Node_Stmt_Interface $node) {