[vala/staging: 2/4] libvaladoc: Allow @link tags to be split over multiple lines



commit a52b4ac85ba48bb334d68976b94448cc66ce6f83
Author: Michael James Gratton <mike vee net>
Date:   Tue Jan 9 12:36:43 2018 +1100

    libvaladoc: Allow @link tags to be split over multiple lines
    
    * libvaladoc/documentation/documentationparser.vala
      (DocumentationParser.init_valadoc_rules): Allow both SP and NL in
      general tag rule to separate tag name and body.
    
    * libvaladoc/taglets/tagletlink.vala (Link): Allow multiple further SP
      and NL chars before the link.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=646982

 libvaladoc/documentation/documentationparser.vala |   10 +++++++++-
 libvaladoc/taglets/tagletlink.vala                |    9 ++++++++-
 2 files changed, 17 insertions(+), 2 deletions(-)
---
diff --git a/libvaladoc/documentation/documentationparser.vala 
b/libvaladoc/documentation/documentationparser.vala
index b42453e..a03480c 100644
--- a/libvaladoc/documentation/documentationparser.vala
+++ b/libvaladoc/documentation/documentationparser.vala
@@ -395,7 +395,15 @@ public class Valadoc.DocumentationParser : Object, ResourceLocator {
                                                push (taglet);
                                                Rule? taglet_rule = taglet.get_parser_rule (multiline_run);
                                                if (taglet_rule != null) {
-                                                       _parser.push_rule (Rule.seq ({ TokenType.SPACE, 
taglet_rule }));
+                                                       _parser.push_rule (
+                                                               Rule.seq ({
+                                                                       Rule.one_of({
+                                                                               TokenType.SPACE,
+                                                                               TokenType.EOL
+                                                                       }),
+                                                                       taglet_rule
+                                                               })
+                                                       );
                                                }
                                        }),
                                        TokenType.CLOSED_BRACE
diff --git a/libvaladoc/taglets/tagletlink.vala b/libvaladoc/taglets/tagletlink.vala
index 799bec6..e14436f 100644
--- a/libvaladoc/taglets/tagletlink.vala
+++ b/libvaladoc/taglets/tagletlink.vala
@@ -51,7 +51,14 @@ public class Valadoc.Taglets.Link : InlineTaglet {
 
        public override Rule? get_parser_rule (Rule run_rule) {
                return Rule.seq ({
-                       Rule.option ({ Rule.many ({ TokenType.SPACE }) }),
+                       Rule.option ({
+                               Rule.many ({
+                                       Rule.one_of({
+                                               TokenType.SPACE,
+                                               TokenType.EOL
+                                       }),
+                               }),
+                       }),
                        TokenType.any_word ().action ((token) => { symbol_name = token.to_string (); }),
                        Rule.option ({
                                Rule.many ({


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