Thank you!  This is great. 

Can I bother you for an explanation for the folding part of the pattern?  I 
assume this is the second part of the function pattern (the part named 
‘function’).

On Sun, May 15, 2022, at 5:11 AM, jj wrote:
> Hi Tim,
> 
> Here is an attempt for you special case CLM.
> 
> Save it as ~/Library/Application\ Support/BBEdit/Language\ 
> Modules/free42.plist
> and restart BBEdit.
> 
> You should now have a 'Free42' language module that highlights files with the 
> .free42 extension.
> 
> HTH,
> 
> Jean Jourdain
> 
> --
> 
>     <?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>BBLMColorsSyntax</key>
>         <true/>
>         <key>BBLMIsCaseSensitive</key>
>         <true/>
>         <key>BBLMSupportsTextCompletion</key> 
>         <true/> 
>         <key>BBLMKeywordList</key>
>         <array> 
>             <string>GTO</string> 
>             <string>RTN</string> 
>             <string>LSTO</string> 
>             <string>RCL</string> 
>             <string>END</string>
>             <string>SIGN</string>
>             <string>R</string>
>             <string>XEQ</string>
>         </array> 
>         <key>BBLMLanguageCode</key>
>         <string>FR42</string>
>         <key>BBLMLanguageDisplayName</key>
>         <string>Free42</string>
>         <key>BBLMScansFunctions</key>
>         <true/>
>         <key>BBLMFunctionScannerDoesFoldsToo</key>
>         <true/>
>         <key>BBLMSuffixMap</key>
>         <array>
>             <dict>
>                 <key>BBLMLanguageSuffix</key>
>                 <string>.free42</string>
>             </dict>
>         </array>
>         <key>Language Features</key>
>         <dict>
>             <key>Close Block Comments</key>
>             <false/>
>             <key>Close Statement Blocks</key>
>             <false/>
>             <key>End-of-line Ends Strings 1</key>
>             <false/>
>             <key>End-of-line Ends Strings 2</key>
>             <false/>
>             <key>Escape Char in Strings 1</key>
>             <string>\</string>
>             <key>Escape Char in Strings 2</key>
>             <string>\</string>
>             <key>Identifier and Keyword Character Class</key>
>             <string>\p{Xwd}</string>
>             <key>Open Block Comments</key>
>             <false/>
>             <key>Open Line Comments</key>
>             <false/>
>             <key>Open Statement Blocks</key>
>             <false/>
>             <key>Close Strings 1</key>
>             <false/>
>             <key>Close Strings 2</key>
>             <false/>
>             <key>Open Strings 1</key>
>             <false/>
>             <key>Open Strings 2</key>
>             <false/>
>             <key>String Pattern</key>
>             <string><![CDATA[(?x)
>     ^\d+
>     ]]></string>
>             <key>Function Pattern</key>
>             <string><![CDATA[(?x)(?n)
>                 ^\d+▸LBL\h
>                 (?P<function_name>                
>                     (
>                        "[^"]+?"
>                     |
>                         \d+
>                     )
>                 )
>                 (?P<function>
>                     \h*\n
>                     (\d+\h.+(\n|\z))*
>                     \d+\h.+
>                 )
>     ]]></string>
>         </dict>
>     </dict>
>     </plist>
> --
> On Saturday, May 14, 2022 at 10:36:49 PM UTC+2 Tim Gray wrote:
>> I'm trying to write a codeless language module for an obscure 'language' - 
>> keystroke program listings for an HP42S calculator (or the Free42 program as 
>> the case may be). I think I've got all the keywords and special characters 
>> figured out but am struggling with two things. First, here's a sample 
>> program listing: 
>> 
>> 00 { 37-Byte Prgm } 
>> 01▸LBL "FAC" 
>> 02 X≠0? 
>> 03 GTO 00 
>> 04 SIGN 
>> 05 RTN 
>> 06▸LBL 00 
>> 07 R↑ 
>> 08 LSTO "T" 
>> 09 R↓ 
>> 10 LSTO "N" 
>> 11 1 
>> 12 - 
>> 13 XEQ "FAC" 
>> 14 RCL "N" 
>> 15 × 
>> 16 RCL "T" 
>> 17 R↓ 
>> 18 END 
>> 
>> I'd like to have the 'LBL' lines show up in the function popup with the 
>> correct label ("FAC" or "00"). Code folding for each section would be nice, 
>> but not necessary. I'm not sure the best way to implement this - I tried 
>> "Prefix for Functions" but I'm assuming I need "Function Pattern" instead. 
>> 
>> My second question pertains to the line numbers. The line numbers are often 
>> part of a listing, but are not actually part of the program. I'd like some 
>> way to highlight those if possible. Is that doable in a CLM? The regex is 
>> easy: '^\d+( |▸)' but I don't know if there is anyway to implement it... 
>> 
>> Thanks, 
>> Tim 
>> 
> 
> 
> -- 
> This is the BBEdit Talk public discussion group. If you have a feature 
> request or need technical support, please email "supp...@barebones.com" 
> rather than posting here. Follow @bbedit on Twitter: 
> <https://twitter.com/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 bbedit+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/bbedit/1796707b-1847-485a-93ce-b948255fb795n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/bbedit/1796707b-1847-485a-93ce-b948255fb795n%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "supp...@barebones.com" rather than 
posting here. Follow @bbedit on Twitter: <https://twitter.com/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 bbedit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/471ee87a-19a7-4411-a7cf-02672e0a0641%40beta.fastmail.com.

Reply via email to