nano-devel
[Top][All Lists]
Advanced

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

Re: [Nano-devel] [PATCH] syntax variables


From: Mike Frysinger
Subject: Re: [Nano-devel] [PATCH] syntax variables
Date: Wed, 17 Jan 2018 13:55:53 -0500

On 17 Jan 2018 01:32, Brand Huntsman wrote:
> This patch adds the ability to define variables in syntax files and 
> interpolate them in regex strings or other variables. See changes to 
> syntax/nanorc.nanorc for an example. This might also be useful in other 
> syntax files but shouldn't be abused too much because it can lead to a lot of 
> large regex strings that look small. It can also be used to make syntax files 
> more readable without using multiple color lines. It adds no runtime cost 
> other than a small startup increase to interpolate the strings.

general feedback: please make sure your commit messages are wrapped to
<80 cols.  that said, you've added all these details to the e-mail, not
to the patch itself, so make sure you put that in the git commit.  the
subject/summary you've used in the patch itself is completely missing.

> +char *interpolate_string(char *str)

all non-exported functions should be marked static

you both modify str and return it directly.  this API is a bit funky.
seems like str should be const and you should return the result.

> +                             *(p-1) = '}';

use p[-1] style instead
-mike

Attachment: signature.asc
Description: Digital signature


reply via email to

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