From: Chris Daley Date: Thu, 23 Nov 2017 14:41:38 +0000 (-0800) Subject: now parses properties and doc tags correctly X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=de85c1af8ec25eb82e56df310ea0a7c7f7309dbf;p=thirdparty%2Fvala.git now parses properties and doc tags correctly --- diff --git a/dbusgen/valadbusgen.vala b/dbusgen/valadbusgen.vala index 68049f3d4..ad65f8697 100644 --- a/dbusgen/valadbusgen.vala +++ b/dbusgen/valadbusgen.vala @@ -185,7 +185,7 @@ public class Vala.DBusGen { return 1; } - var DBusGen = new DBusGen (); - return DBusGen.run (); + var dbusgen = new DBusGen (); + return dbusgen.run (); } } diff --git a/dbusgen/valadbusparser.vala b/dbusgen/valadbusparser.vala index b1649bd5d..b7dc93293 100644 --- a/dbusgen/valadbusparser.vala +++ b/dbusgen/valadbusparser.vala @@ -79,15 +79,14 @@ public class Vala.DBusParser : CodeVisitor { current_source_file.add_node (context.root); - next (); - next (); - next (); + while (current_token != MarkupTokenType.START_ELEMENT && reader.name != "node") { + next (); + } parse_node (); this.current_source_file = null; this.reader = null; - } private void parse_node () { @@ -102,6 +101,9 @@ public class Vala.DBusParser : CodeVisitor { parse_namespace (); parse_interface (); break; + case "doc:doc": + parse_doc (); + break; //case "node": // parse_node (); //break; @@ -177,6 +179,9 @@ public class Vala.DBusParser : CodeVisitor { case "property": parse_property (); break; + case "doc:doc": + parse_doc (); + break; default: parse_extension (); break; @@ -277,6 +282,7 @@ public class Vala.DBusParser : CodeVisitor { current_node = current_property = new Property (attribs["name"], type, get_access, set_access, get_current_src ()); current_property.is_abstract = true; + current_property.access = SymbolAccessibility.PUBLIC; current_iface.add_property (current_property); next (); @@ -284,6 +290,8 @@ public class Vala.DBusParser : CodeVisitor { while (current_token == MarkupTokenType.START_ELEMENT) { if (reader.name == "annotation") { parse_annotation (); + } else if (reader.name == "doc:doc") { + parse_doc (); } } @@ -302,6 +310,9 @@ public class Vala.DBusParser : CodeVisitor { case "arg": parse_arg (); break; + case "doc:doc": + parse_doc (); + break; default: parse_extension (); break; @@ -334,6 +345,15 @@ public class Vala.DBusParser : CodeVisitor { } next (); + + while (current_token == MarkupTokenType.START_ELEMENT) { + if (reader.name == "annotation") { + parse_annotation (); + } else if (reader.name == "doc:doc") { + parse_doc (); + } + } + end_element ("arg"); } @@ -341,6 +361,18 @@ public class Vala.DBusParser : CodeVisitor { next (); } + private void parse_doc () { + start_element ("doc:doc"); + + while (true) { + next (); + if (current_token == MarkupTokenType.END_ELEMENT && reader.name == "doc:doc") { + break; + } + } + end_element ("doc:doc"); + } + private void parse_signal () { start_element ("signal"); @@ -402,5 +434,4 @@ public class Vala.DBusParser : CodeVisitor { next (); } } - }