Mercurial > projects > dil
diff trunk/src/dil/parser/Parser.d @ 646:68953760d569
Added class ParenExpression.
author | Aziz K?ksal <aziz.koeksal@gmail.com> |
---|---|
date | Mon, 14 Jan 2008 17:21:45 +0100 |
parents | 05645f5613c1 |
children | eb490ba8dba0 |
line wrap: on
line diff
--- a/trunk/src/dil/parser/Parser.d Mon Jan 14 16:01:21 2008 +0100 +++ b/trunk/src/dil/parser/Parser.d Mon Jan 14 17:21:45 2008 +0100 @@ -741,7 +741,6 @@ if (prev_lt == LinkageType.None) prev_lt = lt; else - // TODO: create new msg RedundantLinkageType. error(begin, MSG.RedundantLinkageType, Token.textSpan(begin, this.prevToken)); } @@ -1074,7 +1073,7 @@ BaseClass[] bases; - while (1) + do { Protection prot = Protection.Public; switch (token.type) @@ -1092,13 +1091,8 @@ LparseBasicType: auto begin = token; auto type = parseBasicType(); - //if (type.tid != TID.DotList) - // TODO: issue error msg. base classes can only be one or more identifiers or template instances separated by dots. bases ~= set(new BaseClass(prot, type), begin); - if (token.type != T.Comma) - break; - nT(); - } + } while (skipped(T.Comma)) return bases; } @@ -1357,7 +1351,6 @@ assert(token.type == T.Delete); nT(); // Skip delete keyword. auto parameters = parseParameterList(); - // TODO: only one parameter of type void* allowed. Check in parsing or semantic phase? auto funcBody = parseFunctionBody(); return new DeleteDeclaration(parameters, funcBody); } @@ -1402,7 +1395,6 @@ { if (skipped(T.LParen)) { - // TODO: What about mixin(...).ident;? auto e = parseAssignExpression(); require(T.RParen); require(T.Semicolon); @@ -2152,7 +2144,6 @@ case ID.exit, ID.success, ID.failure: break; default: - // TODO: create MID.InvalidScopeIdentifier error(this.prevToken, MSG.InvalidScopeIdentifier, this.prevToken.srcText); } require(T.RParen); @@ -3364,7 +3355,7 @@ e = new IsExpression(type, ident, opTok, specTok, specType, tparams); break; case T.LParen: - if (tokenAfterParenIs(T.LBrace)) + if (tokenAfterParenIs(T.LBrace)) // Check for "(...) {" { auto parameters = parseParameterList(); // ( ParameterList ) FunctionBody @@ -3377,7 +3368,7 @@ nT(); e = parseExpression(); require(T.RParen); - // TODO: create ParenExpression? + e = new ParenExpression(e); } break; version(D2)