|
From: Chris K <gnu...@li...> - 2006-04-05 09:25:09
|
Before I can write the patch I want to, this specification bug below needs to be
resolved:
Chris K wrote:
> In the help text it claims:
>
>> (The '/' character MUST be the first character after the '{'.)
>
> But in term.c (edited to clarity) in the enhanced_recursion routine:
>
>> switch (*p) {
>> case '{' :
>> {
>> while (*++p == ' '); /* Line I will call SKIPPY */
>> if (overprint == 2) {
>> ovp = (float)strtod(p,&p);
>> if (term->flags & TERM_IS_POSTSCRIPT)
>> base = ovp*f;
>> else
>> base += ovp*f;
>> }
>> --p;
>> if (*++p == '/') {
>
> Which clearly skips spaces after each opening brace. So the "MUST" in the help
> and the code are in conflict. A related documentation / parser mismatch error is:
>
>> You can change the font for one or
>> both strings ('~a{.5 /*.2 o}'---an 'a' with a one-fifth-size 'o' on top---and
>> the space between the number and the slash is necessary), but you can't
>> change it after the beginning of the string.
>
> Which from reading the code and performing tests is wrong -- you MUST NOT put a
> space between the vertical shift and the '/'.
>
> So it looks like the line I call SKIPPY used to be after the (overprint==2)
> parsing code and has been cut and pasted to now be before the (overprint==2)
> code. This causes both of the differences with the help text documentation.
>
> There are several fixes:
> *) Move SKIPPY back to below the (overprint==2) block, keep help text
> *) Change the help text to reflect the new behavior
> *) Put a copy of SKIPPY below the (overprint==2) block, change help text
> *) Delete SKIPPY and change the help text
>
>
I have checked the 4.0.0 tarball: The above code and bug looks to be the same in
that version. (I did not compile and test).
Consider this command which is currently accepted by the latest code, in
contradiction to help text:
plot x title "aaa{ / Symbol { } { bbb}}ccc"
Which spaces should be required, optional, or forbidden?
The resulting label is "aaa BBBccc" where B means "Beta". Which three spaces
from the command correspond to the three in the label?
These three: "} {"
I don't want to smash backward compatibility and then have to fix it.
How can I check backward compatibility of enhanced text?
I have just downloaded the version 3.7.3 code. Should I take the behavior of
its post.trm ENHPS_recurse routine as canonical?
It appears that this parser agrees with the help text about no space allowed
between "{/", though it lacks the overprint '~' capability.
Or does the development version of gnuplot have a "license to kill" backward
compatibility in corner cases?
--
Chris
|