[gtk+/wip/otte/shader: 132/175] gskslstatement: Print semicolon in the statement print function



commit 1dfc2e5194e9df0b977a3e1218330d3c32fa076d
Author: Benjamin Otte <otte redhat com>
Date:   Sat Sep 30 15:04:51 2017 +0200

    gskslstatement: Print semicolon in the statement print function
    
    This is necessary for compound statements which don't have a semicolon.

 gsk/gskslfunction.c  |    1 -
 gsk/gskslstatement.c |    4 ++++
 2 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/gsk/gskslfunction.c b/gsk/gskslfunction.c
index 1947656..2acf173 100644
--- a/gsk/gskslfunction.c
+++ b/gsk/gskslfunction.c
@@ -384,7 +384,6 @@ gsk_sl_function_declared_print (const GskSlFunction *function,
     {
       gsk_sl_printer_newline (printer);
       gsk_sl_statement_print (l->data, printer);
-      gsk_sl_printer_append (printer, ";");
     }
   gsk_sl_printer_pop_indentation (printer);
   gsk_sl_printer_newline (printer);
diff --git a/gsk/gskslstatement.c b/gsk/gskslstatement.c
index f4f07fe..728718e 100644
--- a/gsk/gskslstatement.c
+++ b/gsk/gskslstatement.c
@@ -88,6 +88,7 @@ static void
 gsk_sl_statement_empty_print (const GskSlStatement *statement,
                               GskSlPrinter         *printer)
 {
+  gsk_sl_printer_append (printer, ";");
 }
 
 static guint32
@@ -138,6 +139,7 @@ gsk_sl_statement_declaration_print (const GskSlStatement *statement,
       gsk_sl_printer_append (printer, " = ");
       gsk_sl_expression_print (declaration->initial, printer);
     }
+  gsk_sl_printer_append (printer, ";");
 }
 
 static guint32
@@ -200,6 +202,7 @@ gsk_sl_statement_return_print (const GskSlStatement *statement,
       gsk_sl_printer_append (printer, " ");
       gsk_sl_expression_print (return_statement->value, printer);
     }
+  gsk_sl_printer_append (printer, ";");
 }
 
 static guint32
@@ -244,6 +247,7 @@ gsk_sl_statement_expression_print (const GskSlStatement *statement,
   GskSlStatementExpression *expression_statement = (GskSlStatementExpression *) statement;
 
   gsk_sl_expression_print (expression_statement->expression, printer);
+  gsk_sl_printer_append (printer, ";");
 }
  
 static guint32


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]