Re: [pure-lang-users] gedit pure.lang
Status: Beta
Brought to you by:
agraef
From: Albert G. <Dr....@t-...> - 2008-08-29 22:54:01
|
Eddie Rucker wrote: > On Fri, 2008-08-29 at 05:55 -0500, Eddie Rucker wrote: >> On Thu 28/08/08 6:15 PM , Albert Graef Dr....@t-... sent: >>> Cool. Mind you, there's a typo in that file: s/othrwise/otherwise/. > > Fixed. Thanks a bunch. It's in svn now. I added some remarks on usage to the top of the file, maybe you want to review and correct these. I also had to rename the file to gpure.lang, since there's already another pure.lang file for Simon's hightlight program. (That's the program I use to beautify the examples on the Pure website. Unfortunately, that program doesn't like it if the language definition file is named differently; Gedit doesn't seem to have a problem with that. Boy I hate it when programs like these use generic filename extensions like .lang or .xml, Kate is no better either.) > I noticed gedit doesn't highlight an int index when I have something > like (0..4). Kate doesn't handle it properly either (it highlights the > ".") 0. is in Kate's floating point rules and I haven't fixed rules at > all for this in gedit. I haven't figured out how to just highlight the 0 > without also highlighting the .. The following regex should properly describe Pure numbers, except for the case of a floating point number starting with a decimal point. That doesn't seem to be possible without breaking '..', since those highlighting engines don't seem to support left context; at least I couldn't figure it out. 0[xX][0-9a-fA-F]+L?|\d+L?|\d+(\.\d+)?([eE][\-\+]?\d+)?|\d+(\.\d*)?[eE][\-\+]?\d+ Unfortunately, that regex makes Kate go bonkers, don't know why, so I stick with Kate's predefined Int/Float highlighting rules for now. Maybe you have more luck with that. :) Thanks again for that gedit highlighting. I guess we support the most important non-Windows editors now. Cheers, Albert -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikinformatik.uni-mainz.de/ag |