junichi11 commented on code in PR #8177:
URL: https://github.com/apache/netbeans/pull/8177#discussion_r1923724365


##########
php/php.editor/src/org/netbeans/modules/php/editor/verification/FinalModifierHintError.java:
##########


Review Comment:
   Moved to `ModifiersCheckHintError`.



##########
php/php.editor/src/org/netbeans/modules/php/editor/verification/ModifiersCheckHintError.java:
##########


Review Comment:
   Show errors here because the parser allows invalid modifier combinations.



##########
php/php.editor/src/org/netbeans/modules/php/editor/completion/CompletionContextFinder.java:
##########
@@ -1690,7 +1713,9 @@ static boolean isInAttribute(final int caretOffset, final 
TokenSequence ts, bool
             }
             if (tokenId == PHPTokenId.PHP_SEMICOLON
                     || isFunctionDeclaration(ts.token())
-                    || isVisibilityModifier(ts.token())) {
+                    || isVisibilityModifier(ts.token())
+                    || isSetVisibilityModifier(ts.token())
+                    ) {

Review Comment:
   ```suggestion
                       || isSetVisibilityModifier(ts.token())) {
   ```
   I'll fix it later.



##########
php/php.editor/tools/ASTPHP5Parser.cup:
##########
@@ -3181,85 +3285,18 @@ constant_modifiers ::=
     RESULT = null;
 :}
 
-| ppp_modifiers:modifier
-{:
-    RESULT = modifier;
-:}
-
-| final_modifier:modifier
+| non_empty_member_modifiers:modifier
 {:
     RESULT = modifier;
 :}
-
-| final_modifier:fModifier ppp_modifiers:pModifier
-{:
-    int result = 0;
-    result |= fModifier.intValue();
-    result |= pModifier.intValue();
-    RESULT = Integer.valueOf(result);
-:}
-
-| ppp_modifiers:pModifier final_modifier:fModifier
-{:
-    int result = 0;
-    result |= pModifier.intValue();
-    result |= fModifier.intValue();
-    RESULT = Integer.valueOf(result);
-:}
 ;
 
 variable_modifiers ::=
-ppp_modifiers:modifier
+non_empty_member_modifiers:modifier

Review Comment:
   The parser allows valid combinations so far. However, it's possible to 
maintain it no longer...because there are many modifiers.
   So, the parser allows invalid combinations now.
   Instead, errors are handled via `ModifiersCheckHintError`.



##########
php/php.editor/tools/ASTPHP5Parser.cup:
##########
@@ -2493,6 +2505,92 @@ optional_property_modifiers ::=
     result |= pModifier.intValue();
     RESULT = Integer.valueOf(result);
 :}
+
+| ppp_modifiers:pppModifier ppp_set_modifiers:pppSetModifier

Review Comment:
   Probably, we can change here to `non_empty_member_modifiers` in the future. 



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

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

Reply via email to