You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PR 331 doesn't support PHP8 valid namespaces which are a single non-string token. For instance, while the first code block will work without issue on PHP8 (as T_NAME_QUALIFIED will be split to T_STRING T_NS_SEPARATOR T_STRING, resulting in Abstract being a T_STRING), the second will fail as token_get_all returns T_ABSTRACT and so the parser thinks that the namespace declaration is incomplete.
/* Name usable in a namespace declaration. */
namespace_declaration_name:
identifier { $$ = $1; }
| T_NAME_QUALIFIED { $$ = $1; }
;
namespace declaration names in php 8.0+ seem distinct from any other token - they can be one or more of any reserved word, keyword, or regular string separated by \. Keywords were forbidden before that.
(T_NAME_QUALIFIED is the case of 2 or more without whitespace, identifier is the single case)
PR 331 doesn't support PHP8 valid namespaces which are a single non-string token. For instance, while the first code block will work without issue on PHP8 (as
T_NAME_QUALIFIED
will be split toT_STRING T_NS_SEPARATOR T_STRING
, resulting inAbstract
being aT_STRING
), the second will fail as token_get_all returns T_ABSTRACT and so the parser thinks that the namespace declaration is incomplete.Works:
Valid PHP but doesn't work:
(
DiagnosticsProvider::getDiagnostics($astNode);
returns):The text was updated successfully, but these errors were encountered: