After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 130470 - Operators should be highlighted in Haskell syntax file
Operators should be highlighted in Haskell syntax file
Status: RESOLVED FIXED
Product: gtksourceview
Classification: Platform
Component: Syntax files
unspecified
Other Linux
: Normal minor
: ---
Assigned To: Yevgen Muntyan
GTK Sourceview maintainers
Depends on: 140097
Blocks:
 
 
Reported: 2004-01-03 21:41 UTC by Anders Carlsson
Modified: 2007-05-26 21:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Haskell Syntax File (2.14 KB, text/plain)
2004-01-03 21:41 UTC, Anders Carlsson
Details
Haskell syntax file (3.65 KB, text/plain)
2004-03-06 17:06 UTC, Duncan
Details

Description Anders Carlsson 2004-01-03 21:41:00 UTC
Hello, here's a Haskell syntax file. Is it ok to add?
Comment 1 Anders Carlsson 2004-01-03 21:41:58 UTC
Created attachment 22878 [details]
Haskell Syntax File
Comment 2 Gustavo Giráldez 2004-01-04 06:30:39 UTC
Looks great.  Please commit with a changelog entry.  Thanks.
Comment 3 Duncan 2004-03-06 17:04:28 UTC
I have an 'improved' Haskell syntax file which I would like to
contribute however I'm having trouble makeing it do exactly what I
want when it comes to operators.

Improvements:

* Allow quote characters ' at end of variables and data types, without
them being matched as charcter constants, eg foo'

* Allow hash chars at end of data types, eg data Int = I# Int#

* pragma brackets {-# OPTION bla bla bla #-}

* cpp preprocessor stuff, #if, #else etc

* extra GHC keywords, 'with' and 'forall'

* allow '.' in module/type/constructor names, eg Data.FiniteMap.FM

* patterns for numbers that reflect the language report, haskell has
no long or unsigned numeric constant qualifiers
(http://haskell.org/onlinereport/lexemes.html#sect2.5)

* highlighting for reserved symbols:  => -> <- | = @ ~

* attempt at highliting for operators: eg ++,==,||,&&,>>=

This last bit doesn't entirely work right, my problem is that all
sequences of the operator characters are valid user-defined operators
except a fixed list of reserved operators. I tried using a keyword
list of reserved operators but the operators regexp got priority over
the keyword list. If I use two regexps then then sometimes the
reserved operators are classes as ordinary operators - there is no
fixed priority of one class over the other.

In the attached haskell.lang file, I've commented out the operator
class. Any suggestions would be apreciated.

In NEdit, the order in which the classes are listed determines the
priority, so with NEdit the following has the desired effect:

symbols:"::|-\\>|\\<-|=\\>|~|,":::Symbols::
operators:"\\.|:|==|/=|\\<|\\<=|\\>|\\>=|-|\\+|\\*|\\*\\*|/|!|\\^|\\$!|\\$|&|\\|\\||%|\\>\\>=|\\>\\>|=\\<\\<":::Operators::
symbols:"\\||=":::Symbols::
Comment 4 Duncan 2004-03-06 17:06:51 UTC
Created attachment 25265 [details]
Haskell syntax file
Comment 5 Gustavo Giráldez 2004-04-15 00:16:24 UTC
There's no way currently to prioritize a given pattern over another.  I've filed
bug 140097 to address this issue.  I'm marking this bug as dependant on it.
Comment 6 Duncan 2004-05-14 15:29:25 UTC
Can we get Haskell highliting into an upcomming release? We can just ignore
highliting of operators for now, everything else works ok I believe.
Comment 7 Paolo Maggi 2004-07-21 10:13:09 UTC
I'm committing the current .lang file to CVS HEAD. 
Changing the summary.

2004-07-21 Duncan <dc_junk@yahoo.co.uk>

	* gtksourceview/language-specs/haskell.lang: new file, adds support
	for Haskell language. First version of the file by Anders Carlsson
	<andersca@gnome.org>.
Comment 8 Paolo Maggi 2006-07-26 09:27:07 UTC
I'm closing this bug since there is not activity on it.
If you have some improvements to the current .lang file, please re-open this report.
Comment 9 Duncan 2006-07-26 11:21:00 UTC
Has there been any progress on bug #140097 ? If there has then I'll certainly have a go at improving the operater highlighting.