}
private List<Comment> convertToComments(List<CommonToken> preceding, LessSource source) {
List<Comment> result = new ArrayList<Comment>();
Comment comment = null;
for (CommonToken token : preceding) {
if (token.getType() == LessLexer.COMMENT) {
comment = new Comment(new HiddenTokenAwareTree(token, source));
result.add(comment);
}
if (token.getType() == LessLexer.NEW_LINE) {
if (comment != null)
comment.setHasNewLine(true);
}
}
return result;
}