Bill Allombert on Tue, 04 Feb 2025 22:43:42 +0100


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

Re: branch bill-doctest: new default doctest


On Mon, Feb 03, 2025 at 11:39:15PM +0100, Bill Allombert wrote:
> Dear PARI developers,
> 
> I have made a branch bill-doctest with a new default currently named 'doctest'
> to facilitate doctesting.
> When doctest is set, the GP interpretor behave slightly differently to
> allow to copy-paste examples from the documentation to GP without affecting too
> much normal usage:
> 
> 1. "? " at the start of a line is skipped
> 2. "%nn =", "time =", "cpu time =" and "*** " at the start of a line cause all
>  inputs until the next "?" or failing that, the end of input, to be skipped

After thinking about this, I suggest a simpler interface for doctest mode.
Any logical line starting with a whitespace (or TAB) is ignored unless the first
non-whitespace character is a ?, which is then also ignored.

Both the source and the 'gphelp -detex' version of the GP function documentation
has the property that any GP code example has each line starting by some spaces.

So I have made a new branch 'bill-doctest_ws' that implement this variant.

Cheers,
Bill.