[Prologdoc-devel] strange differences between pldoc on SWI 5.4.x vs 5.5.x
Status: Beta
Brought to you by:
bramadams
|
From: Chris M. <cj...@fr...> - 2005-08-24 20:38:57
|
PrologDocNG works fine on 5.4.x, but a difference in default operators
seems to be causing problems for 5.5.x; I get a slew of errors like this:
ERROR: /Users/cjm/cvs/PrologDocNG/src/tags.pl:156:0: Syntax error:
Operator expected
ERROR: /Users/cjm/cvs/PrologDocNG/src/tags.pl:247:0: Syntax error:
Operator expected
...
All these lines include a term with ? as functor. Indeed, after testing it
seems that 5.4.x defines an op for ?, but 5.5.x does not
I explicitly defined the ? operator as a prefix with what the swipl docs
says should be the default precedence, like this:
diff -r1.3 tags.pl
36a37
> op(500, fx, (?)), % CJM
44a46
> :- op(500, fx, (?)). % CJM
And pldoc runs without complaining.
However, the xml that is produced (under 5.5.x) has some severe oddities.
Using prologdocng with 5.5.x introduces duplicate predicate elements in
the xml for pdoc comments of the following form:
/**
@pred avl_empty(?Tree)
creates an empty AVL tree.
*/
(taken from PrologDocNG/samples/avl.pl)
In the generated xml, the predicate is listed twice - first as
avl_empty(?Tree) then as avl_empty/2. Only the first has the predicate
description attached. (see attachments)
I don't know what could have changed in 5.5.x to introduce this behaviour.
I am not sure if it is related to operators, or something completely
different. (My operator fix produces the correct behaviour on 5.4.x, for
what it's worth)
Until the code is fixed, my only options are:
(1) redocument all my code like this:
/**
@pred avl_empty/1
@mode avl_empty(?Tree)
creates an empty AVL tree.
*/
this produces the correct output. I would rather not do this, as I have a
lot of existing documentation where I mix @pred and @mode
(2) use 5.4.x for running pldoc
This is what I'll do in the short term, but it isn't a viable long term
solution, especially as Jan prepares to release 5.6 (including
PrologDocNG?)
Any ideas?
Thanks
Chris |