This did the trick. Thanks, Darren.

I have attached a plist file that (at least for my needs) works perfectly.

I chose the <key>Function Pattern</key> contents among several that 
good-old ChatGPT suggested. Excellent tip, Rich.

I'll appreciate any suggestions for improvement.

So far, so good.

Alfredo

On Wednesday, June 19, 2024 at 6:31:41 AM UTC-6 Darren Duncan wrote:

> A key trick to deal with the entity encoding issues is use a CDATA block, 
> like this:
>
> <key>Function Pattern</key>
> <string><![CDATA[(?xs:
> ...
> )]]></string>
>
> Where you replace the ... with the pattern you wanted, which can also be 
> spread 
> across multiple lines for readability.
>
> Inside CDATA you don't need to use XML/HTML entities like &lt;, you just 
> write 
> your less-thans normally etc.
>
> -- Darren Duncan
>
> On 2024-06-18 12:28 p.m., Alfredo wrote:
> > Excellent suggestion, Rich.
> > 
> > I'm playing around with various of our mutual robot friend's proposals.
> > 
> > One of them looks promising:
> > 
> > <key>Function Pattern</key>
> > <string>\b(?:void|[\w<>\[\]]+)\s+(\w+)\s*\([^)]*\)\s*(?=\{|\=>)</string>
> > 
> > But the syntax checker complains about the "<" in
> > 
> > [\w<>\[\]]
> > 
> > Unencoded entity found; “<” needs to be encoded as “&lt;”
> > 
> > Fair enough. If I change the pattern to this:
> > 
> > <key>Function Pattern</key>
> > 
> <string>\b(?:void|[\w&lt;>\[\]]+)\s+(\w+)\s*\([^)]*\)\s*(?=\{|\=>)</string>
> > 
> > the syntax checker doesn't complain but BBEdit's Function Navigator 
> doesn't 
> > navigate functions (after a BBEdit restart, of course).
>
>

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or believe that the application isn't working correctly, please email 
"[email protected]" rather than posting here. Follow @bbedit on Mastodon: 
<https://mastodon.social/@bbedit>
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/cfdfe0b6-cb88-49a9-9bcb-774f4a2a9423n%40googlegroups.com.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
    "http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
<plist version="1.0">
<dict>
    <key>BBEditDocumentType</key>
    <string>CodelessLanguageModule</string>

    <key>BBLMLanguageDisplayName</key>  <string>Dart</string>
    <key>BBLMLanguageCode</key>         <string>Dart</string>

    <key>BBLMCommentLineDefault</key>
    <string>// </string>
    <key>BBLMCommentPrefixDefault</key>
    <string>/*</string>
    <key>BBLMCommentSuffixDefault</key>
    <string>*/</string>
    <key>BBLMColorsSyntax</key>
    <true/>
    <key>BBLMScansFunctions</key>
    <true/>
    <key>BBLMIsCaseSensitive</key>
    <true/>
    <key>BBLMKeywordList</key>
    <array>
    <!--
        c# keywords
    -->
        <string>abstract</string>
        <string>as</string>
        <string>assert</string>
        <string>async</string>
        <string>await</string>
        <string>base</string>
        <string>break</string>
        <string>case</string>
        <string>catch</string>
        <string>class</string>
        <string>const</string>
        <string>continue</string>
        <string>covariant</string>
        <string>default</string>
        <string>deferred</string>
        <string>do</string>
        <string>dynamic</string>
        <string>else</string>
        <string>enum</string>
        <string>export</string>
        <string>extends</string>
        <string>extension</string>
        <string>external</string>
        <string>factory</string>
        <string>false</string>
        <string>final</string>
        <string>finally</string>
        <string>for</string>
        <string>Function</string>
        <string>get</string>
        <string>hide</string>
        <string>if</string>
        <string>implements</string>
        <string>import</string>
        <string>in</string>
        <string>interface</string>
        <string>is</string>
        <string>late</string>
        <string>library</string>
        <string>mixin</string>
        <string>new</string>
        <string>null</string>
        <string>of</string>
        <string>on</string>
        <string>operator</string>
        <string>part</string>
        <string>required</string>
        <string>rethrow</string>
        <string>return</string>
        <string>sealed</string>
        <string>set</string>
        <string>show</string>
        <string>static</string>
        <string>super</string>
        <string>switch</string>
        <string>sync</string>
        <string>this</string>
        <string>throw</string>
        <string>true</string>
        <string>try</string>
        <string>type</string>
        <string>typedef</string>
        <string>var</string>
        <string>void</string>
        <string>when</string>
    <!--
        Dart contextual keywords
    -->
    </array>
    <key>BBLMSuffixMap</key>
    <array>
    <dict>
        <key>BBLMLanguageSuffix</key>
        <string>.dart</string>
    </dict>
    </array>

    <key>Language Features</key>
    <dict>
        <key>Comment Pattern</key>
           <string><![CDATA[(?xs:
			  (//.*$)        |
			  (?s:/\*.*?\*/)
           )]]></string>

        <key>Function Pattern</key>
        <string><![CDATA[(?xs:
        \b(?:void|[\w<>\[\]]+)\s+(\w+)\s*\([^)]*\)\s*(?=\{|\=>)
        )]]></string>

        <key>Identifier and Keyword Character Class</key>
        <string><![CDATA[
        0-9A-Z_a-z
        ]]></string>
        <key>Skip Pattern</key>
        <string><![CDATA[
        (?x: (?> (?P>comment) | (?P>string) ) )
        ]]></string>
        <key>String Pattern</key>
        <string><![CDATA[
        (?x: (?>    "   (?s: \\. | [^"] )*? (?: " | $)  )   | (?>   '   (?s: \\. | [^'] )*? (?: ' | $)  )   | (?>   @   (?: " (?s: .*?) " )+ ) )
        ]]></string>
    </dict>
</dict>
</plist>

Reply via email to