[vala] girparser: Add sentinel metadata argument
- From: Luca Bruno <lucabru src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] girparser: Add sentinel metadata argument
- Date: Wed, 25 May 2011 18:59:08 +0000 (UTC)
commit f2bbbf9c36c9aaaa46280140154457392b4f269b
Author: Luca Bruno <lucabru src gnome org>
Date: Wed May 25 18:35:08 2011 +0200
girparser: Add sentinel metadata argument
vala/valagirparser.vala | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
index 41351d1..3eb3895 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -64,7 +64,8 @@ public class Vala.GirParser : CodeVisitor {
STRUCT,
THROWS,
PRINTF_FORMAT,
- ARRAY_LENGTH_FIELD;
+ ARRAY_LENGTH_FIELD,
+ SENTINEL;
public static ArgumentType? from_string (string name) {
var enum_class = (EnumClass) typeof(ArgumentType).class_ref ();
@@ -429,7 +430,7 @@ public class Vala.GirParser : CodeVisitor {
}
var arg_type = ArgumentType.from_string (id);
if (arg_type == null) {
- Report.error (get_src (begin), "unknown argument");
+ Report.error (get_src (begin, old_end), "unknown argument");
return false;
}
@@ -2452,8 +2453,10 @@ public class Vala.GirParser : CodeVisitor {
}
}
- if (s is Method && metadata.get_bool (ArgumentType.PRINTF_FORMAT)) {
- ((Method) s).printf_format = true;
+ if (s is Method) {
+ var m = (Method) s;
+ m.printf_format = metadata.get_bool (ArgumentType.PRINTF_FORMAT);
+ m.sentinel = metadata.get_string (ArgumentType.SENTINEL);
}
current.symbol = s;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]