MU Soapbox

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Muxify
    • Mustard

    Atom Editor Language Definition

    MU Code
    4
    11
    2916
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Alzie
      Alzie last edited by

      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.

      https://atom.io/packages/language-mushcode

      Alzie's Too Long Playlist

      1 Reply Last reply Reply Quote 1
      • Alzie
        Alzie last edited by

        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.

        Alzie's Too Long Playlist

        1 Reply Last reply Reply Quote 0
        • Thenomain
          Thenomain last edited by

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

          “If you wish to make an apple pie from scratch, you must first invent the universe.”
          ― Carl Sagan, Cosmos

          1 Reply Last reply Reply Quote 0
          • Alzie
            Alzie last edited by

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

            Alzie's Too Long Playlist

            1 Reply Last reply Reply Quote 0
            • Thenomain
              Thenomain last edited by Thenomain

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

              “If you wish to make an apple pie from scratch, you must first invent the universe.”
              ― Carl Sagan, Cosmos

              1 Reply Last reply Reply Quote 0
              • W
                Wodchelle last edited by

                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.

                1 Reply Last reply Reply Quote 0
                • W
                  Wodchelle last edited by

                  Or it's working now. Weird.

                  1 Reply Last reply Reply Quote 0
                  • Rook
                    Rook last edited by

                    Added to the Rhost github 'Coding Resources' page.

                    1 Reply Last reply Reply Quote 0
                    • Thenomain
                      Thenomain last edited by

                      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?!

                      “If you wish to make an apple pie from scratch, you must first invent the universe.”
                      ― Carl Sagan, Cosmos

                      1 Reply Last reply Reply Quote 0
                      • Alzie
                        Alzie last edited by Alzie

                        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.

                        Alzie's Too Long Playlist

                        1 Reply Last reply Reply Quote 0
                        • Alzie
                          Alzie last edited by

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

                          Alzie's Too Long Playlist

                          1 Reply Last reply Reply Quote 1
                          • 1 / 1
                          • First post
                            Last post