Created
July 15, 2025 15:03
-
-
Save mebigfatguy/377dc1b7bac1b4bbf4f54422ff961c81 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class ZeroSpaceCheck extends AbstractCheck { | |
| @Override | |
| public int[] getAcceptableTokens() { | |
| return getRequiredTokens(); | |
| } | |
| @Override | |
| public int[] getDefaultTokens() { | |
| return getRequiredTokens(); | |
| } | |
| @Override | |
| public int[] getRequiredTokens() { | |
| return new int[] { TokenTypes.IDENT }; | |
| } | |
| @Override | |
| public void visitToken(DetailAST ast) { | |
| if (ast.getType() == TokenTypes.IDENT) { | |
| String id = ast.getText(); | |
| int index = id.indexOf("\u200B"); | |
| if (index >= 0) { | |
| log(ast, "Zero Space Character found in " + id + " at position " + index); | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment