Adding a note about the inherent imperfection of using regular expressions

for syntax highlighting, as suggested by Mike Frysinger.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5129 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
Benno Schulenberg 2015-03-07 21:30:36 +00:00
parent 7d77521794
commit 32e76c4386
3 changed files with 23 additions and 4 deletions

View File

@ -1,6 +1,11 @@
2015-03-07 Benno Schulenberg <bensberg@justemail.net>
* doc/man/nanorc.5, doc/texinfo/nano.texi: Add a note about the
inherent imperfection of using regular expressions for syntax
highlighting, as suggested by Mike Frysinger in bug #30962.
GNU nano 2.3.99pre2 - 2015.02.27 GNU nano 2.3.99pre2 - 2015.02.27
2015-02-25 Chris Allegretta <chrisa@asty.org> 2015-02-25 Chris Allegretta <chrisa@asty.org>
* src/rcfile.c (parse_binding): Add exception for do_toggle as * src/rcfile.c (parse_binding): Add an exception for do_toggle() as
rebinding toggles broke with r5022. rebinding toggles broke with r5022.
2015-02-21 Benno Schulenberg <bensberg@justemail.net> 2015-02-21 Benno Schulenberg <bensberg@justemail.net>
@ -46,7 +51,7 @@ GNU nano 2.3.99pre2 - 2015.02.06
2015-01-13 Chris Allegretta <chrisa@asty.org> 2015-01-13 Chris Allegretta <chrisa@asty.org>
* src/files.c (open_buffer): Check here for locking and properly * src/files.c (open_buffer): Check here for locking and properly
handle choosing to not open a file when locked instead of in handle choosing to not open a file when locked instead of in
open_file(). Fixes Savannah bug 42373 reported by Benno Schulenberg open_file(). Fixes Savannah bug 42373 reported by Benno Schulenberg.
GNU nano 2.3.99pre1 - 2015.01.06 GNU nano 2.3.99pre1 - 2015.01.06
2015-01-03 Chris Allegretta <chrisa@asty.org> 2015-01-03 Chris Allegretta <chrisa@asty.org>

View File

@ -250,7 +250,14 @@ characters as parts of words.
.SH SYNTAX HIGHLIGHTING .SH SYNTAX HIGHLIGHTING
Coloring the different syntactic elements of a file Coloring the different syntactic elements of a file
can be defined via the following commands: is done via regular expressions (see the \fBcolor\fR command below).
This is inherently imperfect, because regular expressions are not
powerful enough to fully parse a file. Nevertheless, regular
expressions can do a lot and are easy to make, so they are a
good fit for a small editor like \fBnano\fR.
.sp
A separate syntax can be defined for each kind of file
via the following commands:
.TP .TP
.BR syntax " ""\fIstr\fR"" [""\fIfileregex\fR"" ...]" .BR syntax " ""\fIstr\fR"" [""\fIfileregex\fR"" ...]"
Defines a syntax named \fIstr\fP which can be activated via the Defines a syntax named \fIstr\fP which can be activated via the

View File

@ -812,7 +812,14 @@ characters as part of a word.
@node Syntax Highlighting @node Syntax Highlighting
@section Syntax Highlighting @section Syntax Highlighting
Coloring the different syntactic elements of a file can be defined Coloring the different syntactic elements of a file
is done via regular expressions (see the @code{color} command below).
This is inherently imperfect, because regular expressions are not
powerful enough to fully parse a file. Nevertheless, regular
expressions can do a lot and are easy to make, so they are a
good fit for a small editor like @code{nano}.
A separate syntax can be defined for each kind of file
via the following commands in a nanorc file: via the following commands in a nanorc file:
@table @code @table @code