DM and Scintilla

View: New views
1 Messages — Rating Filter:   Alert me  

DM and Scintilla

by JohnSouto :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hey, I'm not much of a C++ programmer, but I'd like to see a language called DM (http://byond.com) added to Scintilla. The syntax can be weird because it can sometimes look like C++, and it can sometimes look like Python. Here's an example of some code:


//Comments are exactly the same as C++, including /* block comments */
mob //parent class, the class will inherit traits from the parent class
    player //class
      var
          //variables here in a block
          health = 0
          strength = 2
          name = "Tony"

      proc // function/method/procedure
        damage(takeDamage)
          health -= takeDamage

Strange part about DM is that you can write the exact same code in many different ways (and by exact same code, I mean same instructions with varying syntax). Here's the same code but using C++ braces and semi-colons:


mob {
    player {
      var {
          health = 0;
          strength = 2;
          name = "Tony";
      }

      proc {
        damage(takeDamage) {
          health -= takeDamage;
        }
      }
   }
}


The code above would function the same as the other block of code. Making a lexer for this isn't easy, and that's why I am asking for the help of you good people. If anyone wants to try to make a lexer for DM, you can reply here or e-mail me at soutojohn@gmail.com and I'll try to help you out as much as possible. Thanks a lot.

 -John