[vala/switch-to-gir] girparser: Report empty metadata
- From: Luca Bruno <lucabru src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/switch-to-gir] girparser: Report empty metadata
- Date: Thu, 26 Aug 2010 16:41:34 +0000 (UTC)
commit 74a39c9f43176424e8e3c4caa0fe6e747ab85873
Author: Luca Bruno <lethalman88 gmail com>
Date: Thu Aug 26 10:22:23 2010 +0200
girparser: Report empty metadata
vala/valagirparser.vala | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
index f0dc8f5..2fbde9d 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -2016,6 +2016,15 @@ public class Vala.GirParser : CodeVisitor {
}
void report_unused_metadata (Metadata metadata) {
+ if (metadata == Metadata.empty) {
+ return;
+ }
+
+ if (metadata.args.size == 0 && metadata.children.size == 0) {
+ Report.warning (metadata.source_reference, "empty metadata");
+ return;
+ }
+
foreach (var arg_type in metadata.args.get_keys ()) {
var arg = metadata.args[arg_type];
if (!arg.used) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]