diff options
author | marha <marha@users.sourceforge.net> | 2014-01-05 17:18:15 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2014-01-05 17:18:15 +0100 |
commit | 0fd65ec557757ec8760a96400a09b8a8a92a7b14 (patch) | |
tree | 961d86d49281cf94e2dc85ffb88c6b1491036338 /mesalib/src/glsl/glcpp/glcpp-parse.y | |
parent | 68c12003597662f95eac07ddeee99637f7caa3e5 (diff) | |
parent | 1b37f71714e2ca4af60bd050adbbb7969534dfd6 (diff) | |
download | vcxsrv-0fd65ec557757ec8760a96400a09b8a8a92a7b14.tar.gz vcxsrv-0fd65ec557757ec8760a96400a09b8a8a92a7b14.tar.bz2 vcxsrv-0fd65ec557757ec8760a96400a09b8a8a92a7b14.zip |
Merge remote-tracking branch 'origin/released'
* origin/released:
randrproto libXau libxcb mesa mkfontscale pixman git update 5 Jan 2014
Diffstat (limited to 'mesalib/src/glsl/glcpp/glcpp-parse.y')
-rw-r--r-- | mesalib/src/glsl/glcpp/glcpp-parse.y | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/mesalib/src/glsl/glcpp/glcpp-parse.y b/mesalib/src/glsl/glcpp/glcpp-parse.y index 7edc27488..ef084b639 100644 --- a/mesalib/src/glsl/glcpp/glcpp-parse.y +++ b/mesalib/src/glsl/glcpp/glcpp-parse.y @@ -310,6 +310,11 @@ control_line: _glcpp_parser_expand_and_lex_from (parser, ELIF_EXPANDED, $2); } + else if (parser->skip_stack && + parser->skip_stack->has_else) + { + glcpp_error(& @1, parser, "#elif after #else"); + } else { _glcpp_parser_skip_stack_change_if (parser, & @1, @@ -324,6 +329,11 @@ control_line: { glcpp_error(& @1, parser, "#elif with no expression"); } + else if (parser->skip_stack && + parser->skip_stack->has_else) + { + glcpp_error(& @1, parser, "#elif after #else"); + } else { _glcpp_parser_skip_stack_change_if (parser, & @1, @@ -332,7 +342,17 @@ control_line: } } | HASH_ELSE { - _glcpp_parser_skip_stack_change_if (parser, & @1, "else", 1); + if (parser->skip_stack && + parser->skip_stack->has_else) + { + glcpp_error(& @1, parser, "multiple #else"); + } + else + { + _glcpp_parser_skip_stack_change_if (parser, & @1, "else", 1); + if (parser->skip_stack) + parser->skip_stack->has_else = true; + } } NEWLINE | HASH_ENDIF { _glcpp_parser_skip_stack_pop (parser, & @1); @@ -1164,6 +1184,7 @@ glcpp_parser_create (const struct gl_extensions *extensions, int api) parser->newline_as_space = 0; parser->in_control_line = 0; parser->paren_count = 0; + parser->commented_newlines = 0; parser->skip_stack = NULL; @@ -2024,6 +2045,7 @@ _glcpp_parser_skip_stack_push_if (glcpp_parser_t *parser, YYLTYPE *loc, node->type = SKIP_TO_ENDIF; } + node->has_else = false; node->next = parser->skip_stack; parser->skip_stack = node; } |