Fix public bug 1277: #line L sets the next line to L+1 or just L, based on the version of the language.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@29277 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
parent
560df75970
commit
2b20dcb64d
9 changed files with 91 additions and 68 deletions
|
|
@ -635,7 +635,18 @@ int TPpContext::CPPline(TPpToken* ppToken)
|
|||
if (! lineErr) {
|
||||
if (token == '\n')
|
||||
++lineRes;
|
||||
|
||||
// Desktop, pre-version 3.30: "After processing this directive
|
||||
// (including its new-line), the implementation will behave as if it is compiling at line number line+1 and
|
||||
// source string number source-string-number."
|
||||
//
|
||||
// Desktop, version 3.30 and later, and ES: "After processing this directive
|
||||
// (including its new-line), the implementation will behave as if it is compiling at line number line and
|
||||
// source string number source-string-number.
|
||||
if (parseContext.profile == EEsProfile || parseContext.version >= 330)
|
||||
--lineRes;
|
||||
parseContext.setCurrentLine(lineRes);
|
||||
|
||||
if (token != '\n') {
|
||||
int fileRes = 0;
|
||||
bool fileErr = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue