23e25ef4

By: Tom Sydney Kerckhove <syd@cs-syd.eu>

Add comments within declarations

A comment used to be a declaration of its own, so a comment between the lines
of a transaction was either a parse error or was moved onto its own line by
the formatter.

A comment can now be written on an indented line of its own within a
declaration, where it belongs to the line below it.  That means a comment
cannot be the last line of a declaration: it would belong to no line at all,
which is an error that points at the comment.

A comment at the first column still starts a new declaration, so the lines
that a declaration cannot contain, an import, a currency, a tag, a price, an
account line and a timestamp line, hold no comments of their own: a comment
above those is a comment declaration already.

Note that the lines of a transaction are one chain of productions rather than
three lists.  The comments above a line have to be read before it is known
which kind of line follows them, so a list per kind of line makes the
description/posting and posting/extra boundaries reduce/reduce conflicts.

Fix two bugs in the process:

  * A comment whose text was only whitespace swallowed the declaration below
    it.  Nothing could match the rest of the line, so '$white+' matched the
    newline instead and left the lexer in the comment start code, reading the
    next declaration as comment text.  A comment is now a single token, so
    there is no start code left to be stranded in.

  * A description could be empty, or contain an empty line, neither of which
    can be written down: an empty description formatted to no line at all and
    was silently lost.

Suite timing

Time to Start Worker time Duration Time to finish Idle
Config 0s 1s 1s 1s 0s
Eval 1s 16s 16s 18s 0s
Build 16s 4m18s 2m16s 2m32s 0s
Suite 0s 4m37s 2m32s 2m32s 0s

Timeline

0s20s40s1m1m20s1m40s2m2m20s