DUChain: How should we support case insensitive functions?

Milian Wolff mail at milianw.de
Thu Aug 20 15:53:59 UTC 2009


Milian Wolff wrote:
> Hi guys!
> 
> Php is really insane. When using classes, functions and methods, they 
> don't care about the case.
> 
> echo() == Echo() == ECHO() == ...
> 
> I want to know what you think on how I should support this? Are there 
> more languages that do something similar? I heard that VB apparently 
> doesn't care about cases. Any other?
> 
> If it's only a few languages I'd fix my *Builder classes to always 
> .toLower() before looking for classes, methods, functions... But this is 
> potentially error prone as I have to make sure that every place uses 
> that...
> 
> Would it be possible / practical to move this into the DUChain? But only 
> if other languages are case insensitive as well.

Just did a bit more thinking:

It would be good if we could support case-insensitivity in at least 
functions like
DUContext::findDeclararations, DUContext::findLocalDeclarations, 
PersistentSymbolTable::declarations etc. pp.

That way I could make uses case insensitive without the need to copy too 
much code. And I don't want to make the declarationbuilder save 
everything in lowercase, as then camelcase'd functions etc. would be 
all-lowercase after code-completion.

-- 
Milian Wolff
http://milianw.de




More information about the KDevelop-devel mailing list