Skip to content

Support parsing php 8.3 typed class constants#406

Open
TysonAndre wants to merge 4 commits intomicrosoft:mainfrom
TysonAndre:parse-typed-class-const
Open

Support parsing php 8.3 typed class constants#406
TysonAndre wants to merge 4 commits intomicrosoft:mainfrom
TysonAndre:parse-typed-class-const

Conversation

@TysonAndre
Copy link
Contributor

https://wiki.php.net/rfc/typed_class_constants#inheritance_and_variance As of php 8.3, class constants can have the same types as parameters (including union, intersection, and DNF types)

Start testing with php 8.3

https://wiki.php.net/rfc/typed_class_constants#inheritance_and_variance
As of php 8.3, class constants can have the same types as parameters
(including union, intersection, and DNF types)

Start testing with php 8.3
@TysonAndre
Copy link
Contributor Author

TysonAndre commented Dec 26, 2023

-<ST_IN_SCRIPTING>"yield"{WHITESPACE}"from"[^a-zA-Z0-9_\x80-\xff] {
+<ST_IN_SCRIPTING>"yield"{WHITESPACE_OR_COMMENTS}"from"[^a-zA-Z0-9_\x80-\xff] {
        yyless(yyleng - 1);
        HANDLE_NEWLINES(yytext, yyleng);
        RETURN_TOKEN_WITH_IDENT(T_YIELD_FROM);

tests/cases/lexical/keyword5.php.tokens started failing in php 8.3 because php now lexes yield /*awesome*/ from as T_YIELD_FROM

@TysonAndre
Copy link
Contributor Author

The tests won't run until https://docs.github.com/en/actions/managing-workflow-runs/approving-workflow-runs-from-public-forks

1 workflow awaiting approval
This workflow requires approval from a maintainer. Learn more about approving workflows.
1 in progress and 1 successful checks

Assume most class constants won't add a type
and parse the name if ambiguous.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants