<?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[Help Adding Pascal to Function List]]></title><description><![CDATA[<p dir="auto">I am trying to figure out how to add Pascal to the Function List feature.</p>
<p dir="auto">There are two issues I’m having difficulty figuring out.</p>
<p dir="auto">The first one is that Pascal has Functions and Procedures, Functions return something, Procedures do not… as far as the Function List is concerned, they are both the same.  I can’t figure out how to get both “Function” and “Procedure” to show up in the list.</p>
<p dir="auto">I can’t paste it as code here because it’s just a giant unreadable mess, but here is a screen shot of what I am trying to do:<br />
<img src="/assets/uploads/files/1671621042115-screenshot-2022-12-20-214050-resized.png" alt="Screenshot 2022-12-20 214050.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">I don’t know anything at all about Regex Expressions, but I tried an OR function in an on-line Regex helper and (?i:PROCEDURE\s+)|(?i:FUNCTION\s+)  should get a hit on both Procedure and Function… but it doesn’t work, I only get whatever I put there first.<br />
<img src="/assets/uploads/files/1671621176694-screenshot-2022-12-20-214638-resized.png" alt="Screenshot 2022-12-20 214638.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">The second thing I’m not sure how to do is eliminate the duplicates caused by the declaration in a Unit.   everything between<br />
Interface<br />
And<br />
Implementation<br />
should be ignored, as those are not the actual functions and procedures, they are just a declaration of them.</p>
<p dir="auto">Here’s the code just in case it looks better after I post it:</p>
<pre><code>			&lt;association id=     "pascal_function"    langID="11"                          /&gt;

			&lt;!-- ===================================================== [ Pascal ] --&gt;

			&lt;parser
				displayName="Pascal"
				id         ="pascal_function"
				commentExpr="(?x)                                            # Utilize inline comments (see `RegEx - Pattern Modifiers`)
								(?is:\x23cs.*?\x23ce)                            # Multi Line Comment
							|	(?m-s:^\h*;.*?$)                                 # Single Line Comment
							"
			&gt;
				&lt;function
					mainExpr="(?x)                                            # Utilize inline comments (see `RegEx - Pattern Modifiers`)
							(?m)^\h*                                            # optional leading whitespace
							(?i:PROCEDURE|FUNCTION\s+)                          # start-of-function indicator
							\K                                                  # keep the text matched so far, out of the overall match
							[A-Za-z_]\w*                                        # valid character combination for identifiers
					      (?:\s*\([^)]*?\))?                                  # parentheses and parameters optional
						"
				&gt;
					&lt;!-- comment out the following node to display the function with its parameters --&gt;
					&lt;functionName&gt;
						&lt;nameExpr expr="[A-Za-z_]\w*" /&gt;
					&lt;/functionName&gt;
				&lt;/function&gt;
			&lt;/parser&gt;
			&lt;!-- ================================================================= --&gt;
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/topic/23921/help-adding-pascal-to-function-list</link><generator>RSS for Node</generator><lastBuildDate>Wed, 10 Jun 2026 09:45:15 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/23921.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 21 Dec 2022 11:20:38 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Help Adding Pascal to Function List on Sat, 13 May 2023 21:26:24 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/menit-lop" aria-label="Profile: menit-lop">@<bdi>menit-lop</bdi></a> ,<br />
You might want to read the documents a little better. If you’re going to have multiple possibilities in the mainExpr buffer, than you need to give it multiple options by separating the two options, not combining them. It probably should look more like this:</p>
<pre><code>?i:PROCEDURE\s+ \K
|
?i:FUNCTION\s+ \K

</code></pre>
<p dir="auto">When the first option fails, it tries the next…and on down a list if there are multiple options, like <a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a> showed me in my dBASE UDL, which had the similar construct of Procedure, Functions, but also so we could make objects show up in the function list when there was no function, by using an additional OR statement of <code>with</code>, where the code looked like this:</p>
<pre><code>   this.NPPINST_TL = new TEXTLABEL(this)
   with (this.NPPINST_TL)
      height = 2.0
      left = 29.0
      top = 0.5
      width = 67.0
      text = "Notepad++ dBASE Plus UDL Installer"
      colorNormal = "0x404000/Silver"
      fontSize = 19.0
      fontBold = true
   endwith
</code></pre>
<p dir="auto">As you can see, our UI classes would not show up unless they had a function inside them, and we wanted to be able to see the Objects whether they had a function or not, and <a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a> figured that out for me, that adding that OR statement in the function parser would allow that to show up also emulating a function option, so our functionList code looked like this:</p>
<pre><code>			&lt;function
					mainExpr="(?xi-s) 
									^
									\h* 
									(?:
									
									function \h+ \w+
									|
									procedure \h+ \w+
									|
									with \h+ \(.*?\)
								)
								\h*
							"
				&gt;
</code></pre>
<p dir="auto">Hopefully this helps you.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/86324</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/86324</guid><dc:creator><![CDATA[Lycan Thrope]]></dc:creator><pubDate>Sat, 13 May 2023 21:26:24 GMT</pubDate></item><item><title><![CDATA[Reply to Help Adding Pascal to Function List on Sat, 13 May 2023 20:43:53 GMT]]></title><description><![CDATA[<p dir="auto"><a href="https://www.genera.cl/feriados-en-chile-todo-sobre-los-dias-festivos-para-2023/sin-categoria/" rel="nofollow ugc">@James-Richters</a> said in <a href="/post/82632">Help Adding Pascal to Function List</a>:</p>
<blockquote>
<p dir="auto">I am trying to figure out how to add Pascal to the Function List feature.</p>
<p dir="auto">There are two issues I’m having difficulty figuring out.</p>
<p dir="auto">The first one is that Pascal has Functions and Procedures, Functions return something, Procedures do not… as far as the Function List is concerned, they are both the same.  I can’t figure out how to get both “Function” and “Procedure” to show up in the list.</p>
<p dir="auto">I can’t paste it as code here because it’s just a giant unreadable mess, but here is a screen shot of what I am trying to do:<br />
<img src="/assets/uploads/files/1671621042115-screenshot-2022-12-20-214050-resized.png" alt="Screenshot 2022-12-20 214050.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">I don’t know anything at all about Regex Expressions, but I tried an OR function in an on-line Regex helper and (?i:PROCEDURE\s+)|(?i:FUNCTION\s+)  should get a hit on both Procedure and Function… but it doesn’t work, I only get whatever I put there first.<br />
<img src="/assets/uploads/files/1671621176694-screenshot-2022-12-20-214638-resized.png" alt="Screenshot 2022-12-20 214638.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">The second thing I’m not sure how to do is eliminate the duplicates caused by the declaration in a Unit.   everything between<br />
Interface<br />
And<br />
Implementation<br />
should be ignored, as those are not the actual functions and procedures, they are just a declaration of them.</p>
<p dir="auto">Here’s the code just in case it looks better after I post it:</p>
<pre><code>			&lt;association id=     "pascal_function"    langID="11"                          /&gt;

			&lt;!-- ===================================================== [ Pascal ] --&gt;

			&lt;parser
				displayName="Pascal"
				id         ="pascal_function"
				commentExpr="(?x)                                            # Utilize inline comments (see `RegEx - Pattern Modifiers`)
								(?is:\x23cs.*?\x23ce)                            # Multi Line Comment
							|	(?m-s:^\h*;.*?$)                                 # Single Line Comment
							"
			&gt;
				&lt;function
					mainExpr="(?x)                                            # Utilize inline comments (see `RegEx - Pattern Modifiers`)
							(?m)^\h*                                            # optional leading whitespace
							(?i:PROCEDURE|FUNCTION\s+)                          # start-of-function indicator
							\K                                                  # keep the text matched so far, out of the overall match
							[A-Za-z_]\w*                                        # valid character combination for identifiers
					      (?:\s*\([^)]*?\))?                                  # parentheses and parameters optional
						"
				&gt;
					&lt;!-- comment out the following node to display the function with its parameters --&gt;
					&lt;functionName&gt;
						&lt;nameExpr expr="[A-Za-z_]\w*" /&gt;
					&lt;/functionName&gt;
				&lt;/function&gt;
			&lt;/parser&gt;
			&lt;!-- ================================================================= --&gt;
</code></pre>
</blockquote>
<p dir="auto">I also face this problem.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/86323</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/86323</guid><dc:creator><![CDATA[menit lop]]></dc:creator><pubDate>Sat, 13 May 2023 20:43:53 GMT</pubDate></item><item><title><![CDATA[Reply to Help Adding Pascal to Function List on Fri, 20 Jan 2023 11:09:47 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/james-richters" aria-label="Profile: James-Richters">@<bdi>James-Richters</bdi></a></p>
<p dir="auto">Meanwhile a fix has been applied to the source code of <em>Notepad++</em> that allows  your fix (to define source code between the <code>interface</code> and <code>implementation</code> keywords as a multi-line comment) to work reliably <strong>if it is used in a mixed function list parser</strong>. You can download a preview version (including that fix) of <em>Notepad++</em> 32 bit <a href="https://ci.appveyor.com/project/donho/notepad-plus-plus/builds/45967860/job/xv5d0qovxhu9ew31/artifacts" rel="nofollow ugc">&gt;&gt;from here&lt;&lt;</a> and the 64 bit version <a href="https://ci.appveyor.com/project/donho/notepad-plus-plus/builds/45967860/job/s9vllk70vmix4rsc/artifacts" rel="nofollow ugc">&gt;&gt;from here&lt;&lt;</a>.</p>
<p dir="auto">Additionally, some fixes have applied to my <em>Pascal/Delphi</em> function list parser (including your fix to define source code between the <code>interface</code> and <code>implementation</code> keywords as a multi-line comment). You can download it <a href="https://github.com/notepad-plus-plus/notepad-plus-plus/blob/d476a894c2f04d620a2a49b315deee94e4f36f74/PowerEditor/installer/functionList/pascal.xml" rel="nofollow ugc">&gt;&gt;from here&lt;&lt;</a>.</p>
<p dir="auto">So, we <em>Delphi</em> developers <strong>should</strong> have a working solution.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/83421</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/83421</guid><dc:creator><![CDATA[dinkumoil]]></dc:creator><pubDate>Fri, 20 Jan 2023 11:09:47 GMT</pubDate></item><item><title><![CDATA[Reply to Help Adding Pascal to Function List on Thu, 29 Dec 2022 11:46:43 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a> said in <a href="/post/82775">Help Adding Pascal to Function List</a>:</p>
<blockquote>
<p dir="auto">can you enlighten me on this apparent contradiction ?</p>
</blockquote>
<p dir="auto">When I remove the class parser part of my mixed parser (i.e. the whole <code>classRange</code> XML node) I’m able to define everything between the <code>interface</code> and <code>implementation</code> keywords as a comment.</p>
<p dir="auto">So, again it seems necessary to analyse the C++ code that processes function list parser files and fills the tree in function list panel.</p>
<p dir="auto">But maybe you <a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a> are lucky and can find content for the class parser part that doesn’t cause the comment expression to fail. I already tried to use empty regexes in the class parser, that failed too. Seems like the simple presence of a class parser part is the root cause.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/82869</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/82869</guid><dc:creator><![CDATA[dinkumoil]]></dc:creator><pubDate>Thu, 29 Dec 2022 11:46:43 GMT</pubDate></item><item><title><![CDATA[Reply to Help Adding Pascal to Function List on Tue, 27 Dec 2022 03:41:34 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="/user/james-richters" aria-label="Profile: james-richters">@<bdi>james-richters</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/rdipardo" aria-label="Profile: rdipardo">@<bdi>rdipardo</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: peterjones">@<bdi>peterjones</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/michael-vincent" aria-label="Profile: michael-vincent">@<bdi>michael-vincent</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/dinkumoil" aria-label="Profile: dinkumoil">@<bdi>dinkumoil</bdi></a> and <strong>All</strong>,</p>
<p dir="auto">Yes, of course: my <strong>test</strong> and <strong>parser</strong> examples were <strong>deliberately</strong> sketchy to only <strong>highlight</strong> that the declarations in the [Interface - Implementation] range were <strong>correctly</strong> ignored, as well as all text in <strong>comments</strong></p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dinkumoil" aria-label="Profile: dinkumoil">@<bdi>dinkumoil</bdi></a>, I also consulted your <strong>new Pascal</strong> parser and indeed, I am <strong>far</strong> from matching you on this point !</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dinkumoil" aria-label="Profile: dinkumoil">@<bdi>dinkumoil</bdi></a>, you said :</p>
<blockquote>
<p dir="auto">… I was not able to define everything between the interface and implementation keywords as a comment. I used a similar expression like <a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a> (i.e. (?is:^\h* Interface.<em>?^\h</em>Implementation\s*)) but it didn’t work, it was just ignored.</p>
</blockquote>
<p dir="auto">But, obviously, my simple <strong>example</strong> shows that it seems to work ?! So, <a class="plugin-mentions-user plugin-mentions-a" href="/user/dinkumoil" aria-label="Profile: dinkumoil">@<bdi>dinkumoil</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/rdipardo" aria-label="Profile: rdipardo">@<bdi>rdipardo</bdi></a>, can you enlighten me on this <strong>apparent</strong> contradiction ?</p>
<p dir="auto">Please, do <strong>not</strong> spend too much time on this : <em>I’ll take your word for it</em> !</p>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/82775</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/82775</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Tue, 27 Dec 2022 03:41:34 GMT</pubDate></item><item><title><![CDATA[Reply to Help Adding Pascal to Function List on Sat, 24 Dec 2022 10:56:55 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/rdipardo" aria-label="Profile: rdipardo">@<bdi>rdipardo</bdi></a></p>
<p dir="auto">I can confirm that the new version of my parser causes commented-out procedures/functions to be part of the function list.</p>
<blockquote>
<p dir="auto">There needs to be an expression that can check the previous line for the start of a block comment.</p>
</blockquote>
<p dir="auto">The core problem seems to be how matching and processing block comments is realized in the related C++ code that fills the function list panel. There is a special section in the XML file of function list parsers to define line and block comments. I expect that code, that is recognized as commented-out by the regexes in this section, is not parsed anymore by the regex that identifies procedure/function implementations. But that’s obviously not the case and I’m wondering what’s the sense of the comment-definition section in the parser file, respectively how it is processed.</p>
<p dir="auto">Maybe the same behaviour of the C++ code that fills the function list panel is the cause that I was not able to define everything between the <code>interface</code> and <code>implementation</code> keywords as a comment. I used a similar expression like <a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a> (i.e. <code>(?is:^\h* Interface.*?^\h*Implementation\s*)</code>) but it didn’t work, it was just ignored. Trying this regex in the normal search-and-replace dialog of Notepad++ gave the expected result but in function list parser I had duplicate entries for procedure/function declarations.</p>
<p dir="auto">Maybe someone with C++ knowledge (maybe <a class="plugin-mentions-user plugin-mentions-a" href="/user/rdipardo" aria-label="Profile: rdipardo">@<bdi>rdipardo</bdi></a> ?) should have a look at the function list code to check how it processes the regexes from the parser file.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/82729</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/82729</guid><dc:creator><![CDATA[dinkumoil]]></dc:creator><pubDate>Sat, 24 Dec 2022 10:56:55 GMT</pubDate></item><item><title><![CDATA[Reply to Help Adding Pascal to Function List on Sat, 24 Dec 2022 00:54:51 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a>,</p>
<blockquote>
<p dir="auto">I may have <strong>missed</strong> some <strong>obvious</strong> constructions, which must be <strong>seen</strong> in the <strong><code>Fucntion List</code></strong> window. Just tell me about it ?</p>
</blockquote>
<p dir="auto">After transforming your sample into a valid source file [^1], it seems your parser has lost the ability to find nested procedures.</p>
<p dir="auto"><img src="/assets/uploads/files/1671842717111-pascal.xml-nodebb-rev.png" alt="pascal.xml-nodebb-rev.png" class=" img-fluid img-markdown" /></p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dinkumoil" aria-label="Profile: dinkumoil">@<bdi>dinkumoil</bdi></a>’s (corrected) parser finds them, at the expense of <em>also</em> detecting the commented-out ones (i.e., the ones “nested” within block comments.)</p>
<p dir="auto"><img src="/assets/uploads/files/1671842734488-pascal.xml-upstream.png" alt="pascal.xml-upstream.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">As written, the rule is satisfied anytime the first alphabetic sequence in <strong><em>any</em></strong> line happens to be an implementation keyword. The only time the rule fails is when a comment marker is <strong><em>directly followed</em></strong> by an implementation keyword.</p>
<p dir="auto">There needs to be an expression that can check the <strong><em>previous</em></strong> line for the start of a block comment. Unfortunately, look-behind expressions are explicitly <a href="https://npp-user-manual.org/docs/function-list/#mixed-parser:~:text=The%20parser%20does%20not%20accept%20regular%20expresion%20look%20behind%20operations%20in%20the%20expressions." rel="nofollow ugc"><em>not</em> allowed by the function parser specification</a>.</p>
<p dir="auto">Even without testing, I’m confident this is reproducible in other languages with function parsers. It’s just a fundamental limitation of the specification.</p>
<hr />
<p dir="auto">[^1]:</p>
<pre><code class="language-pascal">Unit Guy;

{$IFDEF FPC} // Free Pascal
  {$mode objfpc}
{$endif}

Interface

{$IFDEF DCC} // Delphi
  uses Winapi.Windows; // DWORD
{$endif}

Procedure Dummy ( const bla);
function  Test(Tnum:Double): DWord;
function  Bar(const AParam: string): integer;
procedure Foo(AParam: integer);
procedure Boo(AParam: integer);

Implementation

Procedure Dummy ( const bla);
begin
end;

{ This is a small test } function  Bar(const AParam: string): integer;
                         begin
                           Result := -1;
                         end;

procedure Foo(AParam: integer);
begin
end;

{
This is a (* small test
procedure Foo(AParam: integer);
function  Bar(const AParam: string): integer;
function  Test(Tnum:Double): DWord;
procedure Boo(AParam: integer);
to see if *) all is OK
}

function Test(Tnum:Double): DWord;
begin
  Result := 0;
end;

procedure Boo(AParam: integer);
  procedure Guy; // locally defined procedure
  begin
  end;
begin
end;

(*
This is a { small test
procedure Foo(AParam: integer);
function  Bar(const AParam: string): integer;
function  Test(Tnum:Double): DWord;
procedure Boo(AParam: integer);
to verify if} all is OK
*)
end.
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/82723</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/82723</guid><dc:creator><![CDATA[rdipardo]]></dc:creator><pubDate>Sat, 24 Dec 2022 00:54:51 GMT</pubDate></item><item><title><![CDATA[Reply to Help Adding Pascal to Function List on Sat, 24 Dec 2022 00:05:23 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/james-richters" aria-label="Profile: James-Richters">@<bdi>James-Richters</bdi></a></p>
<p dir="auto">Although I’m on vacation, I found some time to update my parser. Have a look at <a href="https://github.com/notepad-plus-plus/notepad-plus-plus/pull/12694" rel="nofollow ugc">my PR</a>.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/82720</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/82720</guid><dc:creator><![CDATA[dinkumoil]]></dc:creator><pubDate>Sat, 24 Dec 2022 00:05:23 GMT</pubDate></item><item><title><![CDATA[Reply to Help Adding Pascal to Function List on Fri, 23 Dec 2022 22:43:26 GMT]]></title><description><![CDATA[<p dir="auto">Hello, <a class="plugin-mentions-user plugin-mentions-a" href="/user/james-richters" aria-label="Profile: james-richters">@<bdi>james-richters</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/rdipardo" aria-label="Profile: rdipardo">@<bdi>rdipardo</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: peterjones">@<bdi>peterjones</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/michael-vincent" aria-label="Profile: michael-vincent">@<bdi>michael-vincent</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/dinkumoil" aria-label="Profile: dinkumoil">@<bdi>dinkumoil</bdi></a> and <strong>All</strong>,</p>
<p dir="auto">Allow me to invite myself in your <strong>conversation</strong>. I did some texts and the following <strong><code>Pascal</code></strong> parser should meet your <strong>needs</strong> !</p>
<hr />
<ul>
<li>Save the following text, in the <strong><code>functionList</code></strong> folder, with name <strong><code>Pascal.xml</code></strong>, as an <strong><code>UTF-8</code></strong> encoded file :</li>
</ul>
<pre><code class="language-xml">&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
&lt;!-- =================================================================================
|
|    To learn how to make your own language parser, please check the following link:
|
|       https://npp-user-manual.org/docs/function-list/
|
     ================================================================================= --&gt;
&lt;NotepadPlus&gt;
    &lt;functionList&gt;
        &lt;!-- ===================================================== [ Pascal ] =============================================================== --&gt;

            &lt;parser
                displayName="Pascal"
                id         ="pascal_function"
                commentExpr="(?x)                                             # Utilize inline comments (see `RegEx - Pattern Modifiers`)
                             (?s:  \x7B        .*? \x7D             )           # Multi Line Comment 1st variant
                          |  (?is: ^ Interface .*? ^ Implementation )           # Multi Line Comment 2nd variant
                          |  (?s:  \x28\x2A    .*? \x2A\x29         )           # Multi Line Comment 2nd variant
                          |  (?-s: \x2F\x2F    .*                   )           # Single Line Comment
                            "
            &gt;
                &lt;function
                    mainExpr="(?x)                                            # Utilize inline comments (see `RegEx - Pattern Modifiers`)
                              (?-s) ^ \h*                                       # optional leading whitespace
                              (?i: PROCEDURE | FUNCTION ) \s*                   # start-of-function indicator
                              \K                                                # keep the text matched so far, out of the overall match
                              [A-Za-z_] \w*                                     # valid character combination for identifiers
                              (?: \s* \( .*? \) (?: : .+ )? )? ;                # parentheses and parameters optional
                        "
                &gt;
                &lt;!-- COMMENT out the THREE following lines to display the function with its PARAMETERS --&gt;
                    &lt;functionName&gt;
                        &lt;nameExpr expr="[A-Za-z_]\w*" /&gt;
                    &lt;/functionName&gt;
                &lt;/function&gt;
            &lt;/parser&gt;
        &lt;!-- ================================================================================================================================ --&gt;
    &lt;/functionList&gt;
&lt;/NotepadPlus&gt;

</code></pre>
<ul>
<li><strong>Add</strong>, as usual, the line below, within the <strong><code>overrrideMap.xml</code></strong> file, in the <strong><code>functionList</code></strong> folder :</li>
</ul>
<pre><code class="language-xml">			&lt;association id= "pascal.xml"        langID= "11"/&gt;
</code></pre>
<ul>
<li>Open a <strong>new</strong> tab and <strong>paste</strong> the following text in a file, named <strong><code>Test.pas</code></strong> :</li>
</ul>
<pre><code class="language-diff">Procedure Dummy ( const bla);

Interface

function  Test(Tnum:Double): DWord;
function  Bar(const AParam: string): integer;
procedure Foo(AParam: integer);
procedure Boo(AParam: integer);

Implementation

This is a // small test  function  Bar(const AParam: string): integer;

procedure Foo(AParam: integer);

function Bar(const AParam: string): integer;

This is a (* small test
procedure Foo(AParam: integer);
function  Bar(const AParam: string): integer;
function  Test(Tnum:Double): DWord;
procedure Boo(AParam: integer);
to see if *) all is OK

function Test(Tnum:Double): DWord;

procedure Boo(AParam: integer);

This is a { small test
procedure Foo(AParam: integer);
function  Bar(const AParam: string): integer;
function  Test(Tnum:Double): DWord;
procedure Boo(AParam: integer);
to verify if } all is OK

procedure Guy;
</code></pre>
<ul>
<li>
<p dir="auto"><strong>Stop</strong> and <strong>re-start</strong> Notepad++</p>
</li>
<li>
<p dir="auto">Select your <strong><code>Test.pas</code></strong> tab</p>
</li>
<li>
<p dir="auto">Click on the <strong><code>View &gt; Function List</code></strong> option</p>
</li>
</ul>
<p dir="auto">=&gt; You should get this picture :</p>
<p dir="auto"><img src="/assets/uploads/files/1671834319337-8cb20ffe-2b21-448c-b3bf-7ec8e95050a3-function_list.png" alt="8cb20ffe-2b21-448c-b3bf-7ec8e95050a3-Function_List.png" class=" img-fluid img-markdown" /></p>
<hr />
<p dir="auto">As you can verify :</p>
<ul>
<li>
<p dir="auto">All the <strong>declarations</strong>, between the <strong><code>Interface</code></strong> and <strong><code>Inplementation</code></strong> boundaries, are <strong>not</strong> listed as <strong>expected</strong></p>
</li>
<li>
<p dir="auto">All text between the <strong>multi</strong>-lines comment <strong><code>(\*</code></strong> and <strong><code>\*)</code></strong> is <strong>not</strong> listed as <strong>expected</strong></p>
</li>
<li>
<p dir="auto">All text between the <strong>multi</strong>-lines comment <strong><code>{</code></strong> and <strong><code>}</code></strong> is <strong>not</strong> listed, too, as <strong>expected</strong></p>
</li>
<li>
<p dir="auto">All text beginning a <strong>single</strong>-line comment <strong><code>//</code></strong> is <strong>not</strong> listed in the <strong><code>Function List</code></strong> window, as <strong>expected</strong></p>
</li>
</ul>
<hr />
<p dir="auto">Of course, as I don’t know the <strong><code>Pascal</code></strong> language, I may have <strong>missed</strong> some <strong>obvious</strong> constructions, which must be <strong>seen</strong> in the <strong><code>Fucntion List</code></strong> window. Just tell me about it ?</p>
<p dir="auto">See you later,</p>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/82718</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/82718</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Fri, 23 Dec 2022 22:43:26 GMT</pubDate></item><item><title><![CDATA[Reply to Help Adding Pascal to Function List on Fri, 23 Dec 2022 13:32:00 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dinkumoil" aria-label="Profile: dinkumoil">@<bdi>dinkumoil</bdi></a> No Problem at all, the parser version I have is WAY better than the non-existent parser I had a few days ago :)<br />
So have a nice holiday, and thank you for your efforts.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/82714</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/82714</guid><dc:creator><![CDATA[James Richters]]></dc:creator><pubDate>Fri, 23 Dec 2022 13:32:00 GMT</pubDate></item><item><title><![CDATA[Reply to Help Adding Pascal to Function List on Fri, 23 Dec 2022 13:04:35 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/james-richters" aria-label="Profile: James-Richters">@<bdi>James-Richters</bdi></a></p>
<p dir="auto">Bad news, my PR I mentioned above is faulty, it didn’t pass the unit test at GitHub. The version I commited in this PR seems also to be outdated.</p>
<p dir="auto">Since I’m not at home, I’m not able to fix the issue at the moment, you have to wait at least until next week for a working parser.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/82712</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/82712</guid><dc:creator><![CDATA[dinkumoil]]></dc:creator><pubDate>Fri, 23 Dec 2022 13:04:35 GMT</pubDate></item><item><title><![CDATA[Reply to Help Adding Pascal to Function List on Fri, 23 Dec 2022 10:27:28 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/james-richters" aria-label="Profile: James-Richters">@<bdi>James-Richters</bdi></a></p>
<p dir="auto">I don’t know how that could happen, but when I commited my Pascal/Delphi FunctionList parser I accidentally commited an outdated version. That’s the reason why I wasn’t able to reproduce your issue locally - with the Notepad++ installations on my machine I use an improved version of the parser. :-(</p>
<p dir="auto">I created an <a href="https://github.com/notepad-plus-plus/notepad-plus-plus/issues/12693" rel="nofollow ugc">issue</a> and a related <a href="https://github.com/notepad-plus-plus/notepad-plus-plus/pull/12694" rel="nofollow ugc">pull request</a> on GitHub that includes the improvements of the parser I use locally.</p>
<p dir="auto">Hopefully <a class="plugin-mentions-user plugin-mentions-a" href="/user/donho" aria-label="Profile: donho">@<bdi>donho</bdi></a> will include this PR into the upcoming v8.4.8 release though it’s commited so late.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/82707</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/82707</guid><dc:creator><![CDATA[dinkumoil]]></dc:creator><pubDate>Fri, 23 Dec 2022 10:27:28 GMT</pubDate></item><item><title><![CDATA[Reply to Help Adding Pascal to Function List on Thu, 22 Dec 2022 18:31:17 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dinkumoil" aria-label="Profile: dinkumoil">@<bdi>dinkumoil</bdi></a> :   I installed Notepad++ on another computer and at first I thought the Pascal function list was fine… it wasn’t showing any duplicates from the implementation section, but then I tried to load one of my huge units, and I had duplicates again, but I figured out what happened… I had some procedures commented out from the implementation section, I didn’t need them to be called from outside the unit, or I replaced them with something else… but commenting something out with { curly braces } makes it show everything before the curly braces.</p>
<p dir="auto">Here I have a very small unit that demonstrates the issue…<br />
Edit:  I had an actual small unit here but it got flagged as spam so I made another one based on your example, but then I didn’t have the problem, it took me a while but I figured out that the comments after the End; of the function are needed to reproduce the issue.</p>
<p dir="auto">Here is the sample code:</p>
<pre><code>unit FooBar;

Interface
Uses CRT,Windows;
procedure Foo(AParam: integer);
function  Bar(const AParam: string): integer;
{function  Test(Tnum:Double): DWord;   //Removeing the curly braces fixes it}
procedure Boo(AParam: integer);

Implementation

procedure Foo(AParam: integer);
begin
  // Do something
end; { func. Foo  If these comments are not here, it doens't happen }

function Bar(const AParam: string): integer;
begin
  // Do something

  Result := 0;
end; { func. Bar }

function Test(Tnum:Double): DWord;
begin
  // Do something

  Result := 0;
end;{ func. Test }

procedure Boo(AParam: integer);
begin
  // Do something

  Result := 0;
end;

Begin
end.
</code></pre>
<p dir="auto">You can see things above the commented out section are duplicated.   In my original test,  I had some units more than 100 functions down commented out like this, so I had a lot of duplicates.</p>
<p dir="auto"><img src="/assets/uploads/files/1671726716218-screenshot1-resized.png" alt="screenshot1.PNG" class=" img-fluid img-markdown" /></p>
<p dir="auto">If I would have commented them out with // instead, then it works fine,  unfortunately I have a LOT of units and many times I would comment things out with { } just to show what was in the unit… it would be a monumental undertaking to go through and change them all.</p>
<p dir="auto"><img src="/assets/uploads/files/1671726930604-screenshot2-resized.png" alt="screenshot2.PNG" class=" img-fluid img-markdown" /></p>
<p dir="auto">Unfortunately, my idea to make a comment out of everything between Interface and Implementation also does not work in this case… but I figured out it’s because multiline comments are not working correctly. See the example below,  the multiline comments only work if there is something on the line that begins them, not it it’s on the line above by itself:<br />
<img src="/assets/uploads/files/1671730961748-screenshot3.png" alt="screenshot3.PNG" class=" img-fluid img-markdown" /></p>
<p dir="auto">Everything should be commented out except Dummy1,  but 2 and 5 are not… even though in the code they clearly are.</p>
<p dir="auto">I don’t have a clue how to fix this.  I just don’t know enough about how it all works, but I think if the multiline comments worked the way they are supposed to, even if there is nothing on the line following the beginning of the comment,  then this would work, but how to do that?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/82696</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/82696</guid><dc:creator><![CDATA[James Richters]]></dc:creator><pubDate>Thu, 22 Dec 2022 18:31:17 GMT</pubDate></item><item><title><![CDATA[Reply to Help Adding Pascal to Function List on Thu, 22 Dec 2022 16:05:58 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dinkumoil" aria-label="Profile: dinkumoil">@<bdi>dinkumoil</bdi></a>  First of all, Thank You for developing a Pascal function list parser!  I have some really large pascal projects with hundreds of functions and procedures and it’s going to  save me a lot of time navigating them.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dinkumoil" aria-label="Profile: dinkumoil">@<bdi>dinkumoil</bdi></a> said in <a href="/post/82661">Help Adding Pascal to Function List</a>:</p>
<blockquote>
<p dir="auto">From your comments I’m not sure if you really tested my parser or if you tested yours. So, please clarify which parser you used.</p>
</blockquote>
<p dir="auto">As soon as I found out there was already a Pascal function list parser I was available, I abandoned my attempt at it because I really have absolutely no idea, especially when it comes to regex.   So I installed  Notepad++ v8.4.8 Release Candidate 3, and after that, my Pascal files had no function list anymore, because v8.4.8 did not include your Pascal parser… so I found out it was included in the portable version, so I downloaded that, and copied the missing file to the v8.4.8 installation, and then it worked, but I had duplicates of everything in the interface section, and putting the extra line in the file I just copied over seemed to fix it.</p>
<p dir="auto">but now I’m questioning if that really fixed it or if I somehow got back on my old attempt?   I guess it’s possible…  So What I will do to get to the bottom of this, is install Notepad ++  different computer and test it again from scratch on that… that way we can be sure that I didn’t somehow get back on my old parser.  I will let you know the results, and if I still have the issue, I will provide a sample program to demonstrate it.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/82687</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/82687</guid><dc:creator><![CDATA[James Richters]]></dc:creator><pubDate>Thu, 22 Dec 2022 16:05:58 GMT</pubDate></item><item><title><![CDATA[Reply to Help Adding Pascal to Function List on Thu, 22 Dec 2022 10:08:32 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a><br />
Of course, <strong>I am</strong> interested in potential bugs in my function list parser.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/james-richters" aria-label="Profile: James-Richters">@<bdi>James-Richters</bdi></a><br />
However, I can not reproduce your issue.</p>
<p dir="auto">My function list parser is a <a href="https://npp-user-manual.org/docs/function-list/#mixed-parser" rel="nofollow ugc">mixed parser</a> because nowadays most <em>Pascal</em> variants are object oriented, so a class parser and a function parser are put together to form a mixed parser. Since your example code doesn’t contain objects, for you the relevant part of my parser is the <code>function</code> XML tag. Its <code>mainExpr</code> attribute contains the regular expression to detect function definitions and to <strong>avoid procedure and function declarations</strong> in the <code>interface</code> section (<a href="https://github.com/notepad-plus-plus/notepad-plus-plus/blob/11f7ba2e0a80dae890c5162a92635d6c6151af64/PowerEditor/installer/functionList/pascal.xml#L142" rel="nofollow ugc">see this line and the following 8 lines</a>) and forward declarations in the <code>implementation</code> section (<a href="https://github.com/notepad-plus-plus/notepad-plus-plus/blob/11f7ba2e0a80dae890c5162a92635d6c6151af64/PowerEditor/installer/functionList/pascal.xml#L141" rel="nofollow ugc">see this line</a>).</p>
<p dir="auto">Avoiding procedure/function declarations in the <code>interface</code> section is done by a <a href="https://www.regular-expressions.info/lookaround.html" rel="nofollow ugc"><em>positive look ahead</em></a> <code>(?=(...))</code>that requires a procedure or function header to be followed by at least one of a list of certain keywords (<code>CONST</code>, <code>TYPE</code>, <code>VAR</code>, <code>LABEL</code> or <code>BEGIN</code>) or by the definition of an inline procedure or  function (<code>(?R)</code> which triggers <a href="https://www.regular-expressions.info/recurse.html" rel="nofollow ugc"><em>regex recursion</em></a>).</p>
<p dir="auto">Triggered by this forum thread, for testing my parser I used the following source code:</p>
<pre><code class="language-pascal">unit FooBar;


interface

uses
  System.SysUtils;


procedure Foo(AParam: integer);
function  Bar(const AParam: string): integer;



implementation

procedure Foo(AParam: integer);
begin
  // Do something
end;


function Bar(const AParam: string): integer;
begin
  // Do something

  Result := 0;
end;


end.
</code></pre>
<p dir="auto">This is minimalistic but similar to the <a href="https://community.notepad-plus-plus.org/post/82640">code provided by you as screenshot</a>. It doesn’t produce duplicates in function list.</p>
<p dir="auto">From your comments I’m not sure if you really tested <strong>my</strong> parser or if you tested <strong>yours</strong>. So, please clarify which parser you used. <strong>Please note</strong>: In an installed version of <em>Notepad++</em> you have to put the parser’s file to <code>C:\Users\&lt;UserName&gt;\AppData\Roaming\Notepad++\functionList</code>.</p>
<p dir="auto">Nevertheless, your solution to include everything between the <code>interface</code> and <code>implementation</code> statements into the <code>commentExpr</code> tag is a clever way to simplify of avoiding procedure/function declarations in the <code>interface</code> section are shown in function list panel. If no other person decides to improve my parser, I will try to integrate your solution when I have some spare time. <strong>But most likely this will not happen during X-Mas holidays</strong>, it may take some weeks if not months because changing <strong>and testing</strong> regex code I developed and improved over <strong>three years</strong> is not a quick and easy task, at least for me.</p>
<p dir="auto">BTW: Maybe <a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a> can have a look at my parser. As a regex specialist he may find some potential improvements.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/82661</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/82661</guid><dc:creator><![CDATA[dinkumoil]]></dc:creator><pubDate>Thu, 22 Dec 2022 10:08:32 GMT</pubDate></item><item><title><![CDATA[Reply to Help Adding Pascal to Function List on Wed, 21 Dec 2022 22:29:12 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a> Thank you,  I’m on GitHub,  I’m pretty familiar with it.</p>
<p dir="auto">Summitted PR#12686<br />
<a href="https://github.com/notepad-plus-plus/notepad-plus-plus/pull/12686" rel="nofollow ugc">https://github.com/notepad-plus-plus/notepad-plus-plus/pull/12686</a></p>
<p dir="auto">I appreciate everyone’s help with this,  it’s going to be a tremendous help in my large Pascal projects</p>
]]></description><link>https://community.notepad-plus-plus.org/post/82652</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/82652</guid><dc:creator><![CDATA[James Richters]]></dc:creator><pubDate>Wed, 21 Dec 2022 22:29:12 GMT</pubDate></item><item><title><![CDATA[Reply to Help Adding Pascal to Function List on Wed, 21 Dec 2022 21:39:02 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/james-richters" aria-label="Profile: James-Richters">@<bdi>James-Richters</bdi></a> said in <a href="/post/82650">Help Adding Pascal to Function List</a>:</p>
<blockquote>
<p dir="auto">What is the best way to submit this so other Pascal users can have the definition header filtered out of their units as well?</p>
</blockquote>
<p dir="auto">At the very least, create an <a href="https://github.com/notepad-plus-plus/notepad-plus-plus/issues" rel="nofollow ugc">official issue</a>.  If you have the git/github skills necessary, you could create a PR to go with that issue; if not, just attach the updated function list <code>pascal.xml</code> to your issue, and if one of the developers likes the idea, they may create the PR for you.  ( <a class="plugin-mentions-user plugin-mentions-a" href="/user/dinkumoil" aria-label="Profile: dinkumoil">@<bdi>dinkumoil</bdi></a> may be interested, being the one who originally submitted the pascal function list last month… or <a class="plugin-mentions-user plugin-mentions-a" href="/user/rdipardo" aria-label="Profile: rdipardo">@<bdi>rdipardo</bdi></a> has already shown an interest here.  <em>My mentioning of specific users makes no guarantee, nor in any way volunteers nor commits them to do something they don’t have the time or inclination for.</em> )</p>
]]></description><link>https://community.notepad-plus-plus.org/post/82651</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/82651</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Wed, 21 Dec 2022 21:39:02 GMT</pubDate></item><item><title><![CDATA[Reply to Help Adding Pascal to Function List on Wed, 21 Dec 2022 21:27:39 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a> said in <a href="/post/82649">Help Adding Pascal to Function List</a>:</p>
<blockquote>
<p dir="auto">Looking at your regex, I was confused as to why you have the \x2A in there,</p>
</blockquote>
<p dir="auto">Well, I really have no clue when it comes to Regex… so I thought maybe the asterisks were wild cards… like “include everything”</p>
<p dir="auto">I literally copied and pasted the line below it and fiddled around with it until it worked.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a> said in <a href="/post/82649">Help Adding Pascal to Function List</a>:</p>
<blockquote>
<p dir="auto">If you don’t want to require an asterisk after Interface or before Implementation, and don’t want it case sensitive, then use<br />
…<br />
| (?is:Interface.*?Implementation)<br />
…</p>
<p dir="auto">So that should probably fix things for you.</p>
</blockquote>
<p dir="auto">That works great!  Case insensitive and everything, Thank you!</p>
<pre><code>| (?is:Interface.*?Implementation)                                        # Multi Line Comment 2nd variant to Ignore function definition for Units
</code></pre>
<p dir="auto">What is the best way to submit this so other Pascal users can have the definition header filtered out of their units as well?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/82650</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/82650</guid><dc:creator><![CDATA[James Richters]]></dc:creator><pubDate>Wed, 21 Dec 2022 21:27:39 GMT</pubDate></item><item><title><![CDATA[Reply to Help Adding Pascal to Function List on Wed, 21 Dec 2022 20:45:44 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/james-richters" aria-label="Profile: James-Richters">@<bdi>James-Richters</bdi></a> ,</p>
<p dir="auto">I was originally thinking “you cannot hold the Interface/Implementation state inside the regex while still being able to match all the functions/procedures”.  But that was a clever workaround, making your “comment” definition just exclude everything between those two keywords. Great idea!</p>
<blockquote>
<p dir="auto">to not be case sensitive</p>
</blockquote>
<p dir="auto">That part’s easy:</p>
<pre><code>...
| (?is:Interface\x2A.*?\x2A\Implementation) 
...
</code></pre>
<blockquote>
<p dir="auto">(and be correct)</p>
</blockquote>
<p dir="auto">Looking at your regex, I was confused as to why you have the <code>\x2A</code> in there, since I don’t see any asterisks in your example code.  So I think maybe those are the things that are causing the problem for you.</p>
<pre><code>...
| (?is:Interface\x2A.*?\x2A\Implementation) 
...
</code></pre>
<p dir="auto">If that’s your problem, then I am assuming you started from</p>
<pre><code>| (?s:\x28\x2A.*?\x2A\x29)                                                # Multi Line Comment 2nd variant
</code></pre>
<p dir="auto">and just changed the <code>\x28</code> and <code>\x29</code> portions.  If so, you maybe didn’t understand that regex.</p>
<ul>
<li><code>\x28\x2A</code> says "match literal characters <code>(*</code> … "</li>
<li><code>.*?</code> means "… followed by 0 or more other characters (as few as possible), until … "</li>
<li><code>\x2A\x29</code> says “… match literal characters <code>*)</code>”</li>
</ul>
<p dir="auto">Where <code>\x</code> followed by two hexadecimal digits is a way to represent any character by the hex representation of its ASCII code.  So <code>\x2A</code> in a regex means “match the ASCII character at hex position 2A, which is decimal 42, which is the asterisk character <code>*</code>”</p>
<p dir="auto">(The Search Engine That Knows All tells me that <code>(* ... *)</code> is a valid Pascal multiline comment sequence, so I think my interpretation is reasonable.)</p>
<p dir="auto">If you don’t want to require an asterisk after <code>Interface</code> or before <code>Implementation</code>, and don’t want it case sensitive, then use</p>
<pre><code>...
| (?is:Interface.*?Implementation) 
...
</code></pre>
<p dir="auto">So that should probably fix things for you.</p>
<p dir="auto">-—</p>
<h3>Useful References</h3>
<ul>
<li><a href="https://npp-user-manual.org/docs/searching/#regular-expressions" rel="nofollow ugc">Notepad++ Online User Manual: Searching/Regex</a></li>
<li><a href="https://community.notepad-plus-plus.org/topic/15765/faq-desk-where-to-find-regular-expressions-regex-documentation">FAQ: Where to find regular expressions (regex) documentation</a></li>
</ul>
]]></description><link>https://community.notepad-plus-plus.org/post/82649</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/82649</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Wed, 21 Dec 2022 20:45:44 GMT</pubDate></item><item><title><![CDATA[Reply to Help Adding Pascal to Function List on Wed, 21 Dec 2022 20:26:06 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/james-richters" aria-label="Profile: James-Richters">@<bdi>James-Richters</bdi></a> said in <a href="/post/82647">Help Adding Pascal to Function List</a>:</p>
<blockquote>
<p dir="auto">Can’t I just define that the word “Interface” starts a multi line comment and the word “Implementation” ends it?</p>
</blockquote>
<p dir="auto">Why yes I can!</p>
<p dir="auto"><img src="/assets/uploads/files/1671651484212-screenshot-2022-12-21-143711-resized.png" alt="Screenshot 2022-12-21 143711.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">I am positive the Regex I used to make this work is completely wrong… but I just took a wild guess and stuck in:</p>
<pre><code>			commentExpr="(?x)                                                                      # Utilize inline comments (see `RegEx - Pattern Modifiers`)
						   (?s:\x7B.*?\x7D)                                                        # Multi Line Comment 1st variant
						 | (?s:Interface\x2A.*?\x2A\Implementation)                                # Multi Line Comment 2nd variant
						 | (?s:\x28\x2A.*?\x2A\x29)                                                # Multi Line Comment 2nd variant
						 | (?m-s:\x2F{2}.*$)                                                       # Single Line Comment
						 "

</code></pre>
<p dir="auto">the Regex could probably be improved to not be case sensitive (and be correct)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/82648</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/82648</guid><dc:creator><![CDATA[James Richters]]></dc:creator><pubDate>Wed, 21 Dec 2022 20:26:06 GMT</pubDate></item><item><title><![CDATA[Reply to Help Adding Pascal to Function List on Wed, 21 Dec 2022 19:25:03 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/rdipardo" aria-label="Profile: rdipardo">@<bdi>rdipardo</bdi></a><br />
Can’t I just define that the word “Interface” starts a multi line comment and the word “Implementation” ends it?  The declarations need to always be between those two words… so it should be easy to just ignore everything between them</p>
]]></description><link>https://community.notepad-plus-plus.org/post/82647</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/82647</guid><dc:creator><![CDATA[James Richters]]></dc:creator><pubDate>Wed, 21 Dec 2022 19:25:03 GMT</pubDate></item><item><title><![CDATA[Reply to Help Adding Pascal to Function List on Wed, 21 Dec 2022 18:22:54 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/rdipardo" aria-label="Profile: rdipardo">@<bdi>rdipardo</bdi></a> said in <a href="/post/82643">Help Adding Pascal to Function List</a>:</p>
<blockquote>
<p dir="auto">TagsView<br />
TagLEET<br />
NppGTags</p>
</blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/james-richters" aria-label="Profile: James-Richters">@<bdi>James-Richters</bdi></a></p>
<p dir="auto">Just to set expectations:<br />
<a href="https://github.com/d0vgan/TagsView" rel="nofollow ugc">TagsView</a> - bundles a <code>ctags</code> implementation as well and looks most like the built-in Function List and/or <a href="https://bitbucket.org/uph0/sourcecookifier/src/master/sourcecookifier/README.TXT" rel="nofollow ugc">SourceCookifier</a> screenshot above (docking window panel).<br />
<a href="https://github.com/vinsworldcom/nppTagLEET" rel="nofollow ugc">TagLEET</a> - is my fork of the “official” (which hasn’t been updated in quite some time) plugin.  My fork works with current N++ but will have issues with larger (&gt;2Gb files since I have not converted all the <code>int</code>=&gt;<code>int_ptr</code> throughout.  It too bundles <code>ctags</code> and generates it for you, but is more about in-text navigation; there is no docking panel showing all the tags.<br />
<a href="https://github.com/pnedev/nppgtags/blob/master/README.md#----nppgtags----" rel="nofollow ugc">NppGTags</a> - I have not used this other than to test.  I believe it’s more like TagLEET in that it does in-text navigation of tags.  I believe there is a docking panel, but I think that just shows possible tags based on current word, not a full list.  I could be mistaken.</p>
<p dir="auto">I use TagLEET (obviously) and now that SourceCookifier is back for 64-bit (finally!!!) - I’ll use that once in a while.  The nice bit about SourceCookifier is it can act on all open files, not just the current one.  So in that respect, it can help more with larger projects of multiple files (where TagLEET helps with navigation as well).</p>
<p dir="auto">Cheers.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/82645</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/82645</guid><dc:creator><![CDATA[Michael Vincent]]></dc:creator><pubDate>Wed, 21 Dec 2022 18:22:54 GMT</pubDate></item><item><title><![CDATA[Reply to Help Adding Pascal to Function List on Wed, 21 Dec 2022 16:01:17 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/james-richters" aria-label="Profile: James-Richters">@<bdi>James-Richters</bdi></a>,</p>
<blockquote>
<p dir="auto">I have 267 declarations before I get to the first real function.</p>
</blockquote>
<p dir="auto">I’m not aware of <em>any</em> builtin function parser that can distinguish declarations from implementations. That would require context awareness; all they can really do is match words.</p>
<p dir="auto">You may want to try a plugin that parses <em>tags</em> instead. <a href="https://bitbucket.org/uph0/sourcecookifier/src/master/sourcecookifier/README.TXT" rel="nofollow ugc">SourceCookifier</a> (v0.10) is the most user-friendly since it bundles a <a href="https://ctags.io" rel="nofollow ugc">ctags</a> binary to generate the tags for you.</p>
<p dir="auto"><img src="/assets/uploads/files/1671638117496-sourcecookifier-0.10-x64.png" alt="sourcecookifier-0.10-x64.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">If you don’t mind generating your own tag files, there are plenty of tag viewer plugins as well, e.g.,</p>
<ul>
<li><a href="https://github.com/d0vgan/TagsView#tagsview" rel="nofollow ugc">TagsView</a></li>
<li><a href="https://github.com/vinsworldcom/nppTagLEET#notepad-tag-leet-inline-ctags-viewer" rel="nofollow ugc">TagLEET</a></li>
<li><a href="https://github.com/pnedev/nppgtags/blob/master/README.md#----nppgtags----" rel="nofollow ugc">NppGTags</a></li>
</ul>
]]></description><link>https://community.notepad-plus-plus.org/post/82643</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/82643</guid><dc:creator><![CDATA[rdipardo]]></dc:creator><pubDate>Wed, 21 Dec 2022 16:01:17 GMT</pubDate></item><item><title><![CDATA[Reply to Help Adding Pascal to Function List on Wed, 21 Dec 2022 12:45:00 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/james-richters" aria-label="Profile: James-Richters">@<bdi>James-Richters</bdi></a> said in <a href="/post/82632">Help Adding Pascal to Function List</a>:</p>
<blockquote>
<p dir="auto">The second thing I’m not sure how to do is eliminate the duplicates caused by the declaration in a Unit.   everything between<br />
Interface<br />
And<br />
Implementation<br />
should be ignored, as those are not the actual functions and procedures, they are just a declaration of things that need to be accessible by other units or the main program.</p>
</blockquote>
<p dir="auto">This is not working in Pascal, so I have duplicates of all the declarations.  Almost everything I work in is in Units and require the declaration.</p>
<p dir="auto">Here is an example,  I have 267 declarations before I get to the first real function.</p>
<p dir="auto"><img src="/assets/uploads/files/1671626121294-screenshot-2022-12-21-073024.png" alt="Screenshot 2022-12-21 073024.png" class=" img-fluid img-markdown" /></p>
<p dir="auto"><img src="/assets/uploads/files/1671626549079-screenshot-2022-12-21-074123.png" alt="Screenshot 2022-12-21 074123.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.notepad-plus-plus.org/post/82640</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/82640</guid><dc:creator><![CDATA[James Richters]]></dc:creator><pubDate>Wed, 21 Dec 2022 12:45:00 GMT</pubDate></item></channel></rss>