Mercurial > projects > dil
diff trunk/src/Parser.d @ 290:7933a0c17c9f
- Changed class FunctionDeclaration. Parses passes return type, function name, template parameters, normal parameters and function body to constructor.
author | aziz |
---|---|
date | Wed, 08 Aug 2007 11:54:03 +0000 |
parents | a99357783c6f |
children | c0e857931ff6 |
line wrap: on
line diff
--- a/trunk/src/Parser.d Wed Aug 08 11:35:03 2007 +0000 +++ b/trunk/src/Parser.d Wed Aug 08 11:54:03 2007 +0000 @@ -341,12 +341,9 @@ { type = parseType(); ident = requireId(); -// writefln("trying=%s,errorCount=%d", trying, errorCount); -// writefln("ident=%s", ident); // Type FunctionName ( ParameterList ) FunctionBody if (token.type == T.LParen) { -// writef("°Function°"); // It's a function declaration TemplateParameters tparams; if (tokenAfterParenIs(T.LParen)) @@ -357,10 +354,8 @@ auto params = parseParameterList(); // ReturnType FunctionName ( ParameterList ) - type = new FunctionType(type, params, tparams); -// type = parseDeclaratorSuffix(type); auto funcBody = parseFunctionBody(); - return new FunctionDeclaration(ident, type, null, funcBody); + return new FunctionDeclaration(type, ident, tparams, params, funcBody); } type = parseDeclaratorSuffix(type); }