Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started by: Michael_Lee on October 02, 2011, 02:32:08 am

Title: Axe Syntax Highlighting (for Gedit)
Post by: Michael_Lee 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 (http://ourl.ca/9532) for inspiring me to write this.
Title: Re: Axe Syntax Highlighting (for Gedit)
Post by: Sorunome on October 02, 2011, 03:04:26 am
Looks nice! Is there any possibility to make it into a .8xp file?
Title: Re: Axe Syntax Highlighting (for Gedit)
Post by: Munchor on October 02, 2011, 09:47:55 am
Cool Michael, looking neat!
Title: Re: Axe Syntax Highlighting (for Gedit)
Post by: Deep Toaster 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.
Title: Re: Axe Syntax Highlighting (for Gedit)
Post by: Michael_Lee 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 (http://ourl.ca/12272), 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!