<?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[FunctionList not working for UDL]]></title><description><![CDATA[<p dir="auto">I have a custom UDL syntax highlighting for CNC g-code and am trying to get the function list to populate for this.  I am not even sure if it is trying to create the FunctionList for it though.  It isn’t showing the filename or anything in the FunctionList window.  I did check and at least a python file sample did work.  So at least the built in ones are working.</p>
<p dir="auto">Debug info:</p>
<pre><code>Notepad++ v8.6.5   (64-bit)
Build time : Mar 29 2024 - 17:04:43
Path : C:\Program Files\Notepad++\notepad++.exe
Command Line : 
Admin mode : OFF
Local Conf mode : OFF
Cloud Config : OFF
Periodic Backup : ON
OS Name : Windows 10 Pro (64-bit
OS Version : 22H2
OS Build : 19045.4170
Current ANSI codepage : 1252
Plugins : 
    ComparePlugin (2.0.2)
    HexEditor (0.9.12)
    mimeTools (3.1)
    NCneticNpp (1)
    NppConverter (4.6)
    NppExec (0.8.2)
    NppExport (0.4)
    NppToolBucket (1.10.6622.41516)
    SQLinFormNpp64 (5.3.35)
    XMLTools (3.1.1.13)
</code></pre>
<p dir="auto">In %appdata%\notepad++\functionList<br />
overrideMap.xml I added after the other UDL samples</p>
<pre><code>&lt;association id= "G-Code_PMC.xml"   userDefinedLangName= "GCode PMC" /&gt;
</code></pre>
<p dir="auto">In %appdata%\notepad++\functionList\ I created G-Code_PMC.xml<br />
I want to match the entire lines for the two regex.</p>
<pre><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
&lt;NotepadPlus&gt;
	&lt;functionList&gt;
		&lt;!-- GCode_PMC - Computer Numeric Control Syntax for use at PMC                              --&gt;

		&lt;parser displayName="GCode PMC"  
						id="gcodepmc_function"
						&lt;!-- commentExpr="(?s:/\*.*?\*/)|(?m-s://.*?$)" --&gt;
		&gt;
			&lt;function
				mainExpr="(?x)                                     # Utilize inline comments (see `RegEx - Pattern Modifiers`)
					  ^(?im-s:[O:]\d+.*$)	             # Program number and comment
					| ^(?im-s:\s*\(\s*INDEX.*\s*\)	     # Tool change Comment line
					"
			/&gt;
		&lt;/parser&gt;
	&lt;/functionList&gt;
&lt;/NotepadPlus&gt;
</code></pre>
<p dir="auto">A trimmed down sample file of the CNC g-code<br />
This is recognized and working with my style UDL “GCode PMC”<br />
I’m only looking to match the O#### line and ( INDEX TO… ) lines  But ANY matching would be a start.</p>
<pre><code>%
O9332 (TESTCODE.M08)

N0010
#619=0010
( INDEX TO B0. -- T11 40-0652 FACEMILL 2.000 X 90 ALUM - CAT 40, ENDMILL  EXT LENGTH 1.500   )
T11
M6
...

N0020
#619=0020
( INDEX TO B0. -- T12 40-0733 TD 0.2500  :S - "CAT 40, ER-20 X2.5"  EXT LENGTH 1.880   )
T12
M6
...

N0030
#619=0030
( INDEX TO B0. -- T13 41-3812 EM 0500 :1FL - CAT 40 SHORT ER-20 HOLDER  EXT LENGTH 1.750   )
T13
M6
...

G90 G0 Z14.0 M09
( TOTAL TIME =29:22.7   MIN. )
M30
%
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/topic/25783/functionlist-not-working-for-udl</link><generator>RSS for Node</generator><lastBuildDate>Wed, 18 Nov 2026 01:39:32 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/25783.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 15 May 2024 20:50:19 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to FunctionList not working for UDL on Fri, 17 May 2024 13:50:31 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/grether2000" aria-label="Profile: Grether2000">@<bdi>Grether2000</bdi></a> said in <a href="/post/94861">FunctionList not working for UDL</a>:</p>
<blockquote>
<p dir="auto">I’ll need to add some other matches for other machines and their comment formats.</p>
</blockquote>
<p dir="auto">When you’ve got it working, feel free to submit your UDL and its FunctionList to the <a href="https://github.com/notepad-plus-plus/userDefinedLanguages/" rel="nofollow ugc">UDL Collection</a> – right now, it doesn’t have a section for FunctionList, but since FunctionLists can be associated with UDLs, I think it makes sense to add a folder to house them.</p>
<p dir="auto">-–</p>
<p dir="auto"><em>Update:</em> The UDL Collection repo now has the functionList folder, and has the attributes and validators necessary to handle Function List definitions for the UDLs as well.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/94862</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/94862</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Fri, 17 May 2024 13:50:31 GMT</pubDate></item><item><title><![CDATA[Reply to FunctionList not working for UDL on Thu, 16 May 2024 18:33:00 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!<br />
This solved the problem.<br />
I wasn’t sure it was even working for a while, that was causing me to pull my hair out looking for the cause.  After all it was just a stupid mistake with not removing parts I didn’t need.<br />
Now that I have it working I can make any adjustments to the regex.  I’ll need to add some other matches for other machines and their comment formats.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a> Thank you as well.<br />
Yes the O or : are valid.<br />
Your examples give me a few suggestions on ways to improve this for how the code can get created, or saved after use.  These are actually comments, and not functions.  But it is how we document and organize the code by the tooling used.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/94861</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/94861</guid><dc:creator><![CDATA[Grether2000]]></dc:creator><pubDate>Thu, 16 May 2024 18:33:00 GMT</pubDate></item><item><title><![CDATA[Reply to FunctionList not working for UDL on Thu, 16 May 2024 16:54:54 GMT]]></title><description><![CDATA[<p dir="auto">Hello, <a class="plugin-mentions-user plugin-mentions-a" href="/user/grether2000" aria-label="Profile: grether2000">@<bdi>grether2000</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: peterjones">@<bdi>peterjones</bdi></a> and <strong>All</strong>,</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/grether2000" aria-label="Profile: grether2000">@<bdi>grether2000</bdi></a>, I suppose that you can <strong>simplify</strong> the <strong><code>G-Code_PMC.xml</code></strong> file as below :</p>
<pre><code class="language-xml">&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
&lt;NotepadPlus&gt;
    &lt;functionList&gt;
        &lt;!-- GCode_PMC - Computer Numeric Control Syntax for use at PMC --&gt;
        &lt;parser
            displayName="GCode PMC"
            id         ="gcodepmc_function"
        &gt;
            &lt;function
                mainExpr=
                "(?x)                                     # See 'RegEx - Pattern Modifiers'
                    (?-s)^[O:]\d+.*                       # Program number and comment
                    |                                     # OR
                    (?-is)^[\t\x20]*\([\t\x20]*INDEX.*\)  # Tool change Comment line
                "
            &gt;
            &lt;/function&gt;
        &lt;/parser&gt;
    &lt;/functionList&gt;
&lt;/NotepadPlus&gt;
</code></pre>
<hr />
<p dir="auto">Now :</p>
<ul>
<li>If <strong>all</strong> your lines, which contain the <strong><code>INDEX</code></strong> string, are of the form <strong><code>  (  INDEX ......)</code></strong></li>
</ul>
<p dir="auto">AND</p>
<ul>
<li>IF <strong>all</strong> your lines, beginning with an <strong><code>O</code></strong> <strong>uppercase</strong> letter, are followed with a <strong>number</strong></li>
</ul>
<p dir="auto">you may even use these <strong>less restrictive</strong> regexes :</p>
<pre><code class="language-xml">&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
&lt;NotepadPlus&gt;
    &lt;functionList&gt;
        &lt;!-- GCode_PMC - Computer Numeric Control Syntax for use at PMC --&gt;
        &lt;parser
            displayName="GCode PMC"
            id         ="gcodepmc_function"
        &gt;
            &lt;function
                mainExpr=
                "(?x)                 # See 'RegEx - Pattern Modifiers'
                    (?-s)^[O:].*      # Program number and comment
                    |                 # OR
                    (?-is)^.*INDEX.*  # Tool change Comment line
                "
            &gt;
            &lt;/function&gt;
        &lt;/parser&gt;
    &lt;/functionList&gt;
&lt;/NotepadPlus&gt;
</code></pre>
<hr />
<p dir="auto">I’m also wondering about the <strong>colon</strong> character within the regex for the <strong><code>Program number and comment</code></strong> rule :</p>
<p dir="auto">Do you mean that the line <strong><code>:9332 (TESTCODE.M08)</code></strong> can be a <strong>legal</strong> line ?</p>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
<p dir="auto"><strong>PS</strong> :</p>
<ul>
<li>For my tests, I <strong>simply</strong> linked the <strong><code>G-Code_PMC.xml</code></strong> file to the <strong><code>None (Normal Text)</code></strong> language, by <strong>default</strong>, with the following line in the <strong><code>overrideMap.xml</code></strong> file</li>
</ul>
<pre><code class="language-xml">            &lt;association id="G-Code_PMC.xml" langID="0" /&gt;
</code></pre>
<ul>
<li>I tried to get information about <strong><code>G-Code</code></strong> from this site :</li>
</ul>
<p dir="auto"><a href="https://linuxcnc.org/docs/html/gcode/overview.html" rel="nofollow ugc">https://linuxcnc.org/docs/html/gcode/overview.html</a></p>
]]></description><link>https://community.notepad-plus-plus.org/post/94860</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/94860</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Thu, 16 May 2024 16:54:54 GMT</pubDate></item><item><title><![CDATA[Reply to FunctionList not working for UDL on Wed, 15 May 2024 23:57:36 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/grether2000" aria-label="Profile: Grether2000">@<bdi>Grether2000</bdi></a>,</p>
<p dir="auto">I pared it back to bare-bones, then slowly built it up close to yours</p>
<p dir="auto"><img src="/assets/uploads/files/1715817245748-775437c7-8f0f-4360-8a16-2e80aac26054-image.png" alt="775437c7-8f0f-4360-8a16-2e80aac26054-image.png" class=" img-fluid img-markdown" /></p>
<pre><code class="language-xml">&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
&lt;NotepadPlus&gt;
    &lt;functionList&gt;
		&lt;!-- GCode_PMC - Computer Numeric Control Syntax for use at PMC                              --&gt;
        &lt;parser
            displayName="GCode PMC"
            id         ="gcodepmc_function"
        &gt;
            &lt;function
                mainExpr="(?x)								# Utilize inline comments (see `RegEx - Pattern Modifiers`)
					^(?im-s:[O:]\d+.*$)						# Program number and comment
					|
					^(?im-s:\s*.*INDEX.*$)						# Tool change Comment line
				"
            &gt;
                &lt;functionName&gt;
                    &lt;nameExpr expr="(?x)					# Utilize inline comments (see `RegEx - Pattern Modifiers`)
						^(?im-s:[O:]\d+.*$)					# Program number and comment
						|
						^(?im-s:\s*\(\s*.*INDEX.*\))		# Tool change Comment line
				"/&gt;
                &lt;/functionName&gt;
            &lt;/function&gt;
        &lt;/parser&gt;
    &lt;/functionList&gt;
&lt;/NotepadPlus&gt;
</code></pre>
<p dir="auto">One problem was your comment inside the <code>&lt;parser ...&lt;!-- ... --&gt; ... &gt;</code> – XML does not allow a comment nested inside the brackets of a tag like that…</p>
<p dir="auto">There was something subtle in the regex that didn’t let it work as-is (at least for me), so I got it to a functioning point starting from scratch and slowly adding similar features.</p>
<p dir="auto">And I’ve never tried a function without a functionName, so I put that in without ever trying without it.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/94840</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/94840</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Wed, 15 May 2024 23:57:36 GMT</pubDate></item></channel></rss>