Improve preprocessor by using GLSL scanner, allowing read-only strings to be compiled, unifying of line # tracking, and correct detection that ES #version appeared after a comment.

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23721 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
John Kessenich 2013-10-28 18:12:06 +00:00
parent 9497485e14
commit ea869fb403
20 changed files with 285 additions and 300 deletions

View file

@ -330,14 +330,14 @@ void TParseContext::updateExtensionBehavior(const char* extName, const char* beh
else if (! strcmp("warn", behaviorString))
behavior = EBhWarn;
else
error(currentLoc, "behavior not supported", "#extension", behaviorString);
error(getCurrentLoc(), "behavior not supported", "#extension", behaviorString);
// Update the current behavior
TMap<TString, TExtensionBehavior>::iterator iter;
if (! strcmp(extName, "all")) {
// special case for the 'all' extension; apply it to every extension present
if (behavior == EBhRequire || behavior == EBhEnable) {
error(currentLoc, "extension 'all' cannot have 'require' or 'enable' behavior", "#extension", "");
error(getCurrentLoc(), "extension 'all' cannot have 'require' or 'enable' behavior", "#extension", "");
return;
} else {
for (iter = extensionBehavior.begin(); iter != extensionBehavior.end(); ++iter)
@ -349,12 +349,12 @@ void TParseContext::updateExtensionBehavior(const char* extName, const char* beh
if (iter == extensionBehavior.end()) {
switch (behavior) {
case EBhRequire:
error(currentLoc, "extension not supported", "#extension", extName);
error(getCurrentLoc(), "extension not supported", "#extension", extName);
break;
case EBhEnable:
case EBhWarn:
case EBhDisable:
warn(currentLoc, "extension not supported", "#extension", extName);
warn(getCurrentLoc(), "extension not supported", "#extension", extName);
break;
default:
assert(0 && "unexpected behavior");