diff dmd/dsymbol.c @ 1640:9bf06e02070b

Merge DMD 1.057.
author Christian Kamm <kamm incasoftware de>
date Mon, 08 Mar 2010 21:39:20 +0100
parents 44b145be2ef5
children
line wrap: on
line diff
--- a/dmd/dsymbol.c	Mon Mar 08 20:09:18 2010 +0100
+++ b/dmd/dsymbol.c	Mon Mar 08 21:39:20 2010 +0100
@@ -1,6 +1,6 @@
 
 // Compiler implementation of the D programming language
-// Copyright (c) 1999-2009 by Digital Mars
+// Copyright (c) 1999-2010 by Digital Mars
 // All Rights Reserved
 // written by Walter Bright
 // http://www.digitalmars.com
@@ -13,6 +13,7 @@
 #include <assert.h>
 
 #include "rmem.h"
+#include "speller.h"
 
 #include "mars.h"
 #include "dsymbol.h"
@@ -347,6 +348,27 @@
     return NULL;
 }
 
+/***************************************************
+ * Search for symbol with correct spelling.
+ */
+
+void *symbol_search_fp(void *arg, const char *seed)
+{
+    Dsymbol *s = (Dsymbol *)arg;
+    Identifier id(seed, 0);
+    Module::clearCache();
+    s = s->search(0, &id, 4|2);
+    return s;
+}
+
+Dsymbol *Dsymbol::search_correct(Identifier *ident)
+{
+    if (global.gag)
+	return NULL;		// don't do it for speculative compiles; too time consuming
+
+    return (Dsymbol *)speller(ident->toChars(), &symbol_search_fp, this, idchars);
+}
+
 /***************************************
  * Search for identifier id as a member of 'this'.
  * id may be a template instance.