Mercurial > projects > ldc
comparison 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 |
comparison
equal
deleted
inserted
replaced
1639:41145d30acb8 | 1640:9bf06e02070b |
---|---|
1 | 1 |
2 // Compiler implementation of the D programming language | 2 // Compiler implementation of the D programming language |
3 // Copyright (c) 1999-2009 by Digital Mars | 3 // Copyright (c) 1999-2010 by Digital Mars |
4 // All Rights Reserved | 4 // All Rights Reserved |
5 // written by Walter Bright | 5 // written by Walter Bright |
6 // http://www.digitalmars.com | 6 // http://www.digitalmars.com |
7 // License for redistribution is by either the Artistic License | 7 // License for redistribution is by either the Artistic License |
8 // in artistic.txt, or the GNU General Public License in gnu.txt. | 8 // in artistic.txt, or the GNU General Public License in gnu.txt. |
11 #include <stdio.h> | 11 #include <stdio.h> |
12 #include <string.h> | 12 #include <string.h> |
13 #include <assert.h> | 13 #include <assert.h> |
14 | 14 |
15 #include "rmem.h" | 15 #include "rmem.h" |
16 #include "speller.h" | |
16 | 17 |
17 #include "mars.h" | 18 #include "mars.h" |
18 #include "dsymbol.h" | 19 #include "dsymbol.h" |
19 #include "aggregate.h" | 20 #include "aggregate.h" |
20 #include "identifier.h" | 21 #include "identifier.h" |
343 | 344 |
344 Dsymbol *Dsymbol::search(Loc loc, Identifier *ident, int flags) | 345 Dsymbol *Dsymbol::search(Loc loc, Identifier *ident, int flags) |
345 { | 346 { |
346 //printf("Dsymbol::search(this=%p,%s, ident='%s')\n", this, toChars(), ident->toChars()); | 347 //printf("Dsymbol::search(this=%p,%s, ident='%s')\n", this, toChars(), ident->toChars()); |
347 return NULL; | 348 return NULL; |
349 } | |
350 | |
351 /*************************************************** | |
352 * Search for symbol with correct spelling. | |
353 */ | |
354 | |
355 void *symbol_search_fp(void *arg, const char *seed) | |
356 { | |
357 Dsymbol *s = (Dsymbol *)arg; | |
358 Identifier id(seed, 0); | |
359 Module::clearCache(); | |
360 s = s->search(0, &id, 4|2); | |
361 return s; | |
362 } | |
363 | |
364 Dsymbol *Dsymbol::search_correct(Identifier *ident) | |
365 { | |
366 if (global.gag) | |
367 return NULL; // don't do it for speculative compiles; too time consuming | |
368 | |
369 return (Dsymbol *)speller(ident->toChars(), &symbol_search_fp, this, idchars); | |
348 } | 370 } |
349 | 371 |
350 /*************************************** | 372 /*************************************** |
351 * Search for identifier id as a member of 'this'. | 373 * Search for identifier id as a member of 'this'. |
352 * id may be a template instance. | 374 * id may be a template instance. |