summaryrefslogtreecommitdiffstats
path: root/src/glsl/glcpp/glcpp-parse.y
diff options
context:
space:
mode:
authorFabian Bieler <[email protected]>2012-07-24 15:36:46 +0200
committerMatt Turner <[email protected]>2012-11-09 14:33:08 -0800
commit9ad71c44fa316314551b8540241e81b296d35f44 (patch)
tree89df6f71951d05c7e79b560de851d81644406e13 /src/glsl/glcpp/glcpp-parse.y
parent060e69679925f171cfcc2a5f84fab1d833a7e804 (diff)
glcpp: don't push #line directives into next line
By moving the HASH_LINE rule out of control_line: and into line:, we avoid adding control_line's additional \n (as seen in the first hunk). mattst88: Carl and I determined independently of Fabian that the 091 test needed to be modified identically to this, and our patch to fix the test was more complicated. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51506 Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Carl Worth <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/glsl/glcpp/glcpp-parse.y')
-rw-r--r--src/glsl/glcpp/glcpp-parse.y16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/glsl/glcpp/glcpp-parse.y b/src/glsl/glcpp/glcpp-parse.y
index 16d29650dfe..9628637dafc 100644
--- a/src/glsl/glcpp/glcpp-parse.y
+++ b/src/glsl/glcpp/glcpp-parse.y
@@ -190,6 +190,14 @@ line:
control_line {
ralloc_asprintf_rewrite_tail (&parser->output, &parser->output_length, "\n");
}
+| HASH_LINE pp_tokens NEWLINE {
+ if (parser->skip_stack == NULL ||
+ parser->skip_stack->type == SKIP_NO_SKIP)
+ {
+ _glcpp_parser_expand_and_lex_from (parser,
+ LINE_EXPANDED, $2);
+ }
+ }
| text_line {
_glcpp_parser_print_expanded_token_list (parser, $1);
ralloc_asprintf_rewrite_tail (&parser->output, &parser->output_length, "\n");
@@ -244,14 +252,6 @@ control_line:
}
ralloc_free ($2);
}
-| HASH_LINE pp_tokens NEWLINE {
- if (parser->skip_stack == NULL ||
- parser->skip_stack->type == SKIP_NO_SKIP)
- {
- _glcpp_parser_expand_and_lex_from (parser,
- LINE_EXPANDED, $2);
- }
- }
| HASH_IF conditional_tokens NEWLINE {
/* Be careful to only evaluate the 'if' expression if
* we are not skipping. When we are skipping, we