fixes #425 :: Upgrade to DMDFE 1.058 patch; big thanks to SiegeLord

This commit is contained in:
Moritz Warning
2010-09-04 12:42:38 +02:00
parent d5d6d68c47
commit fbba26f9bb
7 changed files with 936 additions and 688 deletions

View File

@@ -564,6 +564,18 @@ int AliasDeclaration::overloadInsert(Dsymbol *s)
*/
//printf("AliasDeclaration::overloadInsert('%s')\n", s->toChars());
if (aliassym) // see test/test56.d
{
Dsymbol *a = aliassym->toAlias();
FuncDeclaration *f = a->isFuncDeclaration();
if (f) // BUG: what if it's a template?
{
FuncAliasDeclaration *fa = new FuncAliasDeclaration(f);
aliassym = fa;
return fa->overloadInsert(s);
}
}
if (overnext == NULL)
{
if (s == this)

View File

@@ -965,6 +965,7 @@ void DocComment::parseSections(unsigned char *comment)
{
p = skipwhitespace(p);
pstart = p;
pend = p;
/* Find end of section, which is ended by one of:
* 'identifier:' (but not inside a code section)
@@ -986,6 +987,7 @@ void DocComment::parseSections(unsigned char *comment)
// BUG: handle UTF PS and LS too
if (!*p || *p == '\r' || *p == '\n' && numdash >= 3)
inCode ^= 1;
pend = p;
}
if (!inCode && isIdStart(p))
@@ -1007,9 +1009,7 @@ void DocComment::parseSections(unsigned char *comment)
while (1)
{
if (!*p)
{ pend = p;
goto L1;
}
if (*p == '\n')
{ p++;
if (*p == '\n' && !summary && !namelen)
@@ -1021,6 +1021,7 @@ void DocComment::parseSections(unsigned char *comment)
break;
}
p++;
pend = p;
}
p = skipwhitespace(p);
}
@@ -1819,7 +1820,13 @@ void highlightText(Scope *sc, Dsymbol *s, OutBuffer *buf, unsigned offset)
// Remove the entire --- line, including blanks and \n
buf->remove(iLineStart, i - iLineStart + eollen);
i = iLineStart;
if (inCode && (i <= iCodeStart))
{ // Empty code section, just remove it completely.
inCode = 0;
break;
}
if (inCode)
{
inCode = 0;
@@ -1841,6 +1848,7 @@ void highlightText(Scope *sc, Dsymbol *s, OutBuffer *buf, unsigned offset)
i = buf->insert(i, pre, sizeof(pre) - 1);
iCodeStart = i;
i--; // place i on >
leadingBlank = true;
}
}
break;
@@ -1893,6 +1901,8 @@ void highlightText(Scope *sc, Dsymbol *s, OutBuffer *buf, unsigned offset)
}
}
Ldone:
if (inCode)
s->error("unmatched --- in DDoc comment");
;
}

File diff suppressed because it is too large Load Diff

View File

@@ -63,7 +63,7 @@ Global::Global()
copyright = "Copyright (c) 1999-2010 by Digital Mars and Tomas Lindquist Olsen";
written = "written by Walter Bright and Tomas Lindquist Olsen";
version = "v1.057";
version = "v1.058";
ldc_version = LDC_REV;
llvm_version = LLVM_REV_STR;
global.structalign = 8;

View File

@@ -388,6 +388,15 @@ void Module::read(Loc loc)
//printf("Module::read('%s') file '%s'\n", toChars(), srcfile->toChars());
if (srcfile->read())
{ error(loc, "cannot read file '%s'", srcfile->toChars());
if (!global.gag)
{ /* Print path
*/
for (size_t i = 0; i < global.path->dim; i++)
{
char *p = (char *)global.path->data[i];
fprintf(stdmsg, "import path[%d] = %s\n", i, p);
}
}
fatal();
}
}
@@ -660,10 +669,12 @@ void Module::parse()
// Update global list of modules
if (!dst->insert(this))
{
if (md)
error(loc, "is in multiple packages %s", md->toChars());
else
error(loc, "is in multiple defined");
Dsymbol *prev = dst->lookup(ident);
assert(prev);
Module *mprev = prev->isModule();
assert(mprev);
error(loc, "from file %s conflicts with another module %s from file %s",
srcname, mprev->toChars(), mprev->srcfile->toChars());
}
else
{

View File

@@ -2109,6 +2109,21 @@ int TypeSArray::isZeroInit(Loc loc)
return next->isZeroInit(loc);
}
Expression *TypeSArray::defaultInitLiteral(Loc loc)
{
#if LOGDEFAULTINIT
printf("TypeSArray::defaultInitLiteral() '%s'\n", toChars());
#endif
size_t d = dim->toInteger();
Expression *elementinit = next->defaultInitLiteral(loc);
Expressions *elements = new Expressions();
elements->setDim(d);
for (size_t i = 0; i < d; i++)
elements->data[i] = elementinit;
ArrayLiteralExp *ae = new ArrayLiteralExp(0, elements);
ae->type = this;
return ae;
}
Expression *TypeSArray::toExpression()
{

View File

@@ -1,6 +1,6 @@
// Compiler implementation of the D programming language
// Copyright (c) 1999-2007 by Digital Mars
// Copyright (c) 1999-2010 by Digital Mars
// All Rights Reserved
// written by Walter Bright
// http://www.digitalmars.com
@@ -344,6 +344,7 @@ struct TypeSArray : TypeArray
unsigned memalign(unsigned salign);
MATCH implicitConvTo(Type *to);
Expression *defaultInit(Loc loc);
Expression *defaultInitLiteral(Loc loc);
#if IN_DMD
dt_t **toDt(dt_t **pdt);
dt_t **toDtElem(dt_t **pdt, Expression *e);