Commit Graph

16 Commits

Author SHA1 Message Date
Benno Schulenberg c5a0e6b60c syntax: awk: colorize escape sequences specially 2024-07-21 14:32:56 +02:00
Benno Schulenberg d7e8665782 syntax: awk: rewrite a regex more densely, and add the missing ~ operator
Also, improve the comment.
2024-07-18 16:14:25 +02:00
Benno Schulenberg 7c86c1a185 syntax: awk: add a missing "|" between "\?" and ":"
The "\?" and ":" are meant to match the ? and : in this construct:

    condition ? thenthis : otherwisethis

The missing "|" seems to have been a typo.
2024-07-18 13:02:54 +02:00
Benno Schulenberg c70e6919c2 syntaxes: mention the original author of most of the syntax files
The names of the authors were retrieved from:

  git log -p --follow  syntax/<name>.nanorc

and from:

  git log -p --follow --all --  doc/nanorc.sample

For some files the original author is unclear, or
the file is/was too small to mention an author for.
2024-06-08 12:10:25 +02:00
Benno Schulenberg 1cd92458e9 tweaks: swap two parts of specific regexes, for consistency with others
This order makes more sense to me: first the part that allows
almost everything, and then the special case.
2021-10-27 11:20:07 +02:00
Benno Schulenberg 7bd68365ec syntaxes: avoid coloring "this\" as if it were a valid string
A backslash should not be allowed inside a quoted string unless
it is used to escape another character.

This fixes https://savannah.gnu.org/bugs/?61389.

Bug existed since each of these syntaxes was introduced.

(Awk and Fortran do not know include files with names between
angled brackets, so those regexes are dropped in the bargain.)
2021-10-26 14:35:40 +02:00
Benno Schulenberg 4ac932bd21 syntaxes: drop three redundant end-of-line anchors
Also fold two regexes into one, for conciseness.
2021-10-15 10:17:28 +02:00
Benno Schulenberg 544351f3be syntaxes: replace [[:space:]] with [[:blank:]] to exclude carriage return
In many places a carriage return is not valid whitespace and should
thus not be colored as such.  In some of these places a vertical tab
or form feed is maybe valid whitespace, but it would be ugly or even
wrong to color them because they are not part of the subsequent
comment or keyword.

This fixes https://savannah.gnu.org/bugs/?60456.
2021-04-27 11:18:41 +02:00
Benno Schulenberg 227467adb9 syntaxes: remove some superfluous outer parentheses from regexes
Also, standardize some comments, condense a few regexes, add some
word-edge anchors, and remove some superfluous backslashes.
2020-04-21 12:49:29 +02:00
Benno Schulenberg fea5d7c612 syntaxes: uniformize the initial comment 2020-04-20 19:21:56 +02:00
Benno Schulenberg f2f367ba9c syntaxes: change some unneeded 'icolor' commands to 'color' commands 2019-08-17 17:01:19 +02:00
Benno Schulenberg 02eaa4ce6d tweaks: fold a few pairs of regexes into each other 2018-11-03 21:32:07 +01:00
Benno Schulenberg 18419b5e3f syntax: awk: recognize any {g,m,n,}awk script also by its shebang line
This fulfills https://savannah.gnu.org/bugs/?54516.

Suggested-by: Javier Valencia <javiervalencia80@gmail.com>
2018-08-15 20:20:22 +02:00
Benno Schulenberg 3e1fc6385b syntaxes: remove quotes from each syntax name, and color it differently
The different color will make the name stand out, as it should, instead
of looking the same as all the regex strings.
2018-02-14 17:36:50 +01:00
Benno Schulenberg bacb0f717d syntax: adjust the magic strings for the changes since file-5.10
Since file-5.10 (end of 2011), libmagic identifies a C file in most
cases as "C source" instead of as "C program".  Nano's magic strings
for some other files didn't match any more what file-5.32 currently
produces, either.  So, they have been adjusted, new ones added, and
old ones deleted.

This fixes https://savannah.gnu.org/bugs/?52445.
2017-11-19 11:24:30 +01:00
Benno Schulenberg b0ef2e2803 build: move the syntax files out of the doc/ directory
They are not documentation, they are functional elements of nano.
2016-12-30 22:05:01 +01:00