Mesa (glsl2): glcpp: Reword diagnostic for #elif with no expression

Carl Worth cworth at kemper.freedesktop.org
Wed Aug 11 21:38:10 UTC 2010


Module: Mesa
Branch: glsl2
Commit: 624dd585c72103e5bffbc600cdf7bdfba5305a15
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=624dd585c72103e5bffbc600cdf7bdfba5305a15

Author: Carl Worth <cworth at cworth.org>
Date:   Wed Aug 11 13:50:51 2010 -0700

glcpp: Reword diagnostic for #elif with no expression

Rather than telling the user what to fix, the standard convention is to
describe what the detected problem is. With this change, test
081-elif-without-expression now passes.

---

 src/glsl/glcpp/glcpp-parse.c                       |    2 +-
 src/glsl/glcpp/glcpp-parse.y                       |    2 +-
 .../tests/081-elif-without-expression.c.expected   |    1 -
 3 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/glsl/glcpp/glcpp-parse.c b/src/glsl/glcpp/glcpp-parse.c
index 498d018..05bb7ca 100644
--- a/src/glsl/glcpp/glcpp-parse.c
+++ b/src/glsl/glcpp/glcpp-parse.c
@@ -1950,7 +1950,7 @@ yyreduce:
 		if (parser->skip_stack &&
 		    parser->skip_stack->type == SKIP_TO_ELSE)
 		{
-			glcpp_error(& (yylsp[(1) - (2)]), parser, "#elif needs an expression");
+			glcpp_error(& (yylsp[(1) - (2)]), parser, "#elif with no expression");
 		}
 		else
 		{
diff --git a/src/glsl/glcpp/glcpp-parse.y b/src/glsl/glcpp/glcpp-parse.y
index 643c449..795030e 100644
--- a/src/glsl/glcpp/glcpp-parse.y
+++ b/src/glsl/glcpp/glcpp-parse.y
@@ -276,7 +276,7 @@ control_line:
 		if (parser->skip_stack &&
 		    parser->skip_stack->type == SKIP_TO_ELSE)
 		{
-			glcpp_error(& @1, parser, "#elif needs an expression");
+			glcpp_error(& @1, parser, "#elif with no expression");
 		}
 		else
 		{
diff --git a/src/glsl/glcpp/tests/081-elif-without-expression.c.expected b/src/glsl/glcpp/tests/081-elif-without-expression.c.expected
index 37dcdc3..974f0f5 100644
--- a/src/glsl/glcpp/tests/081-elif-without-expression.c.expected
+++ b/src/glsl/glcpp/tests/081-elif-without-expression.c.expected
@@ -3,4 +3,3 @@
 
 
 
-




More information about the mesa-commit mailing list