From: Mats Bengtsson Date: Thu, 13 Dec 2007 09:49:32 +0000 (+0100) Subject: Fix problem that the BOM in UTF-8 files (for example saved by X-Git-Tag: release/2.11.37-1~39^2 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=7249e3be5b0ac3446f032414aa05e0a62cd16225;p=lilypond.git Fix problem that the BOM in UTF-8 files (for example saved by MS Notepad) wasn't found if the file started with a definition of an identifier. Thanks to "Decade"! --- diff --git a/lily/lexer.ll b/lily/lexer.ll index 71fb2479ee..b444704ea5 100644 --- a/lily/lexer.ll +++ b/lily/lexer.ll @@ -171,7 +171,9 @@ BOM_UTF8 \357\273\277 return type; } -{BOM_UTF8} { + /* Use the trailing context feature. Otherwise, the BOM will not be + found if the file starts with an identifier definition. */ +{BOM_UTF8}/.* { if (this->lexloc->line_number () != 1 || this->lexloc->column_number () != 0) { LexerError (_ ("stray UTF-8 BOM encountered").c_str ());