Home Download Buy Blog Forum Support

Help with .tmLanguage

Help with .tmLanguage

Postby SeanJM on Wed Sep 25, 2013 12:20 pm

Hi everyone, this is my first post on the forums. I am trying to create a tmLanguage file for a template language. This language is context sensitive for when something is evaluated.

Here is the pastebin for it so far: http://pastebin.com/W6w2ngJS
Here is the pastebin for a very small wtl file: http://pastebin.com/hpqNjcMS

What's the problem? Line 23 of the tmLanguage: <string>(if)(()([\s\S]*?)())(?:\s+|)({)</string>
I basically want to capture what's inside the round brackets. And if there's a %variable or a keyword operator, I want to name them.
So that if (%variable === 5) { blah blah }
so that %variable would be punctuation.attribute-name.variable.wtl
and the === would be keyword.operator.wtl

I looked around JavaScript.tmLanguage, CSS.tmLanguage and HTML.tmLanguage to get an idea of how I can accomplish this, and I think the closest I got to was:
Code: Select all
    <key>patterns</key>
    <array>
        <dict>
            <key>include</key>
            <string>#tag-stuff</string>
        </dict>
    </array>


Any help would be appreciated!

Thank you
SeanJM
 
Posts: 6
Joined: Sat Jul 14, 2012 3:03 pm

Re: Help with .tmLanguage

Postby SeanJM on Wed Sep 25, 2013 6:13 pm

SeanJM
 
Posts: 6
Joined: Sat Jul 14, 2012 3:03 pm


Return to General Discussion

Who is online

Users browsing this forum: Exabot [Bot] and 29 guests