lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug] erroneous error messages


From: Juergen Reuter
Subject: [bug] erroneous error messages
Date: Mon, 16 Aug 2004 13:10:52 +0200 (CEST)

Hi!

Lily often produces strange error messages that may be very frustrating 
for people that start learning the input syntax.  If lily reports 
misleading messages to people that are just about learning lily's input 
syntax, they will probably kick away lily quite soon.  Below is a typical 
example.  In this example, there is an erroneous "\" before the 
"inputencoding" identifier:

\score {
    \relative c'' { c }
    \paper {
        \inputencoding = "latin1"
    }
}

Hence, lily should ideally just report an error nearby line 4.  This 
could be (depending on the strength and structure of the input syntax 
definition) either a syntax error during parse phase (e.g. "unexpected 
'='") or a semantical error during interpreting phase (e.g. "unknown 
escaped sequence").  BTW, to my knowledge, classical compilers typically 
do not try to enter any further stage after parsing phase if there occurs 
a syntax error during parsing, but rather abort after parsing to avoid any 
further misleading semantical error messages.

For the above example, lily reports:

  Now processing `bug.ly'
  Parsing...

  bug.ly:4:14: error: parse error, unexpected STRING_IDENTIFIER:
          \inputencodin
                       g = "latin1"
  Interpreting music... [1]
  Preprocessing graphical objects... 
  Calculating line breaks... [2]

<snip>

  paper output to `bug.ps'...
  Converting to "bug.pdf"...


  bug.ly:1:5: warning: Braces don't match:
  \scor
       e {

   *** Failed files: bug.ly

The first error message does not sound correct to me, but at least points 
to the correct line in the source code.  However, the additional warning 
about the non-matching braces around \score while converting to "bug.pdf" 
is completely irritating.  I also do not understand why this warning 
occurs only so late: the ps output seams to have already been finished at 
that point.  That is, the error is caught only for pdf output, but not for 
ps output?  This sounds to me like a fundamental bug, which probably 
affects not just the error messages, but most likely also the generated 
code.

Greetings,
Jürgen




reply via email to

[Prev in Thread] Current Thread [Next in Thread]