Skip to content

Commit

Permalink
Fix comments arond class/struct/enum decalrations
Browse files Browse the repository at this point in the history
  • Loading branch information
9rnsr committed Sep 23, 2015
1 parent 4fda426 commit 6e78737
Show file tree
Hide file tree
Showing 41 changed files with 1,490 additions and 1,163 deletions.
58 changes: 34 additions & 24 deletions src/aggregate.d
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ import ddmd.visitor;

enum Sizeok : int
{
SIZEOKnone, // size of aggregate is not computed yet
SIZEOKdone, // size of aggregate is set correctly
SIZEOKfwd, // error in computing size of aggregate
SIZEOKnone, // size of aggregate is not computed yet
SIZEOKdone, // size of aggregate is set correctly
SIZEOKfwd, // error in computing size of aggregate
}

alias SIZEOKnone = Sizeok.SIZEOKnone;
Expand All @@ -47,54 +47,64 @@ alias SIZEOKfwd = Sizeok.SIZEOKfwd;

enum Baseok : int
{
BASEOKnone, // base classes not computed yet
BASEOKin, // in process of resolving base classes
BASEOKdone, // all base classes are resolved
BASEOKsemanticdone, // all base classes semantic done
BASEOKnone, // base classes not computed yet
BASEOKin, // in process of resolving base classes
BASEOKdone, // all base classes are resolved
BASEOKsemanticdone, // all base classes semantic done
}

alias BASEOKnone = Baseok.BASEOKnone;
alias BASEOKin = Baseok.BASEOKin;
alias BASEOKdone = Baseok.BASEOKdone;
alias BASEOKsemanticdone = Baseok.BASEOKsemanticdone;

