forked from qt-creator/qt-creator
		
	Alternative implementation of the indexer. It is a little bit slower, but I'm going to make it faster.
Unfortunately the refactoring of the indexer is kind of necessary. I need to merge the new binding pass.
This commit is contained in:
		@@ -117,6 +117,13 @@ Macro *Environment::bind(const Macro &__macro)
 | 
			
		||||
    return m;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Environment::addMacros(const QList<Macro> ¯os)
 | 
			
		||||
{
 | 
			
		||||
    foreach (const Macro ¯o, macros) {
 | 
			
		||||
        bind(macro);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
Macro *Environment::remove(const QByteArray &name)
 | 
			
		||||
{
 | 
			
		||||
    Macro macro;
 | 
			
		||||
@@ -127,6 +134,23 @@ Macro *Environment::remove(const QByteArray &name)
 | 
			
		||||
    return bind(macro);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Environment::reset()
 | 
			
		||||
{
 | 
			
		||||
    if (_macros) {
 | 
			
		||||
        qDeleteAll(firstMacro(), lastMacro());
 | 
			
		||||
        free(_macros);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (_hash)
 | 
			
		||||
        free(_hash);
 | 
			
		||||
 | 
			
		||||
    _macros = 0;
 | 
			
		||||
    _allocated_macros = 0;
 | 
			
		||||
    _macro_count = -1;
 | 
			
		||||
    _hash = 0;
 | 
			
		||||
    _hash_count = 401;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool Environment::isBuiltinMacro(const QByteArray &s) const
 | 
			
		||||
{
 | 
			
		||||
    if (s.length() != 8)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user