MCPcopy Index your code
hub / github.com/antlr/codebuff / getPreviousWS

Method getPreviousWS

src/org/antlr/codebuff/Trainer.java:387–391  ·  view source on GitHub ↗
(CommonTokenStream tokens, int i)

Source from the content-addressed store, hash-verified

385
386 // if we have non-ws tokens like comments, we only count ws not in comments
387 public static List<Token> getPreviousWS(CommonTokenStream tokens, int i) {
388 List<Token> hiddenTokensToLeft = tokens.getHiddenTokensToLeft(i);
389 if ( hiddenTokensToLeft==null ) return null;
390 return filter(hiddenTokensToLeft, t -> t.getText().matches("\\s+"));
391 }
392
393 public static boolean hasCommentToken(List<Token> hiddenTokensToLeft) {
394 boolean hasComment = false;

Callers 1

getPrecedingNLMethod · 0.95

Calls 3

getTextMethod · 0.65
filterMethod · 0.45
matchesMethod · 0.45

Tested by

no test coverage detected