]> git.draconx.ca Git - gob-dx.git/blobdiff - src/lexer.l
Release 1.0.4
[gob-dx.git] / src / lexer.l
index a33eed0a7720e3a7113830fbc7f8413499e0b49d..f45fcc5bc384f246e709a019bbce5d238921936f 100644 (file)
@@ -334,9 +334,8 @@ class               {
                        BEGIN(CLASS_CODE);
 
                        if(++found_classes > 1) {
-                               print_error(FALSE, 
-                                           "Only one class per file allowed",
-                                           line_no);
+                               error_print(GOB_ERROR, line_no,
+                                           "Only one class per file allowed");
                        }
 
                        return CLASS;
@@ -354,26 +353,21 @@ class             {
                        if(rmaj < maj ||
                           (rmaj == maj && rmin < min) ||
                           (rmaj == maj && rmin == min && rpl < pl)) {
-                               char *s;
-                               s = g_strdup_printf(
-                                   "GOB version %d.%d.%d required "
-                                   "(this is %s)\n"
-                                   "To upgrade your gob, see: "
-                                   "http://www.5z.com/jirka/gob.html",
-                                   maj,min,pl,VERSION);
-                               print_error(FALSE, s, line_no);
-                               g_free(s);
+                               error_printf(GOB_ERROR, line_no,
+                                            "GOB version %d.%d.%d required "
+                                            "(this is %s)\n"
+                                            "To upgrade your gob, see: "
+                                            "http://www.5z.com/jirka/gob.html",
+                                            maj, min, pl, VERSION);
                        }
                }
 
 <CLASS_CODE,CLASS_CODE_I>class|this    {
                        if(for_cpp) {
-                               char *s;
-                               s = g_strdup_printf("'%s' keyword should not "
-                                                   "be used when generating "
-                                                   "C++ code", yytext);
-                               print_error(TRUE, s, line_no);
-                               g_free(s);
+                               error_printf(GOB_WARN, line_no,
+                                            "'%s' keyword should not "
+                                            "be used when generating "
+                                            "C++ code", yytext);
                        }
                        REJECT;
                }