From cdd637d69fd9f0bfa05b017285ec20a1dfe8dc8f Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Fri, 18 May 2018 20:40:08 +0200 Subject: [PATCH] syntaxes: condense and/or correct some extension regexes --- syntax/c.nanorc | 2 +- syntax/changelog.nanorc | 2 +- syntax/debian.nanorc | 2 +- syntax/groff.nanorc | 2 +- syntax/makefile.nanorc | 2 +- syntax/rust.nanorc | 2 +- syntax/spec.nanorc | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/syntax/c.nanorc b/syntax/c.nanorc index b7e0ee93..8cb81b15 100644 --- a/syntax/c.nanorc +++ b/syntax/c.nanorc @@ -1,6 +1,6 @@ ## Here is an example for C/C++. -syntax c "\.(c(c|pp|xx|\+\+)?|C)$" "\.(h(h|pp|xx)?|H)$" "\.ii?$" +syntax c "\.([ch](pp|xx)?|C|cc|c\+\+|H|hh|ii?)$" magic "^(C|C\+\+) (source|program)" comment "//" diff --git a/syntax/changelog.nanorc b/syntax/changelog.nanorc index 91ed5bb5..cd76d1a9 100644 --- a/syntax/changelog.nanorc +++ b/syntax/changelog.nanorc @@ -1,6 +1,6 @@ ## Colouring for Changelogs. -syntax changelog "Change[Ll]og.*" +syntax changelog "Change[Ll]og[^/]*$" # Author lines. color green "^(19|20).*$" diff --git a/syntax/debian.nanorc b/syntax/debian.nanorc index c3b1d537..3ec1393a 100644 --- a/syntax/debian.nanorc +++ b/syntax/debian.nanorc @@ -1,6 +1,6 @@ ## Here is an example for apt's sources.list. -syntax sources.list "sources\.list(~|\.old|\.save)?$" "sources\.list\.d/.*\.list(~|\.old|\.save)?$" +syntax sources.list "sources\.list(\.d/.*\.list)?(~|\.old|\.save)?$" comment "#" # Coloring the deb lines, working from tail to head. First the diff --git a/syntax/groff.nanorc b/syntax/groff.nanorc index 01eebec9..00c9a964 100644 --- a/syntax/groff.nanorc +++ b/syntax/groff.nanorc @@ -1,6 +1,6 @@ ## Here is an example for groff. -syntax groff "\.m[ems]$" "\.rof" "\.tmac$" "^tmac." +syntax groff "(/tmac\.[^/]+$|\.(m[ems]|rof|tmac)$)" comment ".\"" # The argument of .ds or .nr diff --git a/syntax/makefile.nanorc b/syntax/makefile.nanorc index 33ee070f..4676473d 100644 --- a/syntax/makefile.nanorc +++ b/syntax/makefile.nanorc @@ -1,6 +1,6 @@ ## Here is an example for Makefiles. -syntax makefile "Makefile[^/]*$" "\.(make|mk)$" +syntax makefile "(Makefile[^/]*$|\.(make|mk)$)" magic "makefile script" comment "#" diff --git a/syntax/rust.nanorc b/syntax/rust.nanorc index f7e27566..aca2b9c4 100644 --- a/syntax/rust.nanorc +++ b/syntax/rust.nanorc @@ -4,7 +4,7 @@ ## NOTE: Rules are applied in order: later rules re-colorize matching text. -syntax rust "\.rs" +syntax rust "\.(rlib|rs)$" comment "//" # Function definitions diff --git a/syntax/spec.nanorc b/syntax/spec.nanorc index 210415e3..bab50420 100644 --- a/syntax/spec.nanorc +++ b/syntax/spec.nanorc @@ -1,6 +1,6 @@ ## Syntax highlighting for RPM spec files. -syntax spec "\.(spec$|spec\.*)" +syntax spec "\.spec(\.[^/]+)?$" comment "#" # Main tags.