[vala/wip/dbusgen] added support for doc tags



commit ca44071f6225f1ce0f50eb6ba496132f459a16a6
Author: Chris Daley <chebizarro gmail com>
Date:   Fri Nov 24 10:35:03 2017 -0800

    added support for doc tags

 dbusgen/valadbusparser.vala |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/dbusgen/valadbusparser.vala b/dbusgen/valadbusparser.vala
index bb768dc..813fc2c 100644
--- a/dbusgen/valadbusparser.vala
+++ b/dbusgen/valadbusparser.vala
@@ -355,13 +355,31 @@ public class Vala.DBusParser : CodeVisitor {
        private void parse_doc () {
                start_element ("doc:doc");
 
+               string comment = "";
+               SourceReference start_loc = get_current_src ();
+
                while (true) {
                        next ();
+                       
+                       if (current_token == MarkupTokenType.TEXT) {
+                               SourceReference source = get_current_src ();
+                               comment += source.file.get_source_line (source.begin.line).strip ();
+                       }
+                       
                        if (current_token == MarkupTokenType.END_ELEMENT && reader.name == "doc:doc") {
                                break;
                        }
                }
 
+               if (comment.length > 0) {
+                       comment = "*\n * %s\n*".printf (comment);
+                       Comment doc = new Comment (comment, start_loc);
+                       Symbol node = current_node as Symbol;
+                       if (node != null) {
+                               node.comment = doc;
+                       }
+               }
+               
                end_element ("doc:doc");
        }
 


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