diff --git a/src/parse.c b/src/parse.c index dd481df..0ca48e4 100644 --- a/src/parse.c +++ b/src/parse.c @@ -2726,6 +2726,35 @@ Dsymbols *Parser::parseDeclarations(StorageClass storage_class, unsigned char *c addComment(s, comment); return a; } + // alias this = identifier; + Token *tk = peek(&token); + if (token.value == TOKthis && tk->value == TOKassign && + peek(tk)->value == TOKidentifier) + { + check(TOKthis); + check(TOKassign); + AliasThis *s = new AliasThis(this->loc, token.ident); + nextToken(); + check(TOKsemicolon); + a = new Dsymbols(); + a->push(s); + addComment(s, comment); + return a; + } + // alias identifier = expression; + if (token.value == TOKidentifier && tk->value == TOKassign) + { + Identifier *id = token.ident; + nextToken(); + check(TOKassign); + t = parseType(); + check(TOKsemicolon); + Declaration *v = new AliasDeclaration(loc, id, t); + a = new Dsymbols(); + a->push(v); + addComment(v, comment); + return a; + } break; case TOKtypedef: if (!global.params.useDeprecated)