# HG changeset patch # User korDen # Date 1282362800 -14400 # Node ID 0aa7d1437ada553f35a92a0beabb88568b28eb64 # Parent 0bd8afbaffd7b25b0c574f301deb162d2e02e956 AttribDeclaration.oneMember Lexer.decodeUTF WithStatement.ctor StructDeclaration.syntaxCopy CtorDeclaration.syntaxCopy ConditionalStatement.syntaxCopy ProtDeclaration.syntaxCopy ArrayScopeSymbol.this TemplateDeclaration.toChars diff -r 0bd8afbaffd7 -r 0aa7d1437ada dmd/ArrayScopeSymbol.d --- a/dmd/ArrayScopeSymbol.d Sat Aug 21 07:39:45 2010 +0400 +++ b/dmd/ArrayScopeSymbol.d Sat Aug 21 07:53:20 2010 +0400 @@ -42,7 +42,10 @@ this(Scope sc, TypeTuple t) { - assert(false); + exp = null; + type = t; + td = null; + this.sc = sc; } this(Scope sc, TupleDeclaration s) diff -r 0bd8afbaffd7 -r 0aa7d1437ada dmd/AttribDeclaration.d --- a/dmd/AttribDeclaration.d Sat Aug 21 07:39:45 2010 +0400 +++ b/dmd/AttribDeclaration.d Sat Aug 21 07:53:20 2010 +0400 @@ -191,7 +191,9 @@ bool oneMember(Dsymbol* ps) { - assert(false); + Array d = include(null, null); + + return Dsymbol.oneMembers(d, ps); } bool hasPointers() diff -r 0bd8afbaffd7 -r 0aa7d1437ada dmd/ConditionalStatement.d --- a/dmd/ConditionalStatement.d Sat Aug 21 07:39:45 2010 +0400 +++ b/dmd/ConditionalStatement.d Sat Aug 21 07:53:20 2010 +0400 @@ -25,7 +25,11 @@ Statement syntaxCopy() { - assert(false); + Statement e = null; + if (elsebody) + e = elsebody.syntaxCopy(); + ConditionalStatement s = new ConditionalStatement(loc, condition.syntaxCopy(), ifbody.syntaxCopy(), e); + return s; } Statement semantic(Scope sc) diff -r 0bd8afbaffd7 -r 0aa7d1437ada dmd/CtorDeclaration.d --- a/dmd/CtorDeclaration.d Sat Aug 21 07:39:45 2010 +0400 +++ b/dmd/CtorDeclaration.d Sat Aug 21 07:53:20 2010 +0400 @@ -37,7 +37,16 @@ Dsymbol syntaxCopy(Dsymbol) { - assert(false); + CtorDeclaration f = new CtorDeclaration(loc, endloc, null, varargs); + + f.outId = outId; + f.frequire = frequire ? frequire.syntaxCopy() : null; + f.fensure = fensure ? fensure.syntaxCopy() : null; + f.fbody = fbody ? fbody.syntaxCopy() : null; + assert(!fthrows); // deprecated + + f.arguments = Argument.arraySyntaxCopy(arguments); + return f; } void semantic(Scope sc) diff -r 0bd8afbaffd7 -r 0aa7d1437ada dmd/Lexer.d --- a/dmd/Lexer.d Sat Aug 21 07:39:45 2010 +0400 +++ b/dmd/Lexer.d Sat Aug 21 07:53:20 2010 +0400 @@ -2466,9 +2466,36 @@ assert(false); } + /******************************************** + * Decode UTF character. + * Issue error messages for invalid sequences. + * Return decoded character, advance p to last character in UTF sequence. + */ uint decodeUTF() { - assert(false); + dchar u; + ubyte c; + ubyte* s = p; + size_t len; + size_t idx; + string msg; + + c = *s; + assert(c & 0x80); + + // Check length of remaining string up to 6 UTF-8 characters + for (len = 1; len < 6 && s[len]; len++) { + ; + } + + idx = 0; + msg = utf_decodeChar(cast(string)s[0..len], &idx, &u); + p += idx - 1; + if (msg) + { + error("%s", msg); + } + return u; } void getDocComment(Token* t, uint lineComment) diff -r 0bd8afbaffd7 -r 0aa7d1437ada dmd/ProtDeclaration.d --- a/dmd/ProtDeclaration.d Sat Aug 21 07:39:45 2010 +0400 +++ b/dmd/ProtDeclaration.d Sat Aug 21 07:53:20 2010 +0400 @@ -22,7 +22,11 @@ Dsymbol syntaxCopy(Dsymbol s) { - assert(false); + ProtDeclaration pd; + + assert(!s); + pd = new ProtDeclaration(protection, Dsymbol.arraySyntaxCopy(decl)); + return pd; } void setScope(Scope sc) diff -r 0bd8afbaffd7 -r 0aa7d1437ada dmd/StructDeclaration.d --- a/dmd/StructDeclaration.d Sat Aug 21 07:39:45 2010 +0400 +++ b/dmd/StructDeclaration.d Sat Aug 21 07:53:20 2010 +0400 @@ -84,7 +84,14 @@ Dsymbol syntaxCopy(Dsymbol s) { - assert(false); + StructDeclaration sd; + + if (s) + sd = cast(StructDeclaration)s; + else + sd = new StructDeclaration(loc, ident); + ScopeDsymbol.syntaxCopy(sd); + return sd; } void semantic(Scope sc) diff -r 0bd8afbaffd7 -r 0aa7d1437ada dmd/TemplateDeclaration.d --- a/dmd/TemplateDeclaration.d Sat Aug 21 07:39:45 2010 +0400 +++ b/dmd/TemplateDeclaration.d Sat Aug 21 07:53:20 2010 +0400 @@ -309,7 +309,30 @@ string toChars() { - assert(false); + OutBuffer buf = new OutBuffer(); + HdrGenState hgs; + + /// memset(&hgs, 0, hgs.sizeof); + buf.writestring(ident.toChars()); + buf.writeByte('('); + for (int i = 0; i < parameters.dim; i++) + { + TemplateParameter tp = cast(TemplateParameter)parameters.data[i]; + if (i) + buf.writeByte(','); + tp.toCBuffer(buf, &hgs); + } + buf.writeByte(')'); +version (DMDV2) { + if (constraint) + { + buf.writestring(" if ("); + constraint.toCBuffer(buf, &hgs); + buf.writeByte(')'); + } +} + buf.writeByte(0); + return buf.extractString(); } void emitComment(Scope sc) diff -r 0bd8afbaffd7 -r 0aa7d1437ada dmd/WithStatement.d --- a/dmd/WithStatement.d Sat Aug 21 07:39:45 2010 +0400 +++ b/dmd/WithStatement.d Sat Aug 21 07:53:20 2010 +0400 @@ -19,8 +19,10 @@ this(Loc loc, Expression exp, Statement body_) { - assert(false); super(loc); + this.exp = exp; + this.body_ = body_; + wthis = null; } Statement syntaxCopy()