diff trunk/src/dil/ImportParser.d @ 495:b60450804b6e

Attributes are evaluated during the parsing phase now. Renamed parseDeclarationDefinitionsBlock to parseDeclarationDefinitionsBody. Renamed parseDeclaration to parseVariableOrFunction. Removed class Linkage, renamed parseLinkage to parseLinkageType and modified it so that it returns a value from enum LinkageType. Fix in parseStorageAttribute(): class invariants are recognized now. Modified parseAlignAttribute() so that returns an uint - the alignment size. Removed classes AttributeStatement and ExternStatement. Using Declarations instead in parseAttributeStatement(). Added LinkageType to module Enums. Added StorageClassDeclaration and renamed ExternDeclaration to LinkageDeclaration.
author Aziz K?ksal <aziz.koeksal@gmail.com>
date Sat, 08 Dec 2007 22:20:34 +0100
parents 9c208925a3d4
children c769bc239006
line wrap: on
line diff
--- a/trunk/src/dil/ImportParser.d	Fri Dec 07 18:22:35 2007 +0100
+++ b/trunk/src/dil/ImportParser.d	Sat Dec 08 22:20:34 2007 +0100
@@ -196,9 +196,8 @@
     case T.Import:
     case_Import:
       auto decl = parseImportDeclaration();
-      assert(decl && decl.kind == NodeKind.ImportDeclaration);
-      decl.prot = prot; // Set the protection attribute.
-      imports ~= cast(ImportDeclaration)cast(void*)decl;
+      decl.setProtection(prot); // Set the protection attribute.
+      imports ~= CastTo!(ImportDeclaration)(decl);
       break;
     case T.Enum:
       nT();