<p><b>@b4n</b> commented on this pull request.</p>

<hr>

<p>In <a href="https://github.com/geany/geany/pull/1263#discussion_r210530616">ctags/main/parse.c</a>:</p>
<pre style='color:#555'>>  {
-       const char *p = parameter;
-       bool mode = true;
-       int c;
+       bool tagFileResized;
+       pushNarrowedInputStream (language,
+                                startLine, startCharOffset,
+                                endLine, endCharOffset,
+                                sourceLineOffset);
+#ifndef CTAGS_LIB
+       tagFileResized = createTagsWithFallback1 (language);
+#endif
+       popNarrowedInputStream  ();
+       return tagFileResized;
</pre>
<blockquote>
<blockquote>
<p>In runParserInNarrowedInputStream(): shouldn't more be guarded? Here the meat of the function is disabled with CTAGS_LIB, but not all.</p>
</blockquote>
<p>What else do you think should be guarded? The rest seems to just manipulate the input file's MIO which shouldn't be a problem I think.</p>
</blockquote>
<p>My point was that then the whole manipulation looks like a no-op, and so if guarding anything, the whole body could be guarded.</p>
<p>BTW, I see that now it returns a uninitialized value (<code>tagFileResized</code>).</p>

<hr>

<p>In <a href="https://github.com/geany/geany/pull/1263#discussion_r210530753">ctags/main/parse.c</a>:</p>
<pre style='color:#555'>>  {
-       const char *p = parameter;
-       bool mode = true;
-       int c;
+       bool tagFileResized;
+       pushNarrowedInputStream (language,
+                                startLine, startCharOffset,
+                                endLine, endCharOffset,
+                                sourceLineOffset);
+#ifndef CTAGS_LIB
+       tagFileResized = createTagsWithFallback1 (language);
+#endif
+       popNarrowedInputStream  ();
+       return tagFileResized;
</pre>
<p>BTW-2, isn't this needed to run sub-parsers?</p>

<hr>

<p>In <a href="https://github.com/geany/geany/pull/1263#discussion_r210538314">ctags/main/ctags-api.c</a>:</p>
<pre style='color:#555'>> +
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+static bool nofatalErrorPrinter (const errorSelection selection,
+                                         const char *const format,
+                                         va_list ap, void *data CTAGS_ATTR_UNUSED)
+{
+       fprintf (stderr, "%s: ", (selection & WARNING) ? "Warning: " : "Error");
+       vfprintf (stderr, format, ap);
+       if (selection & PERROR)
+#ifdef HAVE_STRERROR
+       fprintf (stderr, " : %s", strerror (errno));
+#else
+       perror (" ");
</pre>
<p>confusing indent for L36 and L34 as they are guarded by the <code>if</code> on L32</p>

<hr>

<p>In <a href="https://github.com/geany/geany/pull/1263#discussion_r211117011">ctags/main/lcpp.c</a>:</p>
<pre style='color:#555'>> @@ -174,6 +175,23 @@ extern void cppUngetc (const int c)
        Assert (Cpp.ungetch2 == '\0');
        Cpp.ungetch2 = Cpp.ungetch;
        Cpp.ungetch = c;
+       if (collectingSignature)
+               vStringChop (signature);
+}
+
+static inline int getcAndCollect ()
</pre>
<p>Picky: <code>(void)</code> for the arglist</p>

<hr>

<p>In <a href="https://github.com/geany/geany/pull/1263#discussion_r211207079">ctags/main/entry.c</a>:</p>
<pre style='color:#555'>>      if (! tag->kind->enabled)
                return;
+#endif
</pre>
<p>Maybe instead of removing this altogether the library consumer could have to enable kinds he cares about?  Not sure, as I tend to agree with you that post-filtering seems better, but maybe filtering ahead has other advantages like performance.  Anyway, looks good enough for us, but could make sense to keep in a final lib API.</p>

<hr>

<p>In <a href="https://github.com/geany/geany/pull/1263#discussion_r211249691">tests/ctags/simple.d.tags</a>:</p>
<pre style='color:#555'>> @@ -20,5 +20,5 @@ obj
 qar�64�Struct.Union�0�int
 quxx�64�Struct.Union�0�bool
 test.simple�256�0
-tfun�16�(T)�Class�0�auto
+tfun�16�(T v)�Class�0�auto
</pre>
<p>The source is valid D code according to GDC.  And from what I can guess, the signature is more likely to be <code>(T v)</code> than <code>(T)</code> (as <code>v</code> is used as a variable in the body); I'd guess the <code>(T)</code> part is similar to C++'s <code><T></code> in <code>tfun<T>(T v)</code>.</p>
<p>So I'd say this change is even better.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany/pull/1263#pullrequestreview-146762584">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABDrJ1YE3cdjOTzjXykftAVPiS_UzSscks5uSrD_gaJpZM4KXvBh">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABDrJ1RcaOI5dTKkqmrKCemosGsPr-fzks5uSrD_gaJpZM4KXvBh.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/geany/geany","title":"geany/geany","subtitle":"GitHub repository","main_image_url":"https://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/geany/geany"}},"updates":{"snippets":[{"icon":"PERSON","message":"@b4n commented on #1263"}],"action":{"name":"View Pull Request","url":"https://github.com/geany/geany/pull/1263#pullrequestreview-146762584"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/geany/geany/pull/1263#pullrequestreview-146762584",
"url": "https://github.com/geany/geany/pull/1263#pullrequestreview-146762584",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
},
{
"@type": "MessageCard",
"@context": "http://schema.org/extensions",
"hideOriginalBody": "false",
"originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB",
"title": "@b4n commented on 1263",
"sections": [
{
"text": "",
"activityTitle": "**Colomban Wendling**",
"activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png",
"activitySubtitle": "@b4n",
"facts": [

]
}
],
"potentialAction": [
{
"targets": [
{
"os": "default",
"uri": "https://github.com/geany/geany/pull/1263#pullrequestreview-146762584"
}
],
"@type": "OpenUri",
"name": "View on GitHub"
},
{
"name": "Unsubscribe",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\": 173994081\n}"
}
],
"themeColor": "26292E"
}
]</script>