danielsun1106 commented on a change in pull request #1485: URL: https://github.com/apache/groovy/pull/1485#discussion_r574486093
########## File path: src/main/java/org/apache/groovy/parser/antlr4/SemanticPredicates.java ########## @@ -179,10 +179,12 @@ public static boolean isInvalidLocalVariableDeclaration(TokenStream ts) { token = ts.LT(index); tokenType = token.getType(); tokenType3 = ts.LT(index + 2).getType(); + int nextCodePoint = token.getText().codePointAt(0); return // VOID == tokenType || !(BuiltInPrimitiveType == tokenType || Arrays.binarySearch(MODIFIER_ARRAY, tokenType) >= 0) - && Character.isLowerCase(token.getText().codePointAt(0)) + && !Character.isUpperCase(nextCodePoint) + && nextCodePoint != '@' Review comment: checking character @ seems unnecessary because @ is not allowed to appear in identifier. Even if we use quotes, e.g. ”@foo”, the first character of the identifier is ". ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org