- Thu May 05, 2011 5:50 pm
CodeBox looked handy and you almost can't go wrong at $5. I can see it becoming quite useful, although that forced me to look at my code management (or lack thereof) yet again ... something i've never really found a satisfactory answer to.
What really caught my attention was the mention of syntax highlighting via TextMate themes - I remembered i had picked up TextMate a while ago but had never really thought about creating a GDL language bundle for it - i guess the software available to me and my desire to do it weren't in the same place at the same time.
So this thread put it back on the radar - I'd bought CodeBox, dusted off TextMate and dug into the documentation. Turns out creating a language bundle (syntax) and theme (highlighting the syntax) is actually relatively simple at least at a basic level. All the work is in the language bundle, which relies heavily on usage of Regular Expressions. Which i know very little about, so that was another thing to dive into.
Anyway on and off over the last couple of days i've put together the beginnings of both a Language Bundle and Theme. It is by no means complete in terms of capturing the full extent of GDL commands available, nor is it 'bug' free - I am attempting to learn Regex at the same time and so there are a few issues i have to figure out around correctly recognising command boundaries. But I think its a solid start and has shown enough potential that i think i will keep going at it.
Short term goals are:
- Styling (highlighting) of all GDL command keywords only (e.g CPRISM_ mat, mat, etc only, not CPRISM_ mat, mat, etc
- Styling of comments [!]
- Collapsing text blocks according to command pairs (e.g ADDX ... DEL 1 can be collapsed to hide code between to aid navigating long nested scripts
- Collapsing blocks based on a made-up comment string ( ! <---etc ... ! >---)
Due to my complete lack of regex 'skillz' I have been forced to assume a certain way of structuring code where GDL is flexible - e.g always using spaces to separate things even though GDL ignores spaces - so Param = X is recognized as two parameters separated with an operator whereas Param=X isn't. The upside to this - for me anyway - is it forces me to be a bit more disciplined in how things are written because they don't work if they aren't. When my knowledge of Regex allows i may go back and fix these restrictions. I've also made-up some of my own 'commands' for the language to enable things like collapsing code blocks based on certain comment strings which in GDL mean nothing, it's all about TextMate at this point.
Anyway .. I've attached the TextMate 'GDL' Language Bundle & 'GDL' Theme along with a sample .gsm (its really just text) you can open in TextMate showing what commands I have semi-working so far.
I will post updates as they come, but feel free to take and do with as you wish. If anyone has any questions, feedback or can offer any guidance (like 'run away!' or 'there be dragons there'...) i'd be glad to hear it.
(7.47 KiB) Downloaded 420 times
Design Technology Manager
fjmt | francis-jones morehen thorp
iMac 27" i7 2.93Ghz | 32GB RAM | OS 10.10 | Since AC5