void comment(Token token) {
String str = token.image;
if (str.startsWith("//"))
str = str.substring(2, str.length() - 1);
else
str = str.substring(2, str.length() - 2); from beginning and end
LiterateCommentType lcType = LiterateCommentType.COMMON;
if (str.startsWith("@")) {
lcType = LiterateCommentType.LATEX;
str = str.substring(1);
} else if (str.startsWith("!")) {
lcType = LiterateCommentType.PREAMBLE;
str = str.substring(1);
}
Location loc = new Location(token.beginLine, token.beginColumn,
token.endLine, token.endColumn);
if (module == null) {
items.add(markLocExplicit(loc, new LiterateDefinitionComment(str, lcType)));
} else {
module.appendModuleItem(markLocExplicit(loc, new LiterateModuleComment(str, lcType)));
}
}