Mercurial > projects > dil
changeset 226:aa38e1401217
- Fixed cases T.Alias and T.Typedef. Wrong function called.
- Fix in parseFunctionBody(): need to skip T.In and T.LParen.
- Added cases T.Alias and T.Typedef to parseStatement().
- Fix in parseParameterList(): need to skip T.Ellipses.
author | aziz |
---|---|
date | Fri, 27 Jul 2007 08:16:00 +0000 |
parents | 8883c113c2f1 |
children | cd0acc9dadc1 |
files | trunk/src/Parser.d |
diffstat | 1 files changed, 10 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/trunk/src/Parser.d Thu Jul 26 20:42:04 2007 +0000 +++ b/trunk/src/Parser.d Fri Jul 27 08:16:00 2007 +0000 @@ -159,11 +159,11 @@ break; case T.Alias: nT(); - decl = new AliasDeclaration(parseDeclarationDefinition()); + decl = new AliasDeclaration(parseDeclaration()); break; case T.Typedef: nT(); - decl = new TypedefDeclaration(parseDeclarationDefinition()); + decl = new TypedefDeclaration(parseDeclaration()); break; case T.Static: Token t; @@ -298,7 +298,7 @@ { Token next; lx.peek(next); - if (next.type == T.Comma || next.type == T.Assign) + if (/+next.type == T.Comma || +/next.type == T.Assign) { ident = token.identifier; nT(); @@ -472,6 +472,7 @@ case T.In: //if (func.inBody) // TODO: issue error msg. + nT(); require(T.LBrace); func.inBody = parseStatements(); require(T.RBrace); @@ -482,6 +483,7 @@ nT(); if (token.type == T.LParen) { + nT(); func.outIdent = requireIdentifier(); require(T.RParen); } @@ -1521,6 +1523,10 @@ case T.Version: s = parseVersionStatement(); break; + // DeclDef + case T.Alias, T.Typedef: + d = parseDeclarationDefinition(); + goto case_DeclarationStatement; case T.Enum: d = parseEnumDeclaration(); goto case_DeclarationStatement; @@ -3109,6 +3115,7 @@ case T.Ref: stc = StorageClass.Ref; nT(); goto default; case T.Lazy: stc = StorageClass.Lazy; nT(); goto default; case T.Ellipses: + nT(); params ~= new Parameter(StorageClass.Variadic, null, null, null); break; default: