mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
cpp: Now supports BOM #1208
git-svn-id: svn://ultimatepp.org/upp/trunk@8772 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
0e212aa3a5
commit
ff94f771db
2 changed files with 9 additions and 3 deletions
|
|
@ -20,9 +20,8 @@ void Parser::Locals(const String& type)
|
|||
bool Parser::TryDecl()
|
||||
{ // attempt to interpret code as local variable declaration
|
||||
for(;;) {
|
||||
if(lex[0] == tk_static || lex[0] == tk_const ||
|
||||
lex[0] == tk_register || lex[0] == tk_volatile)
|
||||
++lex;
|
||||
if(findarg(lex[0], tk_static, tk_const, tk_register, tk_volatile) >= 0)
|
||||
++lex;
|
||||
else
|
||||
if(!VCAttribute())
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -234,6 +234,13 @@ void Cpp::Do(const String& sourcefile, Stream& in, const String& currentfile, bo
|
|||
if(get_macros)
|
||||
return;
|
||||
|
||||
if(in.Peek() == 0xef) { // Skip UTF-8 BOM
|
||||
int64 pos = in.GetPos();
|
||||
in.Get();
|
||||
if(in.Get() != 0xbb || in.Get() != 0xbf)
|
||||
in.Seek(pos); // Was not UTF-8 BOM after all
|
||||
}
|
||||
|
||||
LTIMING("Expand");
|
||||
incomment = false;
|
||||
prefix_macro.Clear();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue