At 11:05 +0200 2005/04/16, Jan Nieuwenhuizen wrote:
Paul Eggert writes:

 and if you print that string you'll see this:

 "\\'?\"\a\b\f\n\r\t\v\001\377\001\377"

 and this is a C representation of an equivalent to the original
 string.

Ah, yes. But I would rather not feed the average lilypond user a C represenation of a string, most of our users are not programmers. This

   %token BOOK "\\book"

is into this

    "\"\\\\book\""

which will print as

    bison.ly:8:5: error: syntax error, unexpected "\\book", expecting '{'

The extra backslash is not helpful.  Hmm.
Jan.

I think it should be so that, in the final error message, the "..." put in the %token part is printed as if was enetered as a C-string in a C source. Thus:
%token BOOK "\\book"
should print as
\book
(no quotes). And
%token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\377\x001\x0000ff"
should print as
\\'?"...
i.e., no quotes, and the control, octal and hexadecimal values prints the characters they represent in the C language. This way, the write o erro messages gets maximum control over the output.
--
Hans Aberg





Reply via email to