Home Download Buy Blog Forum Support

Syntax injection

Syntax injection

Postby fcgrx on Fri May 17, 2013 9:16 am

I've been working on a syntax package for Sublime Text, and realize that the only real way to get the job done is to write an injection grammar (of the kind available in TextMate since v2)

Can anyone provide or point to a simple working example of an injection grammar?

I've only found examples for Textmate, and they seem to not work in Sublime Text.

A simple example might be one that sets the scope of all instances of the word "illegal" to "invalid.illegal", within files of any format? So, for example, once the injection grammar was loaded, all files (regardless of the active syntax) would see the word "illegal" highlighted?

The above example should take maybe 10 lines of code inside a .tmLanguage file... assuming injection grammars are supported in Sublime Text (I'm assuming they are since Textmate added them a year before Sublime Text 2 was released.
fcgrx
 
Posts: 23
Joined: Sat May 04, 2013 1:58 am

Re: Syntax injection

Postby fcgrx on Wed May 22, 2013 3:05 pm

(bump)
fcgrx
 
Posts: 23
Joined: Sat May 04, 2013 1:58 am


Return to Technical Support

Who is online

Users browsing this forum: No registered users and 47 guests