<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Function List with comments after function name]]></title><description><![CDATA[<p dir="auto">I’m using a Cisco User Defined Language where I have exclamation points defined as comments:</p>
<pre><code>            &lt;Keywords name="Comments"&gt;00! 01 02((EOL)) 03 04&lt;/Keywords&gt;
</code></pre>
<p dir="auto">This works fine in the Notepad++ edit view from a lexer point of view.  I’ve also created a function list parser for this language that “partially” works.  It follows:</p>
<pre><code>			&lt;!-- ==================================================== [ CiscoIOS ] --&gt;

			&lt;parser
				displayName="Cisco IOS"
				id         ="ciscoios"
				commentExpr="(?x)
								(?m-s:\!.*$)                                    # Single Line Comment
							"
			&gt;
				&lt;function
					mainExpr="(?:(?:^interface\s+\w+(?:/\d+)*)|(?:^router\s+\w+(?:\s+\d+)*))"&gt;
					&lt;functionName&gt;
						&lt;nameExpr expr="(?:(?:^interface\s+)|(?:^router\s+))\K((\w)|(\.))+"/&gt;
						&lt;nameExpr expr="((\w)|(\.))+"/&gt;
					&lt;/functionName&gt;
				&lt;/function&gt;
			&lt;/parser&gt;

</code></pre>
<p dir="auto">The issue is when I have a config file that looks like this:</p>
<pre><code>interface Ethernet1
   switchport access vlan 280
   switchport trunk allowed vlan 280-281
   switchport mode trunk
!
interface Ethernet2
   switchport access vlan 281
   switchport trunk allowed vlan 280-281
   switchport mode trunk
!
interface Ethernet3
!
interface Ethernet4
!
</code></pre>
<p dir="auto">The function list shows:</p>
<pre><code>Ethernet1
Ethernet2
</code></pre>
<p dir="auto">It does not show Ethernet3 and 4.  However, if I put a space before the exclamation point on the line after Ethernet3, Ethernet3 will show in the function list (after saving).  Same for Ethernet4.</p>
<p dir="auto">It seems the comment character (exclamation point) on the first position of the line following the regex function name match renders the match invalid and it doesn’t show up in the function list.</p>
<p dir="auto">I’m sure it’s a combination of my regex-fu, sub-par understanding of UDLs and probably something stupid I’m missing.  Hoping someone has a fix for this?</p>
<p dir="auto">Somewhat related:  <a href="https://community.notepad-plus-plus.org/topic/19140/function-list-with-bash-scripts-not-fully-populating">https://community.notepad-plus-plus.org/topic/19140/function-list-with-bash-scripts-not-fully-populating</a>  My answer for Bash illustrates the same behavior so maybe a fix here I can apply with that Bash parser too?</p>
<p dir="auto">Cheers.</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/19634/function-list-with-comments-after-function-name</link><generator>RSS for Node</generator><lastBuildDate>Mon, 20 Apr 2026 21:39:09 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/19634.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 01 Jul 2020 18:34:08 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Function List with comments after function name on Thu, 02 Jul 2020 05:22:42 GMT]]></title><description><![CDATA[<p dir="auto">Hello,<a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/14847">@Michael-Vincent</a></p>
<p dir="auto"><strong>Regex Explanation :</strong></p>
<p dir="auto"><strong>(?i) -</strong> modifier to make the search case-insensitive<br />
<strong>(?&lt;=^function) -</strong> positive lookbehind to find the position immediately preceded by the sub-string function at the start of the line<br />
<strong>\s+ -</strong> matches 1+ occurrences of a white-space character<br />
<strong>\K -</strong> forget everything matched so far<br />
<strong>\w+ -</strong> matches 1+ occurrences of all the characters which fall within the character class <strong>[a-zA-Z0-9_]</strong><br />
Add the following parser tag to the file functionList.xml</p>
<pre><code>&lt;parser id="mylang" displayName="mylang_syntax"&gt;
    &lt;function mainExpr="(?i)(?&lt;=^function)\s+\K\w+" /&gt;
&lt;/parser&gt;
</code></pre>
<p dir="auto">I hope this information will be useful.<br />
Thank you.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/55491</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/55491</guid><dc:creator><![CDATA[Makwana Prahlad]]></dc:creator><pubDate>Thu, 02 Jul 2020 05:22:42 GMT</pubDate></item><item><title><![CDATA[Reply to Function List with comments after function name on Wed, 01 Jul 2020 20:59:55 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/14847">@Michael-Vincent</a>  Strange, I copied your parser and example config file “as is”, imported an UDL (CiscoIOS_1), added the applicable extension and UDL association, started Notepad++ and Function List displayed all four Ethernet interfaces.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/55482</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/55482</guid><dc:creator><![CDATA[MAPJe71]]></dc:creator><pubDate>Wed, 01 Jul 2020 20:59:55 GMT</pubDate></item><item><title><![CDATA[Reply to Function List with comments after function name on Wed, 01 Jul 2020 20:55:54 GMT]]></title><description><![CDATA[<p dir="auto">See my <a href="https://github.com/MAPJe71/Languages" rel="nofollow ugc">“Languages” collection</a>.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/55481</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/55481</guid><dc:creator><![CDATA[MAPJe71]]></dc:creator><pubDate>Wed, 01 Jul 2020 20:55:54 GMT</pubDate></item><item><title><![CDATA[Reply to Function List with comments after function name on Wed, 01 Jul 2020 20:48:25 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/14">@MAPJe71</a> said in <a href="/post/55479">Function List with comments after function name</a>:</p>
<blockquote>
<p dir="auto">I guess “known issues” #4 and #5 apply.</p>
</blockquote>
<p dir="auto">Actually no, I have that covered.  It was Issue #1:</p>
<p dir="auto">"Known Issues:</p>
<p dir="auto">Comment has to be preceded by at least two white-space characters e.g. carriage-return + line-feed, line-feed + one space or tab, or 2 spaces (for inline comment)."</p>
<p dir="auto">I converted my config from Unix line endings to Windows line endings and magically all the “Ethernet#” appeared in the function list.  So that’s why adding a space before the comment worked, I needed 2 characters ( LF + space, or CR+LF ).</p>
<p dir="auto">Thanks for your comprehensive tutorial, you seem to be the master of the Function List parsers!  I’ve added quite a few to my functionList.xml including some for UDL’s (protobuf, Cisco IOS).</p>
<p dir="auto">Cheers.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/55480</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/55480</guid><dc:creator><![CDATA[Michael Vincent]]></dc:creator><pubDate>Wed, 01 Jul 2020 20:48:25 GMT</pubDate></item><item><title><![CDATA[Reply to Function List with comments after function name on Wed, 01 Jul 2020 20:42:26 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/14847">@Michael-Vincent</a> I guess “known issues” #4 and #5 apply.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/55479</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/55479</guid><dc:creator><![CDATA[MAPJe71]]></dc:creator><pubDate>Wed, 01 Jul 2020 20:42:26 GMT</pubDate></item><item><title><![CDATA[Reply to Function List with comments after function name on Wed, 01 Jul 2020 20:00:24 GMT]]></title><description><![CDATA[<p dir="auto">See <a href="https://community.notepad-plus-plus.org/topic/19480/faq-desk-function-list-basics">FAQ Desk Function List Basics</a> for known issues addition.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/55478</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/55478</guid><dc:creator><![CDATA[MAPJe71]]></dc:creator><pubDate>Wed, 01 Jul 2020 20:00:24 GMT</pubDate></item></channel></rss>