]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Add boolean CodeContext.keep_going and corresponding compiler option 1430c461d4a45026331663989113feb195588255
authorRico Tzschichholz <ricotz@ubuntu.com>
Mon, 2 Sep 2019 13:25:44 +0000 (15:25 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Mon, 2 Sep 2019 13:47:11 +0000 (15:47 +0200)
If keep_going is set then check() will continue after hitting errors in
resolver and analyzer.

compiler/valacompiler.vala
doc/valac.1
vala/valacodecontext.vala

index d425202f1e8522e452d2ad567917781c1efcffb1..c5105804acedb8b757cb90dd7e92eb25232749d5 100644 (file)
@@ -75,6 +75,7 @@ class Vala.Compiler {
        static bool gobject_tracing;
        static bool disable_since_check;
        static bool disable_warnings;
+       static bool keep_going;
        static string cc_command;
        [CCode (array_length = false, array_null_terminated = true)]
        static string[] cc_options;
@@ -141,6 +142,7 @@ class Vala.Compiler {
                { "disable-warnings", 0, 0, OptionArg.NONE, ref disable_warnings, "Disable warnings", null },
                { "fatal-warnings", 0, 0, OptionArg.NONE, ref fatal_warnings, "Treat warnings as fatal", null },
                { "disable-since-check", 0, 0, OptionArg.NONE, ref disable_since_check, "Do not check whether used symbols exist in local packages", null },
+               { "keep-going", 'k', 0, OptionArg.NONE, ref keep_going, "Continue as much as possible after an error", null },
                { "enable-experimental-non-null", 0, 0, OptionArg.NONE, ref experimental_non_null, "Enable experimental enhancements for non-null types", null },
                { "enable-gobject-tracing", 0, 0, OptionArg.NONE, ref gobject_tracing, "Enable GObject creation tracing", null },
                { "cc", 0, 0, OptionArg.STRING, ref cc_command, "Use COMMAND as C compiler command", "COMMAND" },
@@ -233,6 +235,7 @@ class Vala.Compiler {
                context.experimental = experimental;
                context.experimental_non_null = experimental_non_null;
                context.gobject_tracing = gobject_tracing;
+               context.keep_going = keep_going;
                context.report.enable_warnings = !disable_warnings;
                context.report.set_verbose_errors (!quiet_mode);
                context.verbose_mode = verbose_mode;
index bf85d0e27e84444aff43a4f3bef1df26c8752aef..054ec6c9b015c343b52d7eb858883b7ec23bb740 100644 (file)
@@ -141,6 +141,9 @@ Treat warnings as fatal
 \fB\-\-disable\-since\-check\fR
 Do not check whether used symbols exist in local packages
 .TP
+\fB\-k\fR, \fB\-\-keep\-going\fR
+Continue as much as possible after an error
+.TP
 \fB\-\-enable\-experimental\-non\-null\fR
 Enable experimental enhancements for non\-null types
 .TP
index b2fc8eaf3f91d32996ff9a7a82b4306310e0ece0..412b20eeb260ae61bd726d3695048a317a96b1d5 100644 (file)
@@ -173,6 +173,11 @@ public class Vala.CodeContext {
 
        public bool use_fast_vapi { get; set; }
 
+       /**
+        * Continue as much as possible after an error.
+        */
+       public bool keep_going { get; set; }
+
        /**
         * Include comments in generated vapi.
         */
@@ -509,13 +514,13 @@ public class Vala.CodeContext {
        public void check () {
                resolver.resolve (this);
 
-               if (report.get_errors () > 0) {
+               if (!keep_going && report.get_errors () > 0) {
                        return;
                }
 
                analyzer.analyze (this);
 
-               if (report.get_errors () > 0) {
+               if (!keep_going && report.get_errors () > 0) {
                        return;
                }