summaryrefslogtreecommitdiff
path: root/src/glsl/glcpp/glcpp.h
diff options
context:
space:
mode:
authorErik Faye-Lund <kusmabite@gmail.com>2013-12-17 16:37:33 +0100
committerCarl Worth <cworth@cworth.org>2014-01-02 14:22:58 -0800
commiteb212c5a302f0122a13b36dfdf07e91f951ae2e7 (patch)
tree82582edde6697d40e7496d1e994fea21cfdf6027 /src/glsl/glcpp/glcpp.h
parent6005e9cb283214cd57038c7c5e7758ba72ec6ac2 (diff)
glcpp: error on multiple #else/#elif directives
The preprocessor currently accepts multiple else/elif-groups per if-section. The GLSL-preprocessor is defined by the C++ specification, which defines the following parse-rule: if-section: if-group elif-groups(opt) else-group(opt) endif-line This clearly only allows a single else-group, that has to come after any elif-groups. So let's modify the code to follow the specification. Add test to prevent regressions. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Carl Worth <cworth@cworth.org> Cc: 10.0 <mesa-stable@lists.freedesktop.org>
Diffstat (limited to 'src/glsl/glcpp/glcpp.h')
-rw-r--r--src/glsl/glcpp/glcpp.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/glsl/glcpp/glcpp.h b/src/glsl/glcpp/glcpp.h
index e95ab8497d8..85f3fdcd2cd 100644
--- a/src/glsl/glcpp/glcpp.h
+++ b/src/glsl/glcpp/glcpp.h
@@ -153,6 +153,7 @@ typedef enum skip_type {
typedef struct skip_node {
skip_type_t type;
+ bool has_else;
YYLTYPE loc; /* location of the initial #if/#elif/... */
struct skip_node *next;
} skip_node_t;