[vala/wip/x-version: 24/24] Always check unused attrs. Add [Version] to known attrs



commit b3f2ac42f67364b117ff663322f85d4004d49663
Author: Luca Bruno <lucabru src gnome org>
Date:   Thu Dec 25 21:51:00 2014 +0100

    Always check unused attrs. Add [Version] to known attrs

 compiler/valacompiler.vala |    2 --
 vala/valacodecontext.vala  |    6 ++++++
 vala/valausedattr.vala     |    3 ++-
 3 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/compiler/valacompiler.vala b/compiler/valacompiler.vala
index 3c008d3..ddcb757 100644
--- a/compiler/valacompiler.vala
+++ b/compiler/valacompiler.vala
@@ -460,8 +460,6 @@ class Vala.Compiler {
                        context.write_dependencies (dependencies);
                }
 
-               context.used_attr.check_unused (context);
-
                if (context.report.get_errors () > 0 || (fatal_warnings && context.report.get_warnings () > 
0)) {
                        return quit ();
                }
diff --git a/vala/valacodecontext.vala b/vala/valacodecontext.vala
index a08db1e..b3f331b 100644
--- a/vala/valacodecontext.vala
+++ b/vala/valacodecontext.vala
@@ -490,6 +490,12 @@ public class Vala.CodeContext {
                }
 
                flow_analyzer.analyze (this);
+
+               if (report.get_errors () > 0) {
+                       return;
+               }
+
+               used_attr.check_unused (this);
        }
 
        public void add_define (string define) {
diff --git a/vala/valausedattr.vala b/vala/valausedattr.vala
index 04067e1..588aaf7 100644
--- a/vala/valausedattr.vala
+++ b/vala/valausedattr.vala
@@ -57,6 +57,7 @@ public class Vala.UsedAttr : CodeVisitor {
                "HasEmitter", "",
                "ReturnsModifiedPointer", "",
                "Deprecated", "since", "replacement", "",
+               "Version", "since", "replacement", "deprecated", "deprecated_since", "experimental", "",
                "Signal", "detailed", "run", "no_recurse", "action", "no_hooks", "",
                "Description", "nick", "blurb", "",
                
@@ -72,7 +73,7 @@ public class Vala.UsedAttr : CodeVisitor {
                "GtkCallback", "name", "",
 
                "DBus", "name", "no_reply", "result", "use_string_marshalling", "value", "signature", 
"visible", "",
-               
+
                "GIR", "name", ""
 
        };


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