Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] exuberant ctags for ocaml ?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Ava Arachne Jarvis <ajar@k...>
Subject: Re: [Caml-list] exuberant ctags for ocaml ?
[Michal Moskal - Sat,  9 Nov 2002 01:41:36 PM CST]
> On Fri, Nov 08, 2002 at 06:20:27PM -0500, Alan Schmitt wrote:
> > I was wondering if someone uses exuberant ctags with ocaml ...
> 
> I'm using OCaml-otags, that, with little patche, works very nice 
> with vi. Another patch is need to compile it with ocaml 3.05+.
> You can find the patches in question in:
> 
> ftp://ftp.nest.pld.org.pl/test/SRPMS/ocaml-otags-3.04.3-2.src.rpm

I added, I believe, sufficient string escaping (escaping '*' seems
unnecessary, and you don't need to escape '^' since they occur after 
the initial '^' in the format string used to print a line in the tag
file, you don't even need to escape []...).  

(vi.ml):
------------------------------------------------
  let escape s = 
    let part_es = String.escaped s in
    let buffer = Buffer.create (String.length part_es) in 
    String.iter (fun c -> 
                    match c with
                    | '.' -> Buffer.add_string buffer "\\."
                    | '$' -> Buffer.add_string buffer "\\$"
                    | _ -> Buffer.add_char buffer c)
                 part_es; 
    Buffer.contents buffer


  (* FIXME: escape ^$/* and probably few more things with \ *)
  let line filename tagname linebeg =
    let etag =
      Printf.sprintf "%s\t%s\t/^%s$/;\n" tagname filename (escape linebeg) in
    etag, (String.length etag)
------------------------------------------------

Also, once you get the patches finished up, remember to submit them to the
author of otags.  :)


-- 
| The one day you'd sell your soul for something, souls are a glut.
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners