nano-devel
[Top][All Lists]
Advanced

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

Re: [Nano-devel] [PATCH] syntax: go: fix bugs in number literal regex


From: Benno Schulenberg
Subject: Re: [Nano-devel] [PATCH] syntax: go: fix bugs in number literal regex
Date: Mon, 19 Feb 2018 14:22:39 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

Op 18-02-18 om 10:57 schreef Tom Levy:
> Valid code should be highlighted correctly, even if it has poor style.

Ideally, yes.  But the syntaxes sometimes skip highlighting poor style
in order to avoid highlighting some things wrongly.  For example, the
shell syntax (sh.nanorc) requires that a comment starts at the head of
a line OR is preceded by whitespace.  But a trailing comment in a shell
script is perfectly correct even when it is glued to the preceding
statement.  The syntax, however, requires the whitespace to avoid
highlighting things (strings, URLs) that have a hash embedded in them.

> Suppose I'm editing a Go file written by somebody else containing the
> following:
> 
>     prices := []float64{
>         32.50,
>         09.00,
>         10.80,
>     }

Hypothetical example.  Can you find this in the wild?

> From the perspective of a nano contributor, it helps that the syntax
> highlighting rules match the language specification. It is easier to
> check for correctness and update the rules when the language changes.
> 
> I attached a patch that updates the rules to the version I proposed
> earlier:

To humor you, I will apply that.

> Subject: [PATCH] syntax: go: revert changes to number literal regexes

Poor summary.

> There are still problems from the folding,

This says nothing about the current commit and has no place here.

Benno

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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