From 735f3ec004991fc70ff3268b031654902406ffc1 Mon Sep 17 00:00:00 2001 From: Hackerpilot Date: Tue, 4 Mar 2014 23:17:54 -0800 Subject: [PATCH] Small refactoring --- stdx/d/parser.d | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/stdx/d/parser.d b/stdx/d/parser.d index e74201e..a95ec5a 100644 --- a/stdx/d/parser.d +++ b/stdx/d/parser.d @@ -191,17 +191,6 @@ class Parser node.comment = comment; comment = null; - // 'alias extern(C) void function() f;' => supported in DMD and DScanner. - // 'alias f = extern(C) void function();' => not supported in both DMD and DScanner. See D Bugzilla 10471. - // 'alias extern void function() f;' => supported in DMD, not supported in DScanner since it's a storage class. - if (currentIs(tok!"extern")) - { - if (!peekIs(tok!"(")) - error(`"(" expected for the linkage attribute`); - - node.linkageAttribute = parseLinkageAttribute(); - } - if (startsWith(tok!"identifier", tok!"=")) { AliasInitializer[] initializers; @@ -220,6 +209,15 @@ class Parser } else { + // 'alias extern(C) void function() f;' => supported in DMD and DScanner. + // 'alias f = extern(C) void function();' => not supported in both DMD and DScanner. See D Bugzilla 10471. + // 'alias extern void function() f;' => supported in DMD, not supported in DScanner since it's a storage class. + if (currentIs(tok!"extern")) + { + if (!peekIs(tok!"(")) + error(`"(" expected for the linkage attribute`); + node.linkageAttribute = parseLinkageAttribute(); + } warn("Syntax \"'alias' type identifier ';'\" is deprecated. Please use " ~ " \"'alias' identifier '=' type ';'\" instead."); if ((node.type = parseType()) is null) return null;