@Override public HighlightedTextWriter appendWithData(String str, HighlightData data) { Highlighting h = null; if (!offsets.empty()) { GraphSourceItemPosition itemPos = offsets.peek(); GraphSourceItem src = itemPos.graphSourceItem; int pos = itemPos.position; if (src != null && hilight) { HighlightData ndata = new HighlightData(); ndata.merge(itemPos.data); ndata.merge(data); ndata.offset = src.getAddress() + pos; ndata.fileOffset = src.getFileOffset(); if (itemPos.startLineItem != null) { ndata.firstLineOffset = itemPos.startLineItem.getLineOffset(); } h = new Highlighting(sb.length() - newLineCount, ndata, HighlightType.OFFSET, str); instructionHilights.add(h); } } appendToSb(str); if (h != null) { h.len = sb.length() - newLineCount - h.startPos; } return this; }
@Override protected HighlightedTextWriter hilightSpecial( String text, HighlightSpecialType type, String specialValue, HighlightData data) { HighlightData ndata = new HighlightData(); ndata.merge(data); ndata.subtype = type; ndata.specialValue = specialValue; start(ndata, HighlightType.SPECIAL); appendNoHilight(text); return end(HighlightType.SPECIAL); }