From 7249e3be5b0ac3446f032414aa05e0a62cd16225 Mon Sep 17 00:00:00 2001 From: Mats Bengtsson Date: Thu, 13 Dec 2007 10:49:32 +0100 Subject: [PATCH] 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"! --- lily/lexer.ll | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 ()); -- 2.39.5