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: Hussam al-Homsi
Subject: Re: different syntax highlighting for Haskell
Date: Sun, 13 Sep 2020 11:16:58 -0400

On 9/13/20, Benno Schulenberg <bensberg@telfort.nl> wrote:
>
> Op 12-09-2020 om 21:36 schreef Hussam al-Homsi:
>> I discussed my improvements with Ryan, and he approves of them.
>
> Ryan?  Why and how is this syntax better than the existing one?

- It distinguishes common identifiers from reserved identifiers.
- It only highlights reserved operator symbols.
- In chars and strings, it also highlights multi-character backslashed
literals such as '\NUL' and '\o33'.
- It correctly highlights ordinary comments; avoiding stuff like -->
that are considered lexemes even though they start with --.
- It highlights pragmas.
- In addition to "udnefined", it also highlights "error" as a standard
error-causing function.

>> +## Syntax highlighting for Haskell.
>
> Please add an author line and a license line like in the old syntax.
> Each newly added syntax needs those two lines.

Are these lines really needed? I see only 5 out of 49 syntaxes have them.
I don't mind adding them. I'm just skeptical.

>> +# Errors.
>> +color brightyellow "\<(error|undefined)\>"
>
> Please do not use "bright" any more; use "light", or "bold, light".

Sure.

>> +# Ordinary comments.
>> +color brightwhite "--($|[^!#$%&*+./:<=>?@\^|~].*)"
>> +# Nested comments.
>> +color brightwhite start="\{-" end="-}"
>
> White is impossible to read on terminals with a light background.
> Use some other color.

Sure.

> Also, please provide a URL of a fairly-sized Haskell file, so that
> I can see how the two syntaxes compare.

https://raw.githubusercontent.com/haskell/cabal/master/Cabal/src/Distribution/GetOpt.hs
https://raw.githubusercontent.com/haskell/cabal/master/Cabal/src/Distribution/Parsec.hs

Hussam



reply via email to

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