Run the semantic checker and check for invalid function calls.

This commit is contained in:
Roberto Raggi
2010-11-26 12:55:24 +01:00
parent 455429794c
commit 61e99b3deb
3 changed files with 34 additions and 14 deletions

View File

@@ -38,6 +38,7 @@
#include <glsl/glsllexer.h>
#include <glsl/glslparser.h>
#include <glsl/glslengine.h>
#include <glsl/glslsemantic.h>
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/actioncontainer.h>
@@ -269,6 +270,10 @@ void GLSLTextEditor::updateDocumentNow()
Parser parser(&engine, preprocessedCode.constData(), preprocessedCode.size(), variant);
TranslationUnitAST *ast = parser.parse();
Semantic sem(&engine);
Scope *globalScope = sem.translationUnit(ast);
Q_UNUSED(globalScope);
QTextCharFormat errorFormat;
errorFormat.setUnderlineStyle(QTextCharFormat::WaveUnderline);
errorFormat.setUnderlineColor(Qt::red);
@@ -295,9 +300,6 @@ void GLSLTextEditor::updateDocumentNow()
setExtraSelections(CodeWarningsSelection, sels);
// ### process the ast
(void) ast;
// refresh the identifiers.
m_identifiers = engine.identifiers();
}