From 0b04fbeccdf361b7f1800adff1c69ebd8b357c37 Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Sat, 11 Oct 2008 21:11:17 +0100 Subject: [PATCH] Fixed isDeclarator Was failing to recognise nested functions where the return wasn't a basic type, because it expected "{" after the parameters, not ":". --- dmd2/parse.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dmd2/parse.c b/dmd2/parse.c index e0c36ca..5217fdc 100644 --- a/dmd2/parse.c +++ b/dmd2/parse.c @@ -4283,7 +4283,13 @@ int Parser::isDeclarator(Token **pt, int *haveId, enum TOK endtok) case TOKendline: case TOKsemicolon: case TOKlcurly: + case TOKcolon: case TOKin: + if ((dltSyntax && t->value == TOKlcurly) || + (!dltSyntax && t->value == TOKcolon)) { + return FALSE; + } + // The !parens is to disallow unnecessary parentheses if (!parens && (endtok == TOKreserved || endtok == t->value)) { *pt = t; -- 2.11.4.GIT