From 00768c371a6d81469a713a5e671d7a2fd7ac189d Mon Sep 17 00:00:00 2001 From: Hackerpilot Date: Thu, 7 Nov 2013 14:56:51 -0800 Subject: [PATCH] Fix mixin declarations --- stdx/d/parser.d | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/stdx/d/parser.d b/stdx/d/parser.d index 043d38e..bc00473 100644 --- a/stdx/d/parser.d +++ b/stdx/d/parser.d @@ -1686,18 +1686,26 @@ class ClassFour(A, B) if (someTest()) : Super {}}c; { auto b = setBookmark(); advance(); - auto t = peekPastParens(); - if (t !is null && t.type == TokenType.semicolon) + if (currentIs(TokenType.lParen)) { - goToBookmark(b); - node.mixinDeclaration = parseMixinDeclaration(); + auto t = peekPastParens(); + if (t !is null && t.type == TokenType.semicolon) + { + goToBookmark(b); + node.mixinDeclaration = parseMixinDeclaration(); + } + else + { + goToBookmark(b); + error("Declaration expected"); + advance(); + return null; + } } else { goToBookmark(b); - error("Declaration expected"); - advance(); - return null; + node.mixinDeclaration = parseMixinDeclaration(); } } break;