[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

otags parse errors in /usr/lib/ocaml



Hi,

now that the new otags version is already for some time in
testing I would like to discuss the issue of parsing errors in
/usr/lib/ocaml when running update-otags.

update-otags runs daily as cron-job and builds tags tables for
all material in /usr/lib/ocaml. Some of the files there are
however not in standard syntax and therefore the otags parser
silently dies on them. Most of the time the problem is that the
file is written in revised syntax, but some files do also require
other parsing extensions (eg,
/usr/lib/ocaml/camlp4/test/fixtures/macrotest.mli from package
camlp4 needs the macro parser).

It would of course be nice if otags knew about the necessary
parsing extensions for each file, such that the generated tags
table would cover all files in /usr/lib/ocaml.

The point of this email is to discuss how to tell otags which
parsing extension it should use for which file. I see the
following solutions (most preferred comes first):

1. Establish a standard for describing necessary parsing
   extensions in the file itself. For example, the file
   camlp4/Camlp4/Sig.ml in the ocaml distribution contains as
   first line

   (* camlp4r *)

   There is of course more disambiguation needed. One possibility
   is to take the first word or string inside the first comment
   that follows ``-pp''. This way one could write

   (* compile with -pp camlp4r *)

   or

   (* compile with -pp "camlp4r macro" *)

   Such a standard would not only be useful for otags, but also
   for build tools such as ocamlbuild. Those tools could extract
   the necessary parsing extension from the file then.

   Such a standard needs of course some consensus on the ocaml
   list, but I am only suggesting it there, if I get support from
   the Debian ocaml maintainers.

2. Extend otags such that it is able to read parsing hints from
   some file. Require each package that installs files in
   /usr/lib/ocaml to provide suitable parsing hints for those
   files that are not standard syntax.

3. Use parsing hints as in 2., but ship the parsing hints for all
   files in the otags package.

Bye,

Hendrik


Reply to: