[vala] girparser: Fix parsing selectors and matching



commit b445b55a8625b7986f17277094d71591866a9f5a
Author: Luca Bruno <lucabru src gnome org>
Date:   Sat Apr 23 11:18:35 2011 +0200

    girparser: Fix parsing selectors and matching

 vala/valagirparser.vala |   11 +++--------
 1 files changed, 3 insertions(+), 8 deletions(-)
---
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
index 4c1680c..b7168ff 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -319,14 +319,7 @@ public class Vala.GirParser : CodeVisitor {
 			}
 			next ();
 
-			var begin = this.begin;
-			if (current != TokenType.IDENTIFIER || has_space ()) {
-				Report.error (get_current_src (), "expected selector");
-				return null;
-			}
-			next ();
-
-			return get_string (begin, old_end);
+			return parse_identifier (false);
 		}
 
 		Metadata? parse_pattern () {
@@ -1108,6 +1101,8 @@ public class Vala.GirParser : CodeVisitor {
 		if (child_name == null) {
 			return Metadata.empty;
 		}
+		selector = selector.replace ("-", "_");
+		child_name = child_name.replace ("-", "_");
 
 		if (selector.has_prefix ("glib:")) {
 			selector = selector.substring ("glib:".length);



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