@Test public void content() { assertThat(analyser.getContents("--[[comment1 \n comment2--]]")).isEqualTo("comment1 \n comment2"); assertThat(analyser.getContents("--comment")).isEqualTo("comment"); }
@Override public String getContents(String comment) { if (comment.startsWith("--[[")) { if (comment.endsWith("--]]")) { return comment.substring(4, comment.length() - 4); } return comment.substring(4); } else if (comment.startsWith("--")) { return comment.substring(2, comment.length()); } else{ throw new IllegalArgumentException(); } }
LuaCommentAnalyser extends CommentAnalyser { @Override public String getContents(String comment) { if (comment.startsWith("--[[")) { if (comment.endsWith("--]]")) { return comment.substring(4, comment.length() - 4); } return comment.substring(4); } else if (comment.startsWith("--")) { return comment.substring(2, comment.length()); } else{ throw new IllegalArgumentException(); } } }
LuaCommentAnalyser extends CommentAnalyser { @Override public String getContents(String comment) { if (comment.startsWith("--[[")) { if (comment.endsWith("--]]")) { return comment.substring(4, comment.length() - 4); } return comment.substring(4); } else if (comment.startsWith("--")) { return comment.substring(2, comment.length()); } else{ throw new IllegalArgumentException(); } }  }
LuaCommentAnalyser extends CommentAnalyser { @Override public String getContents(String comment) { if (comment.startsWith("--[[")) { if (comment.endsWith("--]]")) { return comment.substring(4, comment.length() - 4); } return comment.substring(4); } else if (comment.startsWith("--")) { return comment.substring(2, comment.length()); } else{ throw new IllegalArgumentException(); } }  @Override boolean isBlank(String line); @Override String getContents(String comment); }
LuaCommentAnalyser extends CommentAnalyser { @Override public String getContents(String comment) { if (comment.startsWith("--[[")) { if (comment.endsWith("--]]")) { return comment.substring(4, comment.length() - 4); } return comment.substring(4); } else if (comment.startsWith("--")) { return comment.substring(2, comment.length()); } else{ throw new IllegalArgumentException(); } }  @Override boolean isBlank(String line); @Override String getContents(String comment);  }