How to modify a language?


Hi. How do you go modifying a language in Atom? I’m using GrADS (Grid Analysis and Display System) a lot, therefore I would like to have a matching language style and syntax highlighting. I’m interested in modifying Ruby to fit my need. Ruby style matches the most, with some differences. For example:
while loop ends with endwhile
if loop ends with endif
Comments use *
There are also Predefined script variables such as lat, lon, time, lev

There’s also some issue with ‘’ that I overcome by using '\ ’

So basically I would like to locate the ruby language installed inside Atom, modify it using Atom and put in the modified renamed language package back into Atom for personal use.


All of Atom’s packages are open source, so they’re all available on GitHub, including language-ruby. You can just copy that grammar file if you need to.

When you have a development folder set up, you can navigate to that folder in the command line and use apm link to create a symbolic link in .atom/packages that points to your folder (this helps keep packages under personal development separate from packages downloaded through APM).


Is there something simpler? Maybe like ? Maybe a package for editing a language? Looking through all the files, I’m actually lost on what to do.


There’s no GUI, and there’s just one file that you need to copy. I’ve got a gist with annotations that explain the various parts of a grammar file, and everything boils down to a sequence of “look for this and do that” instructions.

Another option, if GrADS is only Ruby with a few special words added, is to write a grammar that matches for GrADS-specific vocabulary and then includes Ruby for the rest, as I did here.


Alright. Thanks. Now its seems more manageable for me to try this.