[Top][All Lists]

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

[Nano-devel] [PATCH] syntax variables

From: Brand Huntsman
Subject: [Nano-devel] [PATCH] syntax variables
Date: Wed, 17 Jan 2018 01:32:03 -0700

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.

This also solves the EOL comment issue with #RGB colors, without quoting the 
colors. And EOL comments could even be added to color commands, without quoting 
#RGB colors.

And the EOL comment regex currently in nanorc matches to:
    color red " #"

I don't know what commands currently support EOL comments, but they can be 
added if this patch is accepted. The set/unset support in EOL comment regex 
could also be improved, if needed.

Attachment: 0001-syntax-variables.patch
Description: Text Data

reply via email to

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