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) ...@@ -188,12 +188,9 @@ static int CPPdefine(yystypepp * yylvalpp)
} }
mac.body = NewTokenStream(GetAtomString(atable, name), macros->pool); mac.body = NewTokenStream(GetAtomString(atable, name), macros->pool);
while (token != '\n') { while (token != '\n') {
while (token == '\\') { if (token == '\\') {
token = cpp->currentInput->scan(cpp->currentInput, yylvalpp); CPPErrorToInfoLog("The line continuation character (\\) is not part of the OpenGL ES Shading Language");
if (token == '\n') return token;
token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
else
RecordToken(mac.body, '\\', yylvalpp);
} }
RecordToken(mac.body, token, yylvalpp); RecordToken(mac.body, token, yylvalpp);
token = cpp->currentInput->scan(cpp->currentInput, yylvalpp); token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
......
...@@ -664,10 +664,8 @@ static int byte_scan(InputSrc *in, yystypepp * yylvalpp) ...@@ -664,10 +664,8 @@ static int byte_scan(InputSrc *in, yystypepp * yylvalpp)
ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp); ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
while (ch != '"' && ch != '\n' && ch != EOF) { while (ch != '"' && ch != '\n' && ch != EOF) {
if (ch == '\\') { if (ch == '\\') {
ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp); CPPErrorToInfoLog("The line continuation character (\\) is not part of the OpenGL ES Shading Language");
if (ch == '\n' || ch == EOF) { return -1;
break;
}
} }
if (len < MAX_STRING_LEN) { if (len < MAX_STRING_LEN) {
string_val[len] = ch; 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