bskinn / pent

pent Extracts Numerical Text -- Mini-language driven parser for structured numerical data in text
MIT License
20 stars 3 forks source link

Description of optional-line token behavior in docs #51

Closed bskinn closed 4 years ago

bskinn commented 6 years ago

~Works for a tail composed of a single optional line. Might work for a head with a single optional line?

Doesn't work for a single line in the middle of body.

Should probably think up some common/likely scenarios and test them.~

Believe discovered the bug; to fix in #89. The behavior of the token is described in the first comment below.

bskinn commented 5 years ago

Once #88 and #89 are dealt with, the behavior should hopefully be consistent and comprehensible.

Given a prs generated such that the optional-line EOL lookahead is optional, as it should be (#89), and such that the doubled optional newline between head and body is removed (#88; if this is determined to be desirable), then the optional pattern line should match if:

  1. The optional line is entirely absent
  2. The optional line is present and contains only whitespace
  3. The optional line is present and matches the optional pattern

Should be possible to test this well, per #52.

bskinn commented 4 years ago

Calling this satisfactorily completed a/o dec53d2