Support visibility modifiers in namespaced names

Fixes #704.
This commit is contained in:
Nikita Popov 2020-08-29 16:35:31 +02:00
parent ad365b1beb
commit 35306de32f
2 changed files with 18 additions and 0 deletions

View File

@ -494,6 +494,7 @@ class Lexer
// Based on semi_reserved production. // Based on semi_reserved production.
return array_fill_keys([ return array_fill_keys([
\T_STRING, \T_STRING,
\T_STATIC, \T_ABSTRACT, \T_FINAL, \T_PRIVATE, \T_PROTECTED, \T_PUBLIC,
\T_INCLUDE, \T_INCLUDE_ONCE, \T_EVAL, \T_REQUIRE, \T_REQUIRE_ONCE, \T_LOGICAL_OR, \T_LOGICAL_XOR, \T_LOGICAL_AND, \T_INCLUDE, \T_INCLUDE_ONCE, \T_EVAL, \T_REQUIRE, \T_REQUIRE_ONCE, \T_LOGICAL_OR, \T_LOGICAL_XOR, \T_LOGICAL_AND,
\T_INSTANCEOF, \T_NEW, \T_CLONE, \T_EXIT, \T_IF, \T_ELSEIF, \T_ELSE, \T_ENDIF, \T_ECHO, \T_DO, \T_WHILE, \T_INSTANCEOF, \T_NEW, \T_CLONE, \T_EXIT, \T_IF, \T_ELSEIF, \T_ELSE, \T_ENDIF, \T_ECHO, \T_DO, \T_WHILE,
\T_ENDWHILE, \T_FOR, \T_ENDFOR, \T_FOREACH, \T_ENDFOREACH, \T_DECLARE, \T_ENDDECLARE, \T_AS, \T_TRY, \T_CATCH, \T_ENDWHILE, \T_FOR, \T_ENDFOR, \T_FOREACH, \T_ENDFOREACH, \T_DECLARE, \T_ENDDECLARE, \T_AS, \T_TRY, \T_CATCH,

View File

@ -9,6 +9,7 @@ namespace static;
fn\use(); fn\use();
\fn\use(); \fn\use();
namespace\fn\use(); namespace\fn\use();
private\protected\public\static\abstract\final();
----- -----
!!php7 !!php7
array( array(
@ -92,6 +93,22 @@ array(
) )
) )
) )
3: Stmt_Expression(
expr: Expr_FuncCall(
name: Name(
parts: array(
0: private
1: protected
2: public
3: static
4: abstract
5: final
)
)
args: array(
)
)
)
) )
) )
) )