Report an error on the use of the line continuation character

TRAC #12260 Signed-off-by: Andrew Lewycky Signed-off-by: Daniel Koch Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@277 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 3debd2b4
......@@ -188,12 +188,9 @@ static int CPPdefine(yystypepp * yylvalpp)
}
mac.body = NewTokenStream(GetAtomString(atable, name), macros->pool);
while (token != '\n') {
while (token == '\\') {
token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
if (token == '\n')
token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
else
RecordToken(mac.body, '\\', yylvalpp);
if (token == '\\') {
CPPErrorToInfoLog("The line continuation character (\\) is not part of the OpenGL ES Shading Language");
return token;
}
RecordToken(mac.body, token, yylvalpp);
token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
......
......@@ -664,10 +664,8 @@ static int byte_scan(InputSrc *in, yystypepp * yylvalpp)
ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
while (ch != '"' && ch != '\n' && ch != EOF) {
if (ch == '\\') {
ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
if (ch == '\n' || ch == EOF) {
break;
}
CPPErrorToInfoLog("The line continuation character (\\) is not part of the OpenGL ES Shading Language");
return -1;
}
if (len < MAX_STRING_LEN) {
string_val[len] = ch;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment