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

Method hasCommentToken

src/org/antlr/codebuff/Trainer.java:393–403  ·  view source on GitHub ↗
(List<Token> hiddenTokensToLeft)

Source from the content-addressed store, hash-verified

391 }
392
393 public static boolean hasCommentToken(List<Token> hiddenTokensToLeft) {
394 boolean hasComment = false;
395 for (Token hidden : hiddenTokensToLeft) {
396 String hiddenText = hidden.getText();
397 if ( !hiddenText.matches("\\s+") ) {
398 hasComment = true;
399 break;
400 }
401 }
402 return hasComment;
403 }
404
405 /** Return first ancestor of p that is not an only child including p.
406 * So if p.getParent().getChildCount()>1, this returns p. If we

Callers 1

emitCommentsToTheLeftMethod · 0.95

Calls 2

getTextMethod · 0.65
matchesMethod · 0.45

Tested by

no test coverage detected