<?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[Open Modelica user language]]></title><description><![CDATA[<p dir="auto">Hello,<br />
I am quite new here, I am trying to create a UDL for OpenModelica language. I can do the basics with the user language creation tool, but I want to add something to finish the UDL. I need to highlight every function name like : acos(x) or myfunction(test). acos and myfunction should be highlighted.<br />
I also found that the erlang language do that well. So I looked at the UDL usermanual and I tried to change the udl.xml file outside the UDL editor.  In the stylers.xml, in the erlang section this line seems to do the trick :</p>
<pre><code>&lt;WordsStyle name="FUNCTION NAME" styleID="8" fgColor="00007f" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" /&gt;
</code></pre>
<p dir="auto">Unfortunately,  I did not manage to make this line work in my UDL.</p>
<p dir="auto">I also tried to add a new language directly inside the langs.xml and the stylers.xml, but my new language only appear in the Settings &gt; Style Configurator and not in the Language menu.</p>
<p dir="auto">Did I miss something ? It’s quite frustrating, everything is working but the function name…</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/19117/open-modelica-user-language</link><generator>RSS for Node</generator><lastBuildDate>Wed, 11 Nov 2026 12:14:20 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/19117.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 27 Mar 2020 10:49:31 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Open Modelica user language on Fri, 27 Mar 2020 13:30:00 GMT]]></title><description><![CDATA[<p dir="auto">I said,</p>
<blockquote>
<p dir="auto">have parentheses (acos(x)), you need Prefix Mode enabled</p>
</blockquote>
<p dir="auto">Sorry; something felt odd about that, so I did more experimenting.  If you followed that advice, and had a third function defined <code>multiarg</code>, which would be used like <code>multiarg(a, b, c)</code> in your code, only the <code>multiarg(a,</code> would be highlighted, which would be just weird.  The right way to handle parentheses: turn off the Prefix Mode (don’t need it anymore); go to the <strong>Operators &amp; Delimiters</strong>; here, you have two choices:</p>
<ul>
<li>if you want the parens highlighted, but the stuff between <em>not</em> highlighted, then put <code>(</code> and <code>)</code> inside the <strong>Operators 1</strong> box (space-separated list).  It would then render like the following (where I chose green as the style):<br />
<img src="/assets/uploads/files/1585315489050-95c0cf03-2de4-4f73-a188-085120836cbc-image.png" alt="95c0cf03-2de4-4f73-a188-085120836cbc-image.png" class=" img-fluid img-markdown" /><br />
See that the function names are red, the parens are green, and the args are default (black)</li>
<li>if you want the parens and the stuff between highlighted instead, then choose an unused <strong>Delimiter #</strong> style (I chose #1 and set it to Blue), with <strong>Open</strong> = <code>(</code> and <strong>Close</strong> = <code>)</code>.  This will show up as:<br />
<img src="/assets/uploads/files/1585315621651-24deabab-0fd6-42a7-a28c-804da559dfcb-image.png" alt="24deabab-0fd6-42a7-a28c-804da559dfcb-image.png" class=" img-fluid img-markdown" /><br />
See that the function name is still red, the parens and arguments and commas are blue.</li>
</ul>
<p dir="auto">The <strong>Prefix Mode</strong> setting would allow you to write something like <strong>open</strong> in the list, and every function that started with <code>open</code>, like <code>openFile</code>, <code>openDoor</code>, and <code>openSesame</code> would all be highlighted with that one entry of <code>open</code>.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/51784</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/51784</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Fri, 27 Mar 2020 13:30:00 GMT</pubDate></item><item><title><![CDATA[Reply to Open Modelica user language on Fri, 27 Mar 2020 13:18:40 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/darthmoule" aria-label="Profile: DarthMoule">@<bdi>DarthMoule</bdi></a> ,</p>
<p dir="auto">User Defined Languages (UDL) do not use the Style Configurator, <code>stylers.xml</code>, or <code>langs.xml</code>; only builtin languages use those.  Erlang is a language that uses a builtin lexer, not the UDL, which is why its configuration is stored in langs and stylers.  You cannot use it as an example for your UDL.</p>
<p dir="auto">For syntax highlighting of UDL, you can affect every highlighting setting and option available through the <strong>Language &gt; User Defined Language &gt; Define Your Language</strong> menu entry (or <strong>Language &gt; Define Your Language</strong> on older Notepad++ versions), or in the <code>userDefineLang.xml</code> (old-style, but still works) or in the separate xml files in the <code>userDefineLangs</code> subdirectory.  Since you are a beginner at UDL, it’s going to be easiest for you to just use the GUI, rather than trying to find and edit config files manually.</p>
<p dir="auto">For your UDL, assuming you’ve already named the UDL (which I assume, because you claim you already used the language creation tool).  Now, to define lists of keywords (like function names), you would:</p>
<ol>
<li>run the <strong>… Define Your Language</strong> menu entry to bring up the <strong>User Defined Language</strong> dialog box (or docked pane)</li>
<li>select your UDL from the dropdown</li>
<li>click on the <strong>Keywords List</strong></li>
<li>Go into one of the numbered groups (your choice), and you type the keywords as a space-separated list</li>
<li>Since you want it to highlight, even when you have parentheses (<code>acos(x)</code>), you need <strong>Prefix Mode</strong> enabled</li>
<li>Click on the <strong>Styler</strong> button for the specific group of keywords</li>
<li>Pick the color and other formatting rules</li>
<li>Right now, your file doesn’t apply the UDL highlighting.  Go to <strong>Language &gt; OpenModelica</strong> to apply the UDL highlighting to the active document</li>
<li>If you set an extension list in the <strong>Ext</strong> box – a space-separated list of the extensions, without the dots – then Notepad++ will automatically apply this UDL to files with those extensions when you open them.
<ul>
<li>For example, if you have two files, <code>first.omod</code> and <code>second.om</code> (*) which you want to automatically get OpenModelica highlighting the next time you open them, you would set <strong>Ext</strong> to <code>omod om</code>.  (*: I don’t know the OpenModelica file extension(s), so made an example guess)</li>
</ul>
</li>
</ol>
<p dir="auto"><img src="/assets/uploads/files/1585314514063-609326fd-f70d-48db-81b1-33ad002a73e1-image.png" alt="609326fd-f70d-48db-81b1-33ad002a73e1-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Docs:</p>
<ul>
<li><a href="https://npp-user-manual.org/docs/user-defined-language-system/" rel="nofollow ugc">https://npp-user-manual.org/docs/user-defined-language-system/</a> – about the dialog box, file locations, and config file contents</li>
<li><a href="https://ivan-radic.github.io/udl-documentation/" rel="nofollow ugc">https://ivan-radic.github.io/udl-documentation/</a> – the nuts and bolts of what each setting will do</li>
</ul>
]]></description><link>https://community.notepad-plus-plus.org/post/51783</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/51783</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Fri, 27 Mar 2020 13:18:40 GMT</pubDate></item></channel></rss>