summaryrefslogtreecommitdiffstats
path: root/src/glsl/glcpp/glcpp-lex.l
diff options
context:
space:
mode:
authorCarl Worth <[email protected]>2014-07-28 08:59:25 -0700
committerCarl Worth <[email protected]>2014-07-29 15:11:48 -0700
commitda7f226a2711450bf92dcc9e2e1e1052111683ff (patch)
treec8ed217e39b0ce10335b626856c5ca64467b26bb /src/glsl/glcpp/glcpp-lex.l
parent49e2275d0d67696662b4e0008a72b9004826feed (diff)
glsl/glcpp: Fix to emit spaces following directives
The glcpp lexer and parser use the space_tokens state bit to avoid emitting tokens for spaces while parsing a directive. Previously, this bit was only being set again by the first non-space token following a directive. This led to a bug where a space, (or a comment that should emit a space), immediately following a directive, (optionally searated by newlines), would be omitted from the output. Here we fix the bug by also setting the space_tokens bit whenever we lex a newline in the standard start conditions.
Diffstat (limited to 'src/glsl/glcpp/glcpp-lex.l')
-rw-r--r--src/glsl/glcpp/glcpp-lex.l1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/glsl/glcpp/glcpp-lex.l b/src/glsl/glcpp/glcpp-lex.l
index a1a8e76af0a..cfb9f2a18be 100644
--- a/src/glsl/glcpp/glcpp-lex.l
+++ b/src/glsl/glcpp/glcpp-lex.l
@@ -355,6 +355,7 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]?
if (parser->commented_newlines) {
BEGIN NEWLINE_CATCHUP;
}
+ yyextra->space_tokens = 1;
yyextra->lexing_directive = 0;
yylineno++;
yycolumn = 0;