Extend language to add colours on comments


#1

Hello everyone,

I want to write a language that will recognize my comments which are written in a certain way but that will also recognize the rest of my C code (a bit like JSDoc and JS, Atom’s Javascript language recognizes JSDoc).
Language-C standard package for Atom doesn’t recognize my comments, but I don’t want to copy/past all of C syntax. Is there a way to create a new languages that says “Do everything language-c does, but also, recognize this” ?

Also, once my grammar is written, how does my syntax-theme recognizes how to put colors on it ?

Thank you very much,
Gitlho


#2

Take a look at language-todo. It does a similar thing to what you want in that it injects special matching rules into the comments of other languages.

Your grammar will assign CSS classes to things it matches, and the syntax theme provides CSS rules for styling those classes.


#3

Thank you very much !!