glslang front-end: Added a callback mechanism for #line/#pragma/#version/#extension. From Andrew Woloszyn <awoloszyn@google.com>.

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@31507 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
John Kessenich 2015-06-16 23:08:00 +00:00
parent 47632b7aaf
commit 9288f46b95
4 changed files with 65 additions and 24 deletions

View file

@ -175,6 +175,9 @@ void TParseContext::parserError(const char* s)
void TParseContext::handlePragma(TSourceLoc loc, const TVector<TString>& tokens)
{
if (pragmaCallback)
pragmaCallback(loc.line, tokens);
if (tokens.size() == 0)
return;
@ -5223,4 +5226,20 @@ TIntermNode* TParseContext::addSwitch(TSourceLoc loc, TIntermTyped* expression,
return switchNode;
}
void TParseContext::setCurrentLine(int line)
{
currentScanner->setLine(line);
if (lineCallback) {
lineCallback(line);
}
}
void TParseContext::notifyVersion(int line, int version, const char* type_string)
{
if (versionCallback) {
versionCallback(line, version, type_string);
}
}
} // end namespace glslang