[vala/switch-to-gir: 15/25] girparser: Fix parsing arrays in metadata types
- From: Luca Bruno <lucabru src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/switch-to-gir: 15/25] girparser: Fix parsing arrays in metadata types
- Date: Sat, 18 Dec 2010 09:58:03 +0000 (UTC)
commit 24dba87876d61bc45e844061109f85cc806be408
Author: Luca Bruno <lucabru src gnome org>
Date: Wed Nov 17 21:59:46 2010 +0100
girparser: Fix parsing arrays in metadata types
vala/valagirparser.vala | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
index 8d848d0..78a09cc 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -1064,7 +1064,7 @@ public class Vala.GirParser : CodeVisitor {
DataType? parse_type_from_string (string type_string, bool owned_by_default, SourceReference? source_reference = null) {
if (type_from_string_regex == null) {
try {
- type_from_string_regex = new GLib.Regex ("^(?:(owned|unowned|weak) +)?([0-9a-zA-Z_\\.]+)(?:<(.+)>)?(\\*+)?(\\[(,*)?\\])?(\\?)?$", GLib.RegexCompileFlags.ANCHORED | GLib.RegexCompileFlags.DOLLAR_ENDONLY | GLib.RegexCompileFlags.OPTIMIZE);
+ type_from_string_regex = new GLib.Regex ("^(?:(owned|unowned|weak) +)?([0-9a-zA-Z_\\.]+)(?:<(.+)>)?(\\*+)?(\\[,*\\])?(\\?)?$", GLib.RegexCompileFlags.ANCHORED | GLib.RegexCompileFlags.DOLLAR_ENDONLY | GLib.RegexCompileFlags.OPTIMIZE);
} catch (GLib.RegexError e) {
GLib.error ("Unable to compile regex: %s", e.message);
}
@@ -1138,7 +1138,7 @@ public class Vala.GirParser : CodeVisitor {
}
if (array_data != null) {
- type = new ArrayType (type, (int) array_data.length + 1, source_reference);
+ type = new ArrayType (type, (int) array_data.length - 1, source_reference);
}
type.nullable = nullable;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]