[template-glib] eval: add more info for debugging



commit 152bfce47951b66762cb7eadc20b33874b71026b
Author: Christian Hergert <chergert redhat com>
Date:   Fri Oct 27 03:13:04 2017 -0700

    eval: add more info for debugging
    
    We still really need line numbers attached to AST nodes, but this is just
    a bit useful for me right now.

 src/tmpl-expr-eval.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/tmpl-expr-eval.c b/src/tmpl-expr-eval.c
index 0bc1e11..6441f9f 100644
--- a/src/tmpl-expr-eval.c
+++ b/src/tmpl-expr-eval.c
@@ -172,7 +172,7 @@ throw_type_mismatch (GError       **error,
             return TRUE; \
           } \
       } \
-    return throw_type_mismatch (error, left, right, "invalid add"); \
+    return throw_type_mismatch (error, left, right, "invalid op " #op); \
   } G_STMT_END
 
 static FastDispatch
@@ -235,7 +235,8 @@ tmpl_expr_simple_eval (TmplExprSimple  *node,
 
           if (dispatch == NULL)
             {
-              throw_type_mismatch (error, &left, &right, "type mismatch");
+              g_autofree gchar *msg = g_strdup_printf ("type mismatch (%d)", node->type);
+              throw_type_mismatch (error, &left, &right, msg);
               goto cleanup;
             }
         }


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