[Geany-devel] Improved syntactic highlighting for Haskell

Krasimir Angelov kr.angelov at xxxxx
Wed Aug 4 13:18:19 UTC 2010

Dear Geany Hackers,

I am using Haskell for most of my work and I want to have better
syntactic highlighting for it. After I successfully compiled and
installed Geany on my computer I did some fixes in the lexer. The
patch is attached.

This is the list of problems that I fixed:

- some keywords were not listed in filetypes.haskell

- in Haskell there are some words that are keywords only in some
context. For example here:

           import Foo as Bar

  'as' is a keyword but in all other contexts it is a normal
identifier. There are some other keywords like that

- The highligthting was failing if the operators are not separated by
spaces. For example here:


  '+' is not highlighted. It worked fine only if I write 10 + 20.

- There was highlighting for data types, classes and instances but it
didn't work correctly. For example:

           class Foo x where ....

  here Foo is highlighted as class name. Unfortunately this worked
correctly only for very simple cases. For example
  this is also correct declaration:

           class Eq x => Foo x where

  but in this case Eq will be highlighted which the right class name
is Foo. Since this case could be solved only by implementing
  a full parser, I just removed this feature. It is not very useful anyway.

I hope that this patch will be added in the main repository. Let me
know if there is some special procedure for sending patches.

Best Regards,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: haskell-highlighting.diff
Type: text/x-patch
Size: 16192 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/devel/attachments/20100804/52286363/attachment.bin>

More information about the Devel mailing list