BBEdit LassoScript Codeless Language Module
 
Introduction

This article contains instructions on how to enable LassoScript syntax coloring in BBEdit 8.5.x and how to use AppleScript to switch language modes between LassoScript, HTML and JavaScript.

This codeless language module is designed to work with both the LassoScript <?lassoscript ?> and square-bracket [] syntaxes for Lasso Professional 8.5.1.

Filenames must end with ".lasso", ".las" or ".inc". You can modify the file "LassoScript.plist" to include other file suffixes.

The BBLMKeywordList is current as of Lasso Professional 8.5.1. To update the BBLMKeywordList, edit "LassoScript.plist" as specified in this message on LassoTalk: Subject: List of all LDML tags and keywords.

I modified the SQL statement from that message as shown below. I use BBEdit to strip square brackets, extra spaces, and the ... for matching container tags. Once I get my result modified, I paste it into my plist and use BBEdit's Text > Process Duplicate Lines command to remove duplicate keywords.

Begin by going to the LassoAdmin database browser: http://localhost/DatabaseBrowser.0.LassoApp?tab1=browse&tab2=sql

Use the following search parameters (blanks are irrelevant) and SQL statement:

Datasource: Lasso Connector for SQL Lite
Host: Internal
Database: LDML8_Reference
History: 
SQL Statement:
SELECT tag_name FROM tags ORDER BY tag_sort;
SELECT DISTINCT param_name FROM parameters WHERE param_name LIKE "-%" ORDER BY param_name;
SELECT DISTINCT param_value FROM parameters WHERE param_value LIKE "-%" ORDER BY param_value;

Show Fields: 
Max Records: All
Max Field Lines: 
Submit on Return: No

Complete information on writing Codeless Language Modules can be found in Appendix D of the BBEdit manual.

Instructions
  1. Download BBEditLDML.zip (28 Kb Last updated Jan 1, 2007.)
  2. Unzip the downloaded file.
  3. Backup and remove all other LDML Language Modules from:
    "~/Library/Application Support/BBEdit/Language Modules"
    This avoids possible conflicts.
  4. Move the file
    "BBEditLDML/Language Modules/LassoScript.plist"
    to
    "~/Library/Application Support/BBEdit/Language Modules"
  5. Move the folder
    "BBEditLDML/Scripts/06)Set Language to/"
    and its contents to
    "~/Library/Application Support/BBEdit/Scripts/"
  6. Restart BBEdit. This will load the new .plist and AppleScripts. Next you configure BBEdit to use these items.
  7. In BBEdit, select BBEdit > Preferences > Languages > Suffix Mappings. Map the file suffixes that you want to have lasso syntax highlighting to the appropriate language module. You might need to Add... or Change... file suffixes. I recommend mapping ".lasso", ".las" and ".inc". For each suffix, set the name of the suffix, set the language to "Lasso Script", and select the radio button for "Source File".
  8. Under the Scripts menu (the funny scroll icon shaped like an "S"), select Set Language to > LDML.
  9. You can set keyboard shortcuts for these scripts to easily switch language modes. Select Window > Palettes > Scripts. Expand Set Language to. Select HTML. Click Set Key... . I use ^H (CTRL-H) for HTML, and ^L for LDML.
  10. Create a new file, name it "test.lasso", set the language to LDML, and syntax coloring should work.

Use at your own risk!

 

Updates, suggestions and comments regarding this article may be sent to Steve Piercy, web@stevepiercy.com.