/***********************************************************
*/
extern (C++) class AggregateDeclaration : ScopeDsymbol
{
public:
Type type;
StorageClass storage_class;
Prot protection;
uint structsize; // size of struct
uint alignsize; // size of struct for alignment purposes
uint structsize; // size of struct
uint alignsize; // size of struct for alignment purposes
VarDeclarations fields; // VarDeclaration fields
Sizeok sizeok; // set when structsize contains valid data
Dsymbol deferred; // any deferred semantic2() or semantic3() symbol
bool isdeprecated; // true if deprecated
/* !=NULL if is nested
Sizeok sizeok; // set when structsize contains valid data
Dsymbol deferred; // any deferred semantic2() or semantic3() symbol
bool isdeprecated; // true if deprecated

/* !=null if is nested
* pointing to the dsymbol that directly enclosing it.
* 1. The function that enclosing it (nested struct and class)
* 2. The class that enclosing it (nested class only)
* 3. If enclosing aggregate is template, its enclosing dsymbol.
* See AggregateDeclaraton::makeNested for the details.
*/
Dsymbol enclosing;
VarDeclaration vthis; // 'this' parameter if this aggregate is nested

VarDeclaration vthis; // 'this' parameter if this aggregate is nested

// Special member functions
FuncDeclarations invs; // Array of invariants
FuncDeclaration inv; // invariant
NewDeclaration aggNew; // allocator
DeleteDeclaration aggDelete; // deallocator
Dsymbol ctor; // CtorDeclaration or TemplateDeclaration
FuncDeclarations invs; // Array of invariants
FuncDeclaration inv; // invariant
NewDeclaration aggNew; // allocator
DeleteDeclaration aggDelete; // deallocator

// CtorDeclaration or TemplateDeclaration
Dsymbol ctor;

// default constructor - should have no arguments, because
// it would be stored in TypeInfo_Class.defaultConstructor
CtorDeclaration defaultCtor;
Dsymbol aliasthis; // forward unresolved lookups to aliasthis
bool noDefaultCtor; // no default construction

Dsymbol aliasthis; // forward unresolved lookups to aliasthis
bool noDefaultCtor; // no default construction

FuncDeclarations dtors; // Array of destructors
FuncDeclaration dtor; // aggregate destructor
Expression getRTInfo; // pointer to GC info generated by object.RTInfo(this)
FuncDeclaration dtor; // aggregate destructor

Expression getRTInfo; // pointer to GC info generated by object.RTInfo(this)

/********************************* AggregateDeclaration ****************************/
final extern (D) this(Loc loc, Identifier id)
{
super(id);
Expand Down
8 changes: 4 additions & 4 deletions src/aliasthis.d
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@ import ddmd.root.outbuffer;
import ddmd.tokens;
import ddmd.visitor;

/**************************************************************/
/***********************************************************
* alias ident this;
*/
extern (C++) final class AliasThis : Dsymbol
{
public:
// alias Identifier this;
Identifier ident;

// it's anonymous (no identifier)
extern (D) this(Loc loc, Identifier ident)
{
super(null);
super(null); // it's anonymous (no identifier)
this.loc = loc;
this.ident = ident;
}
Expand Down
49 changes: 29 additions & 20 deletions src/attrib.d
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ import ddmd.tokens;
import ddmd.utf;
import ddmd.visitor;

/**************************************************************/
/***********************************************************
*/
extern (C++) class AttribDeclaration : Dsymbol
{
public:
Dsymbols* decl; // array of Dsymbol's
Dsymbols* decl; // array of Dsymbol's

/********************************* AttribDeclaration ****************************/
final extern (D) this(Dsymbols* decl)
{
this.decl = decl;
Expand Down Expand Up @@ -315,12 +315,13 @@ public:
}
}

/***********************************************************
*/
extern (C++) class StorageClassDeclaration : AttribDeclaration
{
public:
StorageClass stc;

/************************* StorageClassDeclaration ****************************/
final extern (D) this(StorageClass stc, Dsymbols* decl)
{
super(decl);
Expand Down Expand Up @@ -387,12 +388,13 @@ public:
}
}

/***********************************************************
*/
extern (C++) final class DeprecatedDeclaration : StorageClassDeclaration
{
public:
Expression msg;

/********************************* DeprecatedDeclaration ****************************/
extern (D) this(Expression msg, Dsymbols* decl)
{
super(STCdeprecated, decl);
Expand Down Expand Up @@ -426,12 +428,13 @@ public:
}
}

/***********************************************************
*/
extern (C++) final class LinkDeclaration : AttribDeclaration
{
public:
LINK linkage;

/********************************* LinkDeclaration ****************************/
extern (D) this(LINK p, Dsymbols* decl)
{
super(decl);
Expand Down Expand Up @@ -461,13 +464,14 @@ public:
}
}

/***********************************************************
*/
extern (C++) final class ProtDeclaration : AttribDeclaration
{
public:
Prot protection;
Identifiers* pkg_identifiers;

/********************************* ProtDeclaration ****************************/
/**
* Params:
* loc = source location of attribute token
Expand Down Expand Up @@ -553,12 +557,13 @@ public:
}
}

/***********************************************************
*/
extern (C++) final class AlignDeclaration : AttribDeclaration
{
public:
uint salign;

/********************************* AlignDeclaration ****************************/
extern (D) this(uint sa, Dsymbols* decl)
{
super(decl);
Expand All @@ -582,14 +587,15 @@ public:
}
}

/***********************************************************
*/
extern (C++) final class AnonDeclaration : AttribDeclaration
{
public:
bool isunion;
structalign_t alignment;
int sem; // 1 if successful semantic()
int sem; // 1 if successful semantic()

/********************************* AnonDeclaration ****************************/
extern (D) this(Loc loc, bool isunion, Dsymbols* decl)
{
super(decl);
Expand Down Expand Up @@ -701,12 +707,13 @@ public:
}
}

/***********************************************************
*/
extern (C++) final class PragmaDeclaration : AttribDeclaration
{
public:
Expressions* args; // array of Expression's
Expressions* args; // array of Expression's

/********************************* PragmaDeclaration ****************************/
extern (D) this(Loc loc, Identifier ident, Expressions* args, Dsymbols* decl)
{
super(decl);
Expand Down Expand Up @@ -1005,13 +1012,14 @@ public:
}
}

/***********************************************************
*/
extern (C++) class ConditionalDeclaration : AttribDeclaration
{
public:
Condition condition;
Dsymbols* elsedecl; // array of Dsymbol's for else block
Dsymbols* elsedecl; // array of Dsymbol's for else block

/********************************* ConditionalDeclaration ****************************/
final extern (D) this(Condition condition, Dsymbols* decl, Dsymbols* elsedecl)
{
super(decl);
Expand Down Expand Up @@ -1096,13 +1104,14 @@ public:
}
}

/***********************************************************
*/
extern (C++) final class StaticIfDeclaration : ConditionalDeclaration
{
public:
ScopeDsymbol scopesym;
int addisdone;

/***************************** StaticIfDeclaration ****************************/
extern (D) this(Condition condition, Dsymbols* decl, Dsymbols* elsedecl)
{
super(condition, decl, elsedecl);
Expand Down Expand Up @@ -1196,16 +1205,17 @@ public:
}
}

// Mixin declarations
/***********************************************************
* Mixin declarations, like:
* mixin("int x");
*/
extern (C++) final class CompileDeclaration : AttribDeclaration
{
public:
Expression exp;
ScopeDsymbol scopesym;
int compiled;

/***************************** CompileDeclaration *****************************/
// These are mixin declarations, like mixin("int x");
extern (D) this(Loc loc, Expression exp)
{
super(null);
Expand Down Expand Up @@ -1293,7 +1303,7 @@ public:
}
}

/**
/***********************************************************
* User defined attributes look like:
* @(args, ...)
*/
Expand All @@ -1302,7 +1312,6 @@ extern (C++) final class UserAttributeDeclaration : AttribDeclaration
public:
Expressions* atts;

/***************************** UserAttributeDeclaration *****************************/
extern (D) this(Expressions* atts, Dsymbols* decl)
{
super(decl);
Expand Down
17 changes: 11 additions & 6 deletions src/cond.d
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import ddmd.root.outbuffer;
import ddmd.tokens;
import ddmd.visitor;

/***********************************************************
*/
extern (C++) class Condition
{
public:
Expand All @@ -34,7 +36,6 @@ public:
// 2: do not include
int inc;

/* ============================================================ */
final extern (D) this(Loc loc)
{
this.loc = loc;
Expand All @@ -55,14 +56,15 @@ public:
}
}

/***********************************************************
*/
extern (C++) class DVCondition : Condition
{
public:
uint level;
Identifier ident;
Module mod;

/* ============================================================ */
final extern (D) this(Module mod, uint level, Identifier ident)
{
super(Loc());
Expand All @@ -82,10 +84,11 @@ public:
}
}

/***********************************************************
*/
extern (C++) final class DebugCondition : DVCondition
{
public:
/* ============================================================ */
static void setGlobalLevel(uint level)
{
global.params.debuglevel = level;
Expand Down Expand Up @@ -145,10 +148,11 @@ public:
}
}

/***********************************************************
*/
extern (C++) final class VersionCondition : DVCondition
{
public:
/* ============================================================ */
static void setGlobalLevel(uint level)
{
global.params.versionlevel = level;
Expand Down Expand Up @@ -322,13 +326,14 @@ public:
}
}

/***********************************************************
*/
extern (C++) final class StaticIfCondition : Condition
{
public:
Expression exp;
int nest; // limit circular dependencies
int nest; // limit circular dependencies

/**************************** StaticIfCondition *******************************/
extern (D) this(Loc loc, Expression exp)
{
super(loc);
Expand Down
Loading

0 comments on commit 6e78737

Please sign in to comment.