MCPcopy Create free account
hub / github.com/antlr/codebuff / cannotJoin

Method cannotJoin

src/org/antlr/codebuff/Formatter.java:500–506  ·  view source on GitHub ↗

Do not join two words like "finaldouble" or numbers like "3double", "double3", "34", (3 and 4 are different tokens) etc...

(Token prevToken, Token curToken)

Source from the content-addressed store, hash-verified

498 * "double3", "34", (3 and 4 are different tokens) etc...
499 */
500 public static boolean cannotJoin(Token prevToken, Token curToken) {
501 String prevTokenText = prevToken.getText();
502 char prevLastChar = prevTokenText.charAt(prevTokenText.length()-1);
503 String curTokenText = curToken.getText();
504 char curFirstChar = curTokenText.charAt(0);
505 return Character.isLetterOrDigit(prevLastChar) && Character.isLetterOrDigit(curFirstChar);
506 }
507
508 public static void wipeCharPositionInfoAndWhitespaceTokens(CodeBuffTokenStream tokens) {
509 tokens.fill();

Callers 1

processTokenMethod · 0.95

Calls 2

getTextMethod · 0.65
lengthMethod · 0.45

Tested by

no test coverage detected