Atom Editor Language Definition

  • Don't know if anyone uses atom on a regular basis, but I got annoyed/bored and made a language grammar for it so we can enjoy sweet sweet syntax highlighting. Let me know if you find missing functions or @ commands or anything.

  • if you use this and notice your version goes down to 0.5, no that's not a bug. Apparently github got out of sync with my local copy. It is now back in sync. I also don't remember why I made it 1.0. So yeah, it's 0.5 now because you shouldn't code when tired.

  • I cannot get the built-in Atom system to download v0.5 after it's downloaded v1.0, even if I uninstall first.

  • 2 is the same as 0.5. Will it download 2?

  • It will download v2.0, yes. Testing now. edit Works. No longer half-hilited %qx code. Woot.

  • Really love this, but I notice that the bracket-matcher core package doesn't work when softcode is selected as the grammar. Any ideas? I really like to be able to see at a glance if my brackets are wrong, since a missing closing bracket tends to be my most common issue.

  • Or it's working now. Weird.

  • Added to the Rhost github 'Coding Resources' page.

  • Second request for // and /* ... */ to be hilited as comments.

    First request for #-1 to be hilited as a single unit, tho Mux does (very rarely) use #-2, too. %va-%vz as a single unit seems to be missing, too.

    Also a request that if there was a place for me to add my own user-defined functions, tell us where that is. If there isn't ... whhhhhyyyyyy?!

  • Sorry, haven't had much time to work on this. In response to adding. Go into where atom stores your packages (varies by platform), go into the language-mushcode package, open grammars, then mushcode.cson. That holds the grammar rules. You can add custom functions by adding to the giant list above keyword.control.js.

  • @Thenomain I released an update. 2.1.0. It introduces a couple of new things. First the good news.

    New features:

    • Supports new comment syntax: /* ... */ and //...
    • Simplified some of the regex expressions (I rewrote 5 into 2)
    • Supports Penn (and rhost? I think?) named Q register format (IE: %q<test> is highlighted)
    • #-X is highlighted
    • Added a couple of @ commands.

    Just a note, if you added your own functions, you'll need to readd those after the update. If you don't want to update but want the new highlighting, you can just copy paste from the github the new grammar regex's and delete the old ones.

    Bad news, apparently you can't do multi-line matches. It is based on textmate and textmate doesn't do that. This may not be true, but Atom has horrendous documentation on creating custom grammars and I couldn't find a grammar that did multi-line highlights. All the forum posts I read about multi-line highlights basically said 'lol brah, no.' So yeah, I assume that what @thenomain wanted with /* .. */ was multi-line matching but no go so far. Maybe one day Atom will write documentation for their grammar engine.

Log in to reply