I recently started using Sublime Text and I am really enjoying it. I use the LiveCode development tool and I have started working on a .sublime-syntax file for it as I'm doing the bulk of my coding in Sublime Text now. LiveCode is similar to AppleScript and so I have been pulling parts from the AppleScript package that comes with Sublime Text.

So far my package works for basic files but on more complex files syntax highlighting and handler recognition break part way through the file. I think it has to do with if/then statements but I'm not sure.

One of my public repositories is a LiveCode project. Here is a file that loses syntax highlighting and stops recognizing handlers around line 972:
github.com

looks like your syntax definition doesn't handle if...then statements where an expression follows the then on the same line, and thus doesn't require an end if

you can see this on line 36, the scope is source.livecode meta.function.positional.livecode meta.block.if.livecode meta.block.if.livecode when should just be source.livecode meta.function.positional.livecode meta.block.if.livecode

eventually, after enough of these, you end up with a large stack of scopes, that is too large for ST to use to highlight the file.

Thanks @kingkeith. I just tested with an AppleScript file and the language package that ships with Sublime Text for AppleScript has the same problem. The following AppleScript will result in two meta.block.if.applescript entries on line 13:

Thanks for the links @thatsIch. I'm familiar with the Atom package as I use Atom for developing Livecode modules (different than the traditional LiveCode language). Yesterday I pulled some of the linter code from the Atom package and put together a linter for SublimeLinter.

With help from @kingkeith there is now a LiveCode package with syntax highlighting. Here are links to the repositories. Both are still a work in progress but I'm using both in my daily development and they are working quite well.