]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 3138: Remove complete aborts in the lexer
authorDavid Kastrup <dak@gnu.org>
Thu, 24 Jan 2013 12:07:10 +0000 (13:07 +0100)
committerDavid Kastrup <dak@gnu.org>
Tue, 29 Jan 2013 21:49:12 +0000 (22:49 +0100)
A syntax error should not let the whole LilyPond run bomb out, but
rather just the current session (filename on the command line).

lily/lexer.ll

index 9b1d6eb5aabb1f18d778715b502bc1532dac9eca..c1d3dd86a5a613ae8f78babdcc70152fb71b4ddb 100644 (file)
@@ -314,7 +314,7 @@ BOM_UTF8    \357\273\277
                yy_push_state (state);
        }
        else
-               error (_ ("\\maininput not allowed outside init files"));
+               LexerError (_ ("\\maininput not allowed outside init files").c_str ());
 }
 
 <INITIAL,chords,lyrics,figures,notes>\\include           {
@@ -374,8 +374,8 @@ BOM_UTF8    \357\273\277
 }
 
 <incl,version,sourcefilename>\"[^""]*   { // backup rule
-       error (_ ("end quote missing"));
-       exit (1);
+       LexerError (_ ("end quote missing").c_str ());
+       yy_pop_state ();
 }
 
     /* Flex picks the longest matching pattern including trailing