Author Topic: Axe Syntax Highlighting (for Gedit)  (Read 2189 times)

0 Members and 1 Guest are viewing this topic.

Offline Michael_Lee

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1019
  • Rating: +124/-9
    • View Profile
Axe Syntax Highlighting (for Gedit)
« on: October 02, 2011, 02:32:08 am »
I was poking around, and I didn't really see anything that had syntax highlighting for Axe, so I made one for Gedit for fun.  This isn't really anything spectacular, but it was a good excuse for me to practice my regex skills ;D

Add the file to the appropriate directory, and if your text file ends in .axe or if you select 'Axe Parser' from the Menubar ([View] -> [Highlight Mode] -> [Sources]), the syntax highlighting should kick in.  The colors you get should depend on what theme you currently have.

I believe this should support TokensIDE-style syntax (although it's been a long time since I've looked at TokensIDE, so I don't know how well this actually complies).


For Linux, just copy axe.lang to '~/.local/share/gtksourceview-3.0/language-specs' (or '~/.local/share/gtksourceview-2.0/language-specs').

Windows is apparently 'C:\Program Files\gedit\share\gtksourceview-2.0\language-specs\' or 'C:\Program Files\gedit\share\gtksourceview-3.0\language-specs\' (althought I can't confirm).

I don't know about Macs, sorry.


Props go to Deep Thought for inspiring me to write this.
« Last Edit: October 02, 2011, 02:32:35 am by Michael_Lee »
My website: Currently boring.

Projects:
Axe Interpreter
   > Core: Done
   > Memory: Need write code to add constants.
   > Graphics: Rewritten.  Needs to integrate sprites with constants.
   > IO: GetKey done.  Need to add mostly homescreen IO stuff.
Croquette:
   > Stomping bugs
   > Internet version: On hold until I can make my website less boring/broken.

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: Axe Syntax Highlighting (for Gedit)
« Reply #1 on: October 02, 2011, 03:04:26 am »
Looks nice! Is there any possibility to make it into a .8xp file?

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: Axe Syntax Highlighting (for Gedit)
« Reply #2 on: October 02, 2011, 09:47:55 am »
Cool Michael, looking neat!

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Axe Syntax Highlighting (for Gedit)
« Reply #3 on: October 02, 2011, 12:17:00 pm »
Looks nice! Some suggestions: define conditionals and controls structures (If, While, sub, Goto, etc.) separately from commands (Pt-Change, flipV, Copy, etc.) and define constants (10, Pic2, L4, °V, etc.) separately from data ("HELLO", [283A73B3], Data(5, 2341r), etc.) and variables (H, r3, etc.). That is the way I did it in BBify; it encourages users to understand the difference between these types, which is very important in Axe.
« Last Edit: October 02, 2011, 12:17:14 pm by Deep Thought »




Offline Michael_Lee

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1019
  • Rating: +124/-9
    • View Profile
Re: Axe Syntax Highlighting (for Gedit)
« Reply #4 on: October 02, 2011, 05:56:32 pm »
Looks nice! Is there any possibility to make it into a .8xp file?

There isn't a plugin for Gedit, per se (although I could try writing one, I suppose), but you could try using Croquette, a collaborative project between me and ephan -- just drag your text file over the exe, and out pops an 8xp (although you'll still have to compile it)


Looks nice! Some suggestions: define conditionals and controls structures (If, While, sub, Goto, etc.) separately from commands (Pt-Change, flipV, Copy, etc.) and define constants (10, Pic2, L4, °V, etc.) separately from data ("HELLO", [283A73B3], Data(5, 2341r), etc.) and variables (H, r3, etc.). That is the way I did it in BBify; it encourages users to understand the difference between these types, which is very important in Axe.
Those are good ideas, thanks!
« Last Edit: October 02, 2011, 05:56:41 pm by Michael_Lee »
My website: Currently boring.

Projects:
Axe Interpreter
   > Core: Done
   > Memory: Need write code to add constants.
   > Graphics: Rewritten.  Needs to integrate sprites with constants.
   > IO: GetKey done.  Need to add mostly homescreen IO stuff.
Croquette:
   > Stomping bugs
   > Internet version: On hold until I can make my website less boring/broken.