Commit dca2e821 authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Removed obsolete code.

parent 70290937
......@@ -282,15 +282,6 @@ public:
_workingCopy(workingCopy)
{ }
DeprecatedLookupContext lookupContext(unsigned line, unsigned column) const
{ return lookupContext(_doc->findSymbolAt(line, column)); }
DeprecatedLookupContext lookupContext(Symbol *symbol) const
{
DeprecatedLookupContext context(symbol, Document::create(QLatin1String("<none>")), _doc, _snapshot);
return context;
}
void operator()(Document::Ptr doc)
{
_doc = doc;
......@@ -300,49 +291,17 @@ public:
if (_workingCopy.contains(doc->fileName()))
mode = Document::FullCheck;
if (doc->isParsed() && mode == Document::FastCheck) {
TranslationUnit *unit = doc->translationUnit();
MemoryPool *pool = unit->memoryPool();
Parser parser(unit);
Semantic semantic(unit);
Namespace *globalNamespace = doc->control()->newNamespace(0);
doc->setGlobalNamespace(globalNamespace);
Scope *globals = globalNamespace->members();
while (parser.LA()) {
unsigned start_declaration = parser.cursor();
DeclarationAST *declaration = 0;
doc->check(mode);
if (parser.parseDeclaration(declaration)) {
semantic.check(declaration, globals);
if (mode == Document::FullCheck) {
// run the binding pass
NamespaceBindingPtr ns = bind(doc, _snapshot);
} else {
doc->translationUnit()->error(start_declaration, "expected a declaration");
parser.rewind(start_declaration + 1);
parser.skipUntilDeclaration();
}
parser.clearTemplateArgumentList();
pool->reset();
}
// check for undefined symbols.
CheckUndefinedSymbols checkUndefinedSymbols(doc);
checkUndefinedSymbols.setGlobalNamespaceBinding(ns);
} else {
doc->parse();
doc->check(mode);
if (mode == Document::FullCheck) {
// run the binding pass
NamespaceBindingPtr ns = bind(doc, _snapshot);
// check for undefined symbols.
CheckUndefinedSymbols checkUndefinedSymbols(doc);
checkUndefinedSymbols.setGlobalNamespaceBinding(ns);
checkUndefinedSymbols(doc->translationUnit()->ast()); // ### FIXME
}
checkUndefinedSymbols(doc->translationUnit()->ast()); // ### FIXME
}
doc->releaseTranslationUnit();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment