]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fix problem that the BOM in UTF-8 files (for example saved by
authorMats Bengtsson <mats.bengtsson@s3.kth.se>
Thu, 13 Dec 2007 09:49:32 +0000 (10:49 +0100)
committerMats Bengtsson <mats.bengtsson@s3.kth.se>
Thu, 13 Dec 2007 09:49:32 +0000 (10:49 +0100)
MS Notepad) wasn't found if the file started with a definition of
an identifier. Thanks to "Decade"!

lily/lexer.ll

index 71fb2479eec8596df6d390f989aa0b46f9176782..b444704ea5890bd5b26d26d335a66a4c6a55baa2 100644 (file)
@@ -171,7 +171,9 @@ BOM_UTF8    \357\273\277
   return type;
 }
 
-<INITIAL,chords,lyrics,figures,notes>{BOM_UTF8} {
+   /* Use the trailing context feature. Otherwise, the BOM will not be
+      found if the file starts with an identifier definition. */
+<INITIAL,chords,lyrics,figures,notes>{BOM_UTF8}/.* {
   if (this->lexloc->line_number () != 1 || this->lexloc->column_number () != 0)
     {
       LexerError (_ ("stray UTF-8 BOM encountered").c_str ());