nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: different syntax highlighting for Haskell


From: Benno Schulenberg
Subject: Re: different syntax highlighting for Haskell
Date: Mon, 28 Sep 2020 11:33:19 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

Op 26-09-2020 om 19:15 schreef Hussam al-Homsi:
> Subject: [PATCH 2/2] Create new haskell.nanorc

The format of this line should be: "syntax: haskell: ...".

> Based on the Haskell 2010 Language Report.
> https://www.haskell.org/definition/haskell2010.pdf

Please add in this commit message the short list of points about
how this syntax is better than the previous one.

> +## Author: Hussam al-Homsi

This should say: "Original author".  When any changes are made later,
I don't want this line to give the impression it was all your work.

> +## License: GNU General Public License v3.0 or later

The abbreviation GPL is good enough.  It is good enough for other files,
so it will be good enough here.

> +# Error
> +color lightyellow "\<(error|undefined)\>"
> +
> +# Keyword
> +color lightmagenta "\<(as|hiding|qualified)\>"

Is there any reason why these come first?  If not, then please put
Types and Classes first, and then special Values and Keywords.

Also, the comments should be plurals.

> +# Value
> +color lightcyan "\<(False|True|Nothing|Just|Left|Right|LT|EQ|GT)\>"

These have the same color as strings further down.  I don't like that.
Better pick a different color for one of them.

> +# Ordinary comment
> +color lightwhite "--($|[^!#$%&*+./:<=>?@\^|~].*)"

As said, lightwhite is invisible on a terminal with a light background.
You didn't change it.  Also, on a terminal with a dark background, this
lightwhite is the exact same color as the plain, uncolored program text.
(Only when using an xterm, 'lightwhite' causes the white to be bolded,
so one can notice a difference.  But on my Xfce terminal there is zero
difference.)  I suggest maybe using 'lime'.

Furthermore, this regex miscolors two lines in GetOpt.hs.  For example:

  optStr    = "--" ++ opt

As is done in other syntaxes, I suggest adding "(^|\s)" at the start
of the regex, as it is probably a safe bet that any comments that do
not start at the beginning of a line have some whitespace before the --.

All in all, I like the old syntax better.  It's whole color scheme
works better on a light background, and strings are yellow (like in C)
and not this weird lightcyan.

Benno

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]