let highlighter (buffer:GSourceView.source_buffer) localizable ~start ~stop =
try
let _kf, start_s, _txt = DpdsState.get () in
let put_tag tag = match tag with ("",[]) -> ()
| _ -> add_tag buffer tag start stop
in
match localizable with
| Pretty_source.PStmt (_,stmt) ->
begin
if start_s.sid = stmt.sid then put_tag scope_start_tag;
put_tag (Pscope.tag_stmt stmt);
put_tag (DataScope.tag_stmt stmt);
put_tag (Zones.tag_stmt stmt );
put_tag (ShowDef.tag_stmt stmt)
end
| Pretty_source.PCodeAnnot (_, _, annot) ->
put_tag (Pscope.tag_annot annot)
| Pretty_source.PVDecl _
| Pretty_source.PTermLval _
| Pretty_source.PLval _
| Pretty_source.PGlobal _ -> ()
with Not_found -> ()