(CommonTokenStream tokens, int i)
| 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; |
no test coverage detected