Syntax highlighting for Katepart (KDE)

Linux specific questions.
Post Reply
GrobiMonster
Posts: 4
Joined: May 27, 2005 11:10
Location: Germany

Syntax highlighting for Katepart (KDE)

Post by GrobiMonster »

Hi@all!

I want to announce a syntax highlighting file for Katepart, an editing module which is used by many KDE applications like Kate, KWrite, KDevelop, Krusader etc.

I hope it features (nearly) the complete syntax of FreeBASIC, up to the CVS version. It has been written for (and tested with) KDE 3.3.2/Kate 2.3.2, for other versions of KDE/Kate(part) I don't know if it works correctly, but I think for newer versions there should be no problem.

To install it, download this XML file (by right-clicking) and copy it either to ~/.kde/apps/katepart/syntax (maybe it has to be created first) or to /usr/share/apps/katepart/syntax (usually needs root privilegies, may differ on some distributions [e.g. /opt/...]). Then it can be selected under "Tools -> Highlight Mode -> Sources -> FreeBASIC" in Kate, for example (I'm not sure about this, because I don't know the english translation of KDE).

I'm sure there are many flaws with this syntax file, and I'm not very comfortable with XML or especially "regular expressions", so any clues for improvements, bug reports or other suggestions would be very appreciated :-)

I thought it would be a good idea to reflect the version of FreeBASIC which is considered in the hightlighting file, so the initial version was 0.15b-1.

Lastest changes (version 0.15b-2):
- fixed typo in "nokeyword"
- added missing "__" to "__DATE__"
- added "#elseif", "'$libpath" and "#libpath" to preprocessor directives
- added "ASSERTWARN" to functions
- added new functions "VALLNG", "VALUINT" and "VALULNG" from cvs
- added highlighting of "ASM" blocks (no asm keywords, just everything between "ASM" and "END ASM" or behind "ASM" for oneliners)

Greetings and have fun!

PS: If my english sounds strange, I want to apologize for it :-)
Last edited by GrobiMonster on Aug 02, 2005 9:23, edited 1 time in total.
Sterling Christensen
Posts: 142
Joined: May 27, 2005 6:13

Post by Sterling Christensen »

Your English is fine.

Thanks a lot, this is great! So far it seems to be working perfectly.
jcohen
Posts: 85
Joined: Jun 20, 2005 18:01

tried it

Post by jcohen »

tried it and it works great. It does most of the highlighting and stuff. Thanks
jofers
Posts: 1525
Joined: May 27, 2005 17:18

Post by jofers »

If it's regex, I can probably help you with any specific detail, just post the question.
GrobiMonster
Posts: 4
Joined: May 27, 2005 11:10
Location: Germany

Post by GrobiMonster »

Thanks for feedback and your offer, jofers!

I have prepared a new version of the highlighting file, which fixes a few bugs and adds new detections. To upgrade download the XML file and replace the old one.

Changes in Version 0.15b-2:
- fixed typo in "nokeyword"
- added missing "__" to "__DATE__"
- added "#elseif", "'$libpath" and "#libpath" to preprocessor directives
- added "ASSERTWARN" to functions
- added new functions "VALLNG", "VALUINT" and "VALULNG" from cvs
- added highlighting of "ASM" blocks (no asm keywords, just everything between "ASM" and "END ASM" or behind "ASM" for oneliners)

Greetings!
jcohen
Posts: 85
Joined: Jun 20, 2005 18:01

Continue to upgrade it...

Post by jcohen »

Works great! Thanks for the updates.
D.J.Peters
Posts: 8586
Joined: May 28, 2005 3:28
Contact:

Post by D.J.Peters »

Realy useful work.

If i use the shell in Kate what is the token vor the curent file in Kate?

fbc %f

don't work.

Thanx for any info.

Joshy

EDIT: The terminal emu is Konsole without any %filenam% or %directoty% from Kate Image
dumbledore
Posts: 680
Joined: May 28, 2005 1:11
Contact:

Post by dumbledore »

:( can't find it....

[edit] nvm was having connection issues
Last edited by dumbledore on Jan 15, 2006 8:31, edited 1 time in total.
Stormy
Posts: 198
Joined: May 28, 2005 17:57
Location: Germany
Contact:

Post by Stormy »

I was about to make such a syntax ruleset on my own, but I just see that you did this work already ! So thanks a lot for saving my time ! :)
Fox
Posts: 353
Joined: Aug 08, 2006 13:39
Location: Lille, France
Contact:

Post by Fox »

Hi,

The highlighting plugin is a really neat add-on. Thank you!

However, I would like to point two things:

1. Why are there two topics for this add-on (on in "projects", second in "linux")? I wasn't sure where to post my reply...

2. The following lines are misinterpretated:
FUNCTION RemoveStuff
REM Blah blah blah:
Post Reply