How to modify a language?


#1

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.


#2

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).


#3

Is there something simpler? Maybe like https://www.codeproject.com/Articles/703239/Tools-Notepadplusplus-Syntax-Highlighting ? Maybe a package for editing a language? Looking through all the files, I’m actually lost on what to do.


#4

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.


#5

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


#6

Hello, I am also very interested in using atom to program in GrADS (grid analysis and visualization system), I would like to know if you managed to do the grammar for GrADS, I am new and it seems a little confusing to try to create a new grammar