anchor.diff:  let json_of_pos pos =
     JsonList [JsonInt (Range.line_of_pos pos); JsonInt (Range.col_of_pos pos)]
   
  -let json_of_range r =
  -  JsonAssoc [("fname", JsonStr (Range.file_of_use_range r));
  -             ("beg", json_of_pos (Range.start_of_use_range r));
  -             ("end", json_of_pos (Range.end_of_use_range r))]
  +let json_of_range_fields file b e =
  +  JsonAssoc [("fname", JsonStr file);
  +             ("beg", json_of_pos b);
  +             ("end", json_of_pos e)]
  +
  +let json_of_use_range r =
  +    json_of_range_fields
  +            (Range.file_of_use_range r)
  +            (Range.start_of_use_range r)
  +            (Range.end_of_use_range r)
  +
  +let json_of_def_range r =
  +    json_of_range_fields
  +            (Range.file_of_range r)
  +            (Range.start_of_range r)
  +            (Range.end_of_range r)
   
   let json_of_issue_level i =
     JsonStr (match i with
  
positive.code:              ("message", JsonStr issue.issue_message);
               ("ranges", JsonList (match issue.issue_range with
                                    | None -> []
                                    | Some r -> [json_of_range r]))]
  
  type lookup_result = { lr_name: string;
                         lr_def_range: option<Range.range>;
  
negative.code: 
  let json_of_lookup_result lr =
    JsonAssoc [("name", JsonStr lr.lr_name);
               ("defined-at", json_of_opt json_of_def_range lr.lr_def_range);
               ("type", json_of_opt JsonStr lr.lr_typ);
               ("documentation", json_of_opt JsonStr lr.lr_doc);
               ("definition", json_of_opt JsonStr lr.lr_def)]
  