diff dmd/Dsymbol.d @ 79:43073c7c7769

updated to 2.035 also implemented a few missing functions still crashes in Import.importAll though
author Trass3r
date Mon, 30 Aug 2010 03:57:51 +0200
parents 7e0d548de9e6
children 903b95002d4e
line wrap: on
line diff
--- a/dmd/Dsymbol.d	Sun Aug 29 14:39:08 2010 +0100
+++ b/dmd/Dsymbol.d	Mon Aug 30 03:57:51 2010 +0200
@@ -130,6 +130,8 @@
     return sa;
 }
 
+alias Vector!Dsymbol Dsymbols;
+
 class Dsymbol
 {
     Identifier ident;
@@ -137,7 +139,7 @@
     Dsymbol parent;
     Symbol* csym;		// symbol for code generator
     Symbol* isym;		// import version of csym
-    ubyte* comment;	// documentation comment for this Dsymbol
+    string comment;	// documentation comment for this Dsymbol
     Loc loc;			// where defined
     Scope scope_;		// !=null means context to use for semantic()
 
@@ -403,7 +405,7 @@
 		parent = sd;
 		if (!isAnonymous())		// no name, so can't add it to symbol table
 		{
-			if (!sd.symtab.insert(this))	// if name is already defined
+			if (!sd.symtabInsert(this))	// if name is already defined
 			{
 				Dsymbol s2 = sd.symtab.lookup(ident);
 				if (!s2.overloadInsert(this))
@@ -429,10 +431,14 @@
 			sc.setNoFree();		// may need it even after semantic() finishes
 		scope_ = sc;
 	}
+    
+    void importAll(Scope sc)
+    {
+    }
 	
     void semantic(Scope sc)
 	{
-		assert(false);
+    	error("%p has no semantic routine", this);
 	}
 	
 	/*************************************
@@ -528,7 +534,8 @@
 		assert(false);
 	}
 	
-version (_DH) {
+version (_DH)
+{
     char* toHChars()
 	{
 		assert(false);
@@ -548,6 +555,10 @@
 	{
 		assert(false);
 	}
+    
+    void toJsonBuffer(OutBuffer buf)
+    {
+    }
 	
     uint size(Loc loc)
 	{
@@ -723,16 +734,21 @@
     void addLocalClass(ClassDeclarations) { }
     void checkCtorConstInit() { }
 
-    void addComment(ubyte* comment)
+    // since comment is stored immutable string is correct here
+    void addComment(string comment)
 	{
 		//if (comment)
-			//printf("adding comment '%s' to symbol %p '%s'\n", comment, this, toChars());
+			//writef("adding comment '%s' to symbol %p '%s'\n", comment, this, toChars());
 
-		if (this.comment is null) {
+		if (this.comment is null)
+		{
 			this.comment = comment;
-		} else {
-static if (true) {
-			if (comment !is null && strcmp(cast(char*)comment, cast(char*)this.comment) != 0)
+		}
+		else
+		{
+static if (true)
+{
+			if (comment !is null && comment != this.comment)
 			{	// Concatenate the two
 				this.comment = Lexer.combineComments(this.comment, comment);
 			}
@@ -887,15 +903,15 @@
     ArrayScopeSymbol isArrayScopeSymbol() { return null; }
     Import isImport() { return null; }
     EnumDeclaration isEnumDeclaration() { return null; }
-version (_DH) {
+version (_DH)
+{
     DeleteDeclaration isDeleteDeclaration() { return null; }
 }
     SymbolDeclaration isSymbolDeclaration() { return null; }
     AttribDeclaration isAttribDeclaration() { return null; }
     OverloadSet isOverloadSet() { return null; }
-version (TARGET_NET) {
+version (TARGET_NET)
+{
     PragmaScope isPragmaScope() { return null; }
 }
-}
-
-alias Vector!Dsymbol Dsymbols;
\ No newline at end of file
+}
\ No newline at end of file