boolean (PsiBuilder builder, IElementType type) { PsiBuilder.Marker marker = builder.mark(); boolean gotLine = false; while (type == RestTokenTypes.LINE || type == RestTokenTypes.WHITESPACE) { final IElementType nextType = builder.lookAhead(1); if (nextType != RestTokenTypes.LINE && type == RestTokenTypes.WHITESPACE) { break; } builder.advanceLexer(); type = builder.getTokenType(); gotLine = true; } if (gotLine) { marker.done(RestElementTypes.LINE_TEXT); } else { marker.drop(); } return gotLine; }