Re: branch bill-doctest: new default doctest

Bill Allombert <[email protected]> Tue, 4 Feb 2025 22:43:38 +0100
Newsgroups gmane.comp.mathematics.pari.devel
Message-ID <Z6KKCgltKzaIqk6j@seventeen>
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.