# HG changeset patch # User Aziz K?ksal # Date 1203119563 -3600 # Node ID c909a3d3fa5256bfdfdd591a95b250b6390d1c48 # Parent 307905dadf5d9795cd5d795c1ec5ee2c3be81cce Fixed vararg issue with gdc. diff -r 307905dadf5d -r c909a3d3fa52 trunk/src/dil/Messages.d --- a/trunk/src/dil/Messages.d Sat Feb 16 00:12:13 2008 +0100 +++ b/trunk/src/dil/Messages.d Sat Feb 16 00:52:43 2008 +0100 @@ -18,7 +18,7 @@ // #line ExpectedIdentifierSTLine, ExpectedIntegerAfterSTLine, - ExpectedFilespec, + ExpectedFilespec, // Deprecated. UnterminatedFilespec, UnterminatedSpecialToken, // "" diff -r 307905dadf5d -r c909a3d3fa52 trunk/src/dil/lexer/Lexer.d --- a/trunk/src/dil/lexer/Lexer.d Sat Feb 16 00:12:13 2008 +0100 +++ b/trunk/src/dil/lexer/Lexer.d Sat Feb 16 00:52:43 2008 +0100 @@ -2272,10 +2272,10 @@ t.setWhitespaceFlag(); MID mid; - auto errorAtColumn = p; + char* errorAtColumn = p; ++p; - if (p[0] != 'l' || p[1] != 'i' || p[2] != 'n' || p[3] != 'e') + if (!(p[0] == 'l' && p[1] == 'i' && p[2] == 'n' && p[3] == 'e')) { mid = MID.ExpectedIdentifierSTLine; goto Lerr; @@ -2288,7 +2288,7 @@ { /+Space,+/ Integer, Filespec, End } State state = State.Integer; - + char* tokenEnd = p + 1; while (!isEndOfLine(++p)) { if (isspace(*p)) @@ -2303,6 +2303,7 @@ } t.tokLineNum = new Token; scan(*t.tokLineNum); + tokenEnd = p; if (t.tokLineNum.kind != TOK.Int32 && t.tokLineNum.kind != TOK.Uint32) { errorAtColumn = t.tokLineNum.start; @@ -2312,14 +2313,14 @@ --p; // Go one back because scan() advanced p past the integer. state = State.Filespec; } - else if (state == State.Filespec) - { - if (*p != '"') - { - errorAtColumn = p; - mid = MID.ExpectedFilespec; - goto Lerr; - } + else if (state == State.Filespec && *p == '"') + { // MID.ExpectedFilespec is eprecated. + // if (*p != '"') + // { + // errorAtColumn = p; + // mid = MID.ExpectedFilespec; + // goto Lerr; + // } t.tokLineFilespec = new Token; t.tokLineFilespec.start = p; t.tokLineFilespec.kind = TOK.Filespec; @@ -2331,6 +2332,7 @@ errorAtColumn = t.tokLineFilespec.start; mid = MID.UnterminatedFilespec; t.tokLineFilespec.end = p; + tokenEnd = p; goto Lerr; } isascii(*p) || decodeUTF8(); @@ -2338,6 +2340,7 @@ auto start = t.tokLineFilespec.start +1; // +1 skips '"' t.tokLineFilespec.str = start[0 .. p - start]; t.tokLineFilespec.end = p + 1; + tokenEnd = p + 1; state = State.End; } else/+ if (state == State.End)+/ @@ -2362,11 +2365,13 @@ if (t.tokLineFilespec) newFilePath(t.tokLineFilespec.str); } - t.end = p; + p = tokenEnd; + t.end = tokenEnd; return; Lerr: - t.end = p; + p = tokenEnd; + t.end = tokenEnd; error(errorAtColumn, mid); } @@ -2410,7 +2415,7 @@ } void error_(uint lineNum, char* lineBegin, char* columnPos, MID mid, - TypeInfo[] _arguments, void* _argptr) + TypeInfo[] _arguments, Arg _argptr) { lineNum = this.errorLineNumber(lineNum); auto errorPath = this.filePaths.setPath; diff -r 307905dadf5d -r c909a3d3fa52 trunk/src/dil/parser/Parser.d --- a/trunk/src/dil/parser/Parser.d Sat Feb 16 00:12:13 2008 +0100 +++ b/trunk/src/dil/parser/Parser.d Sat Feb 16 00:52:43 2008 +0100 @@ -4133,7 +4133,7 @@ error_(this.token, GetMsg(mid), _arguments, _argptr); } - void error_(Token* token, char[] formatMsg, TypeInfo[] _arguments, void* _argptr) + void error_(Token* token, char[] formatMsg, TypeInfo[] _arguments, Arg _argptr) { if (trying) {