Mesa (master): glsl/glcpp: Don' t include any newline characters in #error token

Ian Romanick idr at kemper.freedesktop.org
Thu Aug 7 23:08:47 UTC 2014


Module: Mesa
Branch: master
Commit: ec69e00843ecafcd817b47f22229b84561c5e624
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ec69e00843ecafcd817b47f22229b84561c5e624

Author: Carl Worth <cworth at cworth.org>
Date:   Wed Jul  2 22:20:43 2014 -0700

glsl/glcpp: Don't include any newline characters in #error token

Some tests were failing because the message printed by #error was including a
'\r' character from the source file in its output.

This is easily avoided by fixing the regular expression for #error to never
include any of the possible newline characters, (neither '\r' nor '\n').

With this commit 2 tests are fixed for each of the '\r' and '\r\n' cases.

Current results after the commit are:

	\r:	137/143 tests pass
	\r\n	142/143 tests pass
	\n\r:	139/143 tests pass

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

---

 src/glsl/glcpp/glcpp-lex.l |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/glsl/glcpp/glcpp-lex.l b/src/glsl/glcpp/glcpp-lex.l
index 48cc62c..98d500e 100644
--- a/src/glsl/glcpp/glcpp-lex.l
+++ b/src/glsl/glcpp/glcpp-lex.l
@@ -353,7 +353,7 @@ HEXADECIMAL_INTEGER	0[xX][0-9a-fA-F]+[uU]?
 	RETURN_TOKEN_NEVER_SKIP (ENDIF);
 }
 
-<HASH>error.* {
+<HASH>error[^\r\n]* {
 	BEGIN INITIAL;
 	RETURN_STRING_TOKEN (ERROR_TOKEN);
 }




More information about the mesa-commit mailing list