<p>In <a href="https://github.com/geany/geany/pull/957#discussion_r61944971">tagmanager/src/tm_parser.c</a>:</p>
<pre style='color:#555'>> +};
> +
> +/* not in universal-ctags */
> +static TMParserMapEntry powershell_map[] = {
> +  {'f', tm_tag_function_t},
> +  {'v', tm_tag_variable_t},
> +};
> +
> +
> +typedef struct
> +{
> +    TMParserMapEntry *entries;
> +    guint size;
> +} TMParserMap;
> +
> +#define MAP_ENTRY(map) {map, (sizeof(map)/sizeof(TMParserMapEntry))}
</pre>
<p>Also, as we now depend on C99, we could have a more safe thing using explicit subobject initialization.<br>
Also, if the maps used a streamlined scheme following the parser name (similar to highlightingmappings.h), we could have something even more automated, like i.e.</p>

<div class="highlight highlight-source-c"><pre>#<span class="pl-k">define</span> <span class="pl-en">MAP_ENTRY_REF</span>(<span class="pl-v">lang, lang_src</span>)   [lang] = { map_##lang_src, <span class="pl-c1">G_N_ELEMENTS</span>(map_##lang_src) }
#<span class="pl-k">define</span> <span class="pl-en">MAP_ENTRY</span>(<span class="pl-v">lang</span>)                 MAP_ENTRY_REF(lang, lang)

<span class="pl-k">static</span> TMParserMap parser_map[] = {
    <span class="pl-c1">MAP_ENTRY</span>(C),
    <span class="pl-c1">MAP_ENTRY_REF</span>(CPP, C),  <span class="pl-c">/* C++ - same as C */</span>
    <span class="pl-c1">MAP_ENTRY</span>(JAVA),
    <span class="pl-c1">MAP_ENTRY</span>(MAKEFILE),
    <span class="pl-c1">MAP_ENTRY</span>(PASCAL),
    <span class="pl-c">// ...</span>
};</pre></div>

<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 or <a href="https://github.com/geany/geany/pull/957/files/aea7d7845917843dd6b02e5a8dc9031cabc87a86..5d9376ea801a6e6c3ec22748741362a3a2eff7ac#r61944971">view it on GitHub</a><img alt="" height="1" src="https://github.com/notifications/beacon/ABDrJzsuFgauHzwIyojf39P68GarIPzNks5p96hkgaJpZM4Ht-Ad.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/geany/geany/pull/957/files/aea7d7845917843dd6b02e5a8dc9031cabc87a86..5d9376ea801a6e6c3ec22748741362a3a2eff7ac#r61944971"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>