You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2022/11/15 04:10:03 UTC

[GitHub] [netbeans] junichi11 opened a new pull request, #4966: PHP 8.2 Support: Fetch properties of enums in const expressions

junichi11 opened a new pull request, #4966:
URL: https://github.com/apache/netbeans/pull/4966

   #### PHP 8.1 Support: New in initializers (Part 5) 
   
   - https://issues.apache.org/jira/browse/NETBEANS-5599
   - RFC:https://wiki.php.net/rfc/new_in_initializers
   - Support for field and method access for constant (e.g. `const C = new A(); C->field; C->method();`)
   - Fix the parser
   - Fix PHP81UnhandledError
   
   ![nb-php81-new-in-initializers-const-access](https://user-images.githubusercontent.com/738383/201823248-881833f0-359e-4fdc-bd8b-bfe187c4152a.png)
   
   #### PHP 8.2 Support: Fetch properties of enums in const expressions (Part 1) 
   
   - #4725
   - https://wiki.php.net/rfc/fetch_property_in_const_expressions
   - Fix the grammar file
   - Fix CC: add the readonly name property to enums
   - Add/Fix unit tests for the parser and CC
   
   ![nb-php82-fetch-properties-of-enum-in-const-expressions1](https://user-images.githubusercontent.com/738383/201822710-e3cc31eb-e50c-4516-8c47-32ecdaa75d94.png)
   ![nb-php82-fetch-properties-of-enum-in-const-expressions2](https://user-images.githubusercontent.com/738383/201822729-3c4d07af-ffd5-4d73-b0fe-b00a557fbb1a.png)
   
   ##### Note
   
   The following code is valid but I don't think these are meaningful. So, I don't support these cases at the moment.
   
   ```php
   const A = (null)?->test;
   
   const B = (null)?->test->test;
   
   const C = (null)->test?->test;
   
   const D = (null)?->test['test'];
   
   const E = (null)['test']?->test;
   
   const F = (null)?->{new Printer};
   
   const G = (null)?->test + (new Printer ? 1 : 0);
   
   const H = (1)->prop;
   
   const I = (1)?->prop;
   ````
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] junichi11 commented on pull request #4966: PHP 8.2 Support: Fetch properties of enums in const expressions

Posted by GitBox <gi...@apache.org>.
junichi11 commented on PR #4966:
URL: https://github.com/apache/netbeans/pull/4966#issuecomment-1315986939

   @tmysik Thank you for your review and your time :)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] junichi11 commented on a diff in pull request #4966: PHP 8.2 Support: Fetch properties of enums in const expressions

Posted by GitBox <gi...@apache.org>.
junichi11 commented on code in PR #4966:
URL: https://github.com/apache/netbeans/pull/4966#discussion_r1022298691


##########
php/php.editor/src/org/netbeans/modules/php/editor/model/nodes/ClassDeclarationInfo.java:
##########
@@ -107,7 +107,11 @@ public PhpModifiers getAccessModifiers() {
                 case READONLY:
                     phpModifiers.add(PhpModifiers.READONLY);
                     break;
+                case NONE:
+                    // no-op
+                    break;
                 default:
+                    assert false : "Handle " + modifier + " modifier"; // NOI18N

Review Comment:
   https://github.com/apache/netbeans/pull/4955#pullrequestreview-1176088975



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] tmysik merged pull request #4966: PHP 8.2 Support: Fetch properties of enums in const expressions

Posted by GitBox <gi...@apache.org>.
tmysik merged PR #4966:
URL: https://github.com/apache/netbeans/pull/4966


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] tmysik commented on pull request #4966: PHP 8.2 Support: Fetch properties of enums in const expressions

Posted by GitBox <gi...@apache.org>.
tmysik commented on PR #4966:
URL: https://github.com/apache/netbeans/pull/4966#issuecomment-1316827134

   @junichi11 Nothing to thank for, really.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] junichi11 commented on pull request #4966: PHP 8.2 Support: Fetch properties of enums in const expressions

Posted by GitBox <gi...@apache.org>.
junichi11 commented on PR #4966:
URL: https://github.com/apache/netbeans/pull/4966#issuecomment-1315140386

   @tmysik Could you please have a look at this when you have time? If there is no problem, let's merge it. Thanks!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] tmysik commented on a diff in pull request #4966: PHP 8.2 Support: Fetch properties of enums in const expressions

Posted by GitBox <gi...@apache.org>.
tmysik commented on code in PR #4966:
URL: https://github.com/apache/netbeans/pull/4966#discussion_r1023272506


##########
php/php.editor/src/org/netbeans/modules/php/editor/model/nodes/ClassDeclarationInfo.java:
##########
@@ -107,7 +107,11 @@ public PhpModifiers getAccessModifiers() {
                 case READONLY:
                     phpModifiers.add(PhpModifiers.READONLY);
                     break;
+                case NONE:
+                    // no-op
+                    break;
                 default:
+                    assert false : "Handle " + modifier + " modifier"; // NOI18N

Review Comment:
   Thanks! 👍



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists