1) Allow '\' before a non-newline as a token in the preprocessor, and 2) localize line-continuation to just the pp scanner.

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24530 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
John Kessenich 2013-12-16 23:58:15 +00:00
parent 27151efa71
commit bd95819123
10 changed files with 245 additions and 78 deletions

View file

@ -190,12 +190,6 @@ int TPpContext::CPPdefine(TPpToken* ppToken)
TSourceLoc defineLoc = ppToken->loc; // because ppToken is going to go to the next line before we report errors
mac.body = new TokenStream;
while (token != '\n') {
if (token == '\\') {
parseContext.lineContinuationCheck(ppToken->loc, false);
token = currentInput->scan(this, currentInput, ppToken);
if (token == '\n' || token == '\r')
token = currentInput->scan(this, currentInput, ppToken);
}
RecordToken(mac.body, token, ppToken);
token = currentInput->scan(this, currentInput, ppToken);
if (token != '\n' && ppToken->space)