]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
libvaladoc: Allow @link tags to be split over multiple lines
authorMichael James Gratton <mike@vee.net>
Tue, 9 Jan 2018 01:36:43 +0000 (12:36 +1100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Tue, 9 Jan 2018 07:12:21 +0000 (08:12 +0100)
* 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
libvaladoc/taglets/tagletlink.vala

index b42453e07307f72192b7783309b31a15d0ecd752..a03480c7392e372a2b4fdad8013d57997fc6e213 100644 (file)
@@ -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
index 799bec6e0052727bc967a72182eb1b05be4b01e1..e14436fb883f49f182462bb2db624e6498718310 100644 (file)
@@ -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 ({