<?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[Is it possible to have a * as an operator and as a comment?]]></title><description><![CDATA[<p dir="auto">How do I prevent the two from conflicting?</p>
<p dir="auto">For example, if I do 10 * 10 | After the * symbol it will comment instead of being an operator.</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/21718/is-it-possible-to-have-a-as-an-operator-and-as-a-comment</link><generator>RSS for Node</generator><lastBuildDate>Tue, 19 May 2026 09:21:36 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/21718.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 23 Aug 2021 13:32:08 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Is it possible to have a * as an operator and as a comment? on Mon, 23 Aug 2021 15:15:15 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/cll142" aria-label="Profile: cll142">@<bdi>cll142</bdi></a> ,</p>
<p dir="auto">Please note that UDL is not an infinitely-configurable solution; there are times that your desired styling for a language goes beyond what UDL can offer.</p>
<p dir="auto">At that point, your choices are to <a href="https://npp-user-manual.org/docs/plugins/#building-a-lexer-plugin" rel="nofollow ugc">write a full lexer plugin</a> which can be distributed as a DLL or through the Plugins Admin; if that’s beyond your scope, you might get the extra highlighting you want by using the Python Script plugin and the script <code>EnhanceAnyLexer.py</code> that <a class="plugin-mentions-user plugin-mentions-a" href="/user/ekopalypse" aria-label="Profile: Ekopalypse">@<bdi>Ekopalypse</bdi></a> shares <a href="https://github.com/Ekopalypse/NppPythonScripts/blob/master/npp/EnhanceAnyLexer.py" rel="nofollow ugc">in his github repo</a>, which allows you to add extra highlighting to a builtin lexer (like the HTML lexer) <em>or</em> to a User Defined Language (UDL) using regexes.</p>
<p dir="auto">So if you cannot get the UDL “good enough”, do as much as you can, then try Eko’s script.  If that still doesn’t cover your needs, writing a lexer plugin is the next option.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/69197</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/69197</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Mon, 23 Aug 2021 15:15:15 GMT</pubDate></item><item><title><![CDATA[Reply to Is it possible to have a * as an operator and as a comment? on Mon, 23 Aug 2021 15:11:45 GMT]]></title><description><![CDATA[<p dir="auto">… actually, you’ll probably not want the <code>"</code> to <code>((EOL))</code> on the right-side “comment style” at all, since you have it as a delimiter already.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/69196</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/69196</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Mon, 23 Aug 2021 15:11:45 GMT</pubDate></item><item><title><![CDATA[Reply to Is it possible to have a * as an operator and as a comment? on Mon, 23 Aug 2021 15:04:41 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/cll142" aria-label="Profile: cll142">@<bdi>cll142</bdi></a> ,</p>
<p dir="auto">That’s because you changed what I showed.</p>
<p dir="auto">In the right <strong>comment  style</strong> box, I had a <code>"</code>, <em>not</em> a <code>*</code>.  If you use the right comment style with an asterisk, then always and anywhere, asterisk-to-end-of-line is a comment, which is not what you want.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/69195</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/69195</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Mon, 23 Aug 2021 15:04:41 GMT</pubDate></item><item><title><![CDATA[Reply to Is it possible to have a * as an operator and as a comment? on Mon, 23 Aug 2021 14:42:24 GMT]]></title><description><![CDATA[<p dir="auto">The built in feature doesn’t seem to be working. Even when I use force at beginning of line or allow preceding whitespace. It seems to comment out instead of being an operator.<br />
<img src="/assets/uploads/files/1629729597810-292d2255-6d95-4229-84b4-8173e3fa5220-image.png" alt="292d2255-6d95-4229-84b4-8173e3fa5220-image.png" class=" img-fluid img-markdown" /><br />
<img src="/assets/uploads/files/1629729676792-daead771-5a30-484d-b304-7df312d1d323-image.png" alt="daead771-5a30-484d-b304-7df312d1d323-image.png" class=" img-fluid img-markdown" /> <img src="/assets/uploads/files/1629729559270-0aa7db6d-a9be-4e04-855c-e544a7ac591a-image.png" alt="0aa7db6d-a9be-4e04-855c-e544a7ac591a-image.png" class=" img-fluid img-markdown" /><br />
<img src="/assets/uploads/files/1629729618916-dd3dbaea-f517-4337-bacd-245cc2ad567a-image.png" alt="dd3dbaea-f517-4337-bacd-245cc2ad567a-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.notepad-plus-plus.org/post/69194</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/69194</guid><dc:creator><![CDATA[cll142]]></dc:creator><pubDate>Mon, 23 Aug 2021 14:42:24 GMT</pubDate></item><item><title><![CDATA[Reply to Is it possible to have a * as an operator and as a comment? on Mon, 23 Aug 2021 13:57:30 GMT]]></title><description><![CDATA[<p dir="auto">Please note that if you choose <code>force at beginning of line</code> rather than <code>allow preceding whitespace</code>, it should mostly work for the ABAP comments… but if you have a comment-line as the first line, it won’t always recognize that as a comment, whereas <code>allow preceding whitespace</code> will more reliably recognize it.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/69189</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/69189</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Mon, 23 Aug 2021 13:57:30 GMT</pubDate></item><item><title><![CDATA[Reply to Is it possible to have a * as an operator and as a comment? on Mon, 23 Aug 2021 13:54:29 GMT]]></title><description><![CDATA[<p dir="auto">… and with your slew of questions, I am assuming you will soon ask how to get the quote-to-end-of-line version of comments as well:<br />
<img src="/assets/uploads/files/1629726868621-b76a5086-016f-4349-9aed-3e4d3b197fc9-image.png" alt="b76a5086-016f-4349-9aed-3e4d3b197fc9-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.notepad-plus-plus.org/post/69188</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/69188</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Mon, 23 Aug 2021 13:54:29 GMT</pubDate></item><item><title><![CDATA[Reply to Is it possible to have a * as an operator and as a comment? on Mon, 23 Aug 2021 13:44:00 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/cll142" aria-label="Profile: cll142">@<bdi>cll142</bdi></a></p>
<p dir="auto">I assume this is another UDL question.  It’s better to be explicit, so we don’t have to guess.</p>
<p dir="auto">How does your language distinguish between a <code>*</code> that means “multiply” and a <code>*</code> that means “start a comment”?</p>
<p dir="auto">I don’t know your language, but how would it tell the difference between</p>
<pre><code>a = 5 * 15
</code></pre>
<p dir="auto">and</p>
<pre><code>a = 5 * 15
</code></pre>
<p dir="auto">where the first is supposed to have <code>* 15</code> be a comment and in the second, the <code>* 15</code> is supposed to be multiplication?</p>
<p dir="auto">Okay, assuming this is still <code>ABAP</code> from before, I just did a quick search on “ABAP comments” and found <a href="https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abencomment.htm" rel="nofollow ugc">this</a>… if I skimmed that correctly, <code>*</code> only indicates a comment at the start of a line.  That makes it easier, and there is a feature built into Notepad++'s UDL to work with that.</p>
<p dir="auto">That’s why <strong>Comment &amp; Number</strong> has a <strong>Comment line style</strong> with the <strong>line comment position</strong> – set it to “Allow preceding whitespace”, which means that the <code>*</code> has to be the first non-space character on the line.</p>
<p dir="auto"><img src="/assets/uploads/files/1629725978195-07983ce9-27dd-4518-8bc7-d663ea660607-image.png" alt="07983ce9-27dd-4518-8bc7-d663ea660607-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto"><em>Please notice: we cannot be expected to be experts in every possible programming language; if you had given examples of comments vs multiplication, it would have been much easier to help you; as it was, I was willing to do a 30second google to get the answer, but if you really want help, you should have supplied the information to begin with.</em></p>
<p dir="auto">If you are going to be using UDL, it would behoove you to follow the link on the first page of the UDL dialog and read the documentation that Ivan Radić provided; it gives a great practical overview of how to use UDL, and what each of the entry blanks mean.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/69184</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/69184</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Mon, 23 Aug 2021 13:44:00 GMT</pubDate></item></channel></rss>