Clarification on making new grammars


#1

Hello all,

I am new to the Atom scene but am liking it very much so far. I am working with a language called AutoHotKeys working on a long term project. After looking for multiple hours looking for a good grammar/syntax highlighting for the language with no luck. The few I found are outdated and not supported any longer.

What I am looking for is some resources on how to create my own. There are many other post about this but all the answers point to vaguely related articles, but I cannot find a Atom grammar specific article/tutorial on the matter. If anyone could please take the time to make a semi-detailed post on the matter I’m sure than many people will find it useful.

Thanks


#2

The Atom grammar system is based heavily on TextMate, to the point where the TextMate tutorial is a very useful source of information. It’s just in JSON instead of CSON.

I’ve made a template with annotations to make it easy to remember what everything does, and several of my GitHub repos are just little languages I made for people (like this one), so you could look at those. It’s harder to see the forest for the trees when you’re looking at a behemoth like language-javascript.


#3

In addition, feel free to ping me (@wliu on Discuss, @50Wliu on GitHub) if you need help. I’ll be happy to assist.

If you need help with writing regexes, I would recommend using a site like https://regex101.com/ or http://regexr.com/ to test out your regex live.


#4

I understand creating language packages for Atom can be intimidating at first (and maybe for a little while after in my case), but my best advice would be to take a look at the existing, outdated, AutoHotKeys language packages to provide a starting point.
I’m not sure how much help I can be, but I have contributed to the development of a few other Atom language packages and have a bit of experience writing the AutoHotKey scripts that I use daily, so let me know if you’re looking for any help. You can DM me on Twitter (@bstevensondev) or message me on Discuss(@JonSn0w).
Nevertheless, I look forward to having a more up-to-date AHK language package.