Module: Mesa
Branch: glsl-pp-rework-1
Commit: 1b76a247a4eca2676661423648cd829c03efea66
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=1b76a247a4eca2676661423648cd829c03efea66

Author: Michal Krol <[email protected]>
Date:   Fri Sep  4 11:39:30 2009 +0200

glsl: Output endof token after processing a directive.

Some directives may output tokens as a result of their operation.

---

 src/glsl/pp/sl_pp_process.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/glsl/pp/sl_pp_process.c b/src/glsl/pp/sl_pp_process.c
index be01f91..1828979 100644
--- a/src/glsl/pp/sl_pp_process.c
+++ b/src/glsl/pp/sl_pp_process.c
@@ -87,6 +87,7 @@ sl_pp_process(struct sl_pp_context *context,
                int found_eol = 0;
                unsigned int first;
                unsigned int last;
+               struct sl_pp_token_info endof;
 
                /* Directive name. */
                name = sl_pp_context_cstr(context, input[i].data.identifier);
@@ -99,17 +100,13 @@ sl_pp_process(struct sl_pp_context *context,
                   switch (input[i].token) {
                   case SL_PP_NEWLINE:
                      /* Preserve newline just for the sake of line numbering. 
*/
-                     if (sl_pp_process_out(&state, &input[i])) {
-                        return -1;
-                     }
+                     endof = input[i];
                      i++;
                      found_eol = 1;
                      break;
 
                   case SL_PP_EOF:
-                     if (sl_pp_process_out(&state, &input[i])) {
-                        return -1;
-                     }
+                     endof = input[i];
                      i++;
                      found_eof = 1;
                      found_eol = 1;
@@ -170,6 +167,10 @@ sl_pp_process(struct sl_pp_context *context,
                      /* XXX: Ignore. */
                   }
                }
+
+               if (sl_pp_process_out(&state, &endof)) {
+                  return -1;
+               }
             }
             break;
 

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to