protected void emitCommentAware(final IToken defaultToken, final int offset, String content) { RegexUtils.splitLine( content, new TokenizerCallback() { @Override public void token(int startOffset, int endOffset, String line, boolean isDelimiter) { if (line.trim().startsWith("!--")) emit(commentToken, offset + startOffset, line.length()); else emit(defaultToken, offset + startOffset, line.length()); } }); }
protected void emitTable( final ContentWithIgnorableEmitter emitter, final IToken defaultToken, final int offset, String content) { RegexUtils.splitLine( content, new TokenizerCallback() { @Override public void token(int startOffset, int endOffset, String line, boolean isDelimiter) { if (isDelimiter) emit(emitter, defaultToken, offset + startOffset, line.length()); else if (line.trim().startsWith("|--")) emit(emitter, commentToken, offset + startOffset, line.length()); else emitTableRow(emitter, defaultToken, offset + startOffset, line); } }); }