Recently while looking at something else, I discovered some
peculiarities about the way the scorefile is handled.
The documentation refers to the slrn scorefile format (which may be
found here: https://slrn.info/docs/score.txt - it has moved from where
the rebelbase pages point to). Now, there are a couple of things it says
about rules here:
Firstly, on the score keyword itself:
The `Score' keyword is used to assign a score to the header.
If it is followed by a single colon, the score is only given if all
tests are passed (logical AND); two colons indicate that the score
should be awarded if any of the tests are passed (logical OR)
On the subject of grouping rules, the slrn documentation says:
Lines enclosed in curly braces are grouped; the initial brace is
followed by one or two colons that indicate whether only one (`::') or
all of the lines (`:') inside the group need to match for the group to
pass.
However, the pan implementation behaves like this:
* If Score is followed by a single colon, the score is given if any of
the tests are passed.
* If Score is followed by 3 (!) or more more colons, the score is
given if all of the tests are passed.
* For grouping, if the { is followed by one :, only one of the lines
has to match. If it is followed by ::, all the lines inside the
group need to match (i.e. the opposite of what the slrn
documentation says)
* The code inside pan that adds rules to the scorefile generates a
single : for all lines much match, and :: for any line must matching.
* The unit tests for scorefile parsing test that a single : would
result in a score being applied if any line matched. There is no
test to see how a :: behaves. And in any case the unit tests aren't
run as the build parts are commented out.
What I'd like to do is to fix these up so that they behave like the slrn
documentation. (One : -> all rules must match to apply the score, two :s
-> if any rule matches, apply the score). However, I'm posting this
because it might break peoples existing rules (manually created ones only).
Feedback would be appreciated.
_______________________________________________
Pan-users mailing list
Pan-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/pan-users