]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
now parses properties and doc tags correctly
authorChris Daley <chebizarro@gmail.com>
Thu, 23 Nov 2017 14:41:38 +0000 (06:41 -0800)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sat, 29 Apr 2023 19:00:17 +0000 (21:00 +0200)
dbusgen/valadbusgen.vala
dbusgen/valadbusparser.vala

index 68049f3d4035636ea406ecb40b43382e864f318a..ad65f8697794ea6db948c4455a0a16f770cee427 100644 (file)
@@ -185,7 +185,7 @@ public class Vala.DBusGen {
                        return 1;
                }
 
-               var DBusGen = new DBusGen ();
-               return DBusGen.run ();
+               var dbusgen = new DBusGen ();
+               return dbusgen.run ();
        }
 }
index b1649bd5d8c4a0441b9d9f2c8e59c43dcfa75a08..b7dc932936827768eb5867bf1b343e03a6a98048 100644 (file)
@@ -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 ();
                }
        }
-
 }