diff --git a/src/rcfile.c b/src/rcfile.c index 168f4140..1f3e3471 100644 --- a/src/rcfile.c +++ b/src/rcfile.c @@ -271,7 +271,7 @@ void parse_syntax(char *ptr) ptr = parse_next_word(ptr); - /* Check that there are no quotes or that they are paired. */ + /* Check that quotes around the name are either paired or absent. */ if ((*nameptr == '\x22') ^ (nameptr[strlen(nameptr) - 1] == '\x22')) { rcfile_error(N_("Unpaired quote in syntax name")); return; diff --git a/syntax/asm.nanorc b/syntax/asm.nanorc index 35859eec..e01fe2bb 100644 --- a/syntax/asm.nanorc +++ b/syntax/asm.nanorc @@ -1,6 +1,6 @@ ## Here is an example for assembler. -syntax "asm" "\.(S|s|asm)$" +syntax asm "\.(S|s|asm)$" magic "assembler source" comment "//" diff --git a/syntax/autoconf.nanorc b/syntax/autoconf.nanorc index 918de3dc..b2bdabd4 100644 --- a/syntax/autoconf.nanorc +++ b/syntax/autoconf.nanorc @@ -1,6 +1,6 @@ ## Here is an example for Autoconf. -syntax "autoconf" "\.(ac|m4)$" +syntax autoconf "\.(ac|m4)$" comment "#" # Keywords: diff --git a/syntax/awk.nanorc b/syntax/awk.nanorc index 7d3dff3b..e9f0e1cd 100644 --- a/syntax/awk.nanorc +++ b/syntax/awk.nanorc @@ -1,6 +1,6 @@ ## Here is an example for awk. -syntax "awk" "\.awk$" +syntax awk "\.awk$" magic "awk script" comment "#" diff --git a/syntax/c.nanorc b/syntax/c.nanorc index 78041ffa..b7e0ee93 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 "\.(c(c|pp|xx|\+\+)?|C)$" "\.(h(h|pp|xx)?|H)$" "\.ii?$" magic "^(C|C\+\+) (source|program)" comment "//" diff --git a/syntax/changelog.nanorc b/syntax/changelog.nanorc index b5226202..91ed5bb5 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/cmake.nanorc b/syntax/cmake.nanorc index 32633aaf..358f80b4 100644 --- a/syntax/cmake.nanorc +++ b/syntax/cmake.nanorc @@ -1,6 +1,6 @@ ## Syntax highlighting for CMake files. -syntax "cmake" "(CMakeLists\.txt|\.cmake)$" +syntax cmake "(CMakeLists\.txt|\.cmake)$" comment "#" icolor green "^[[:space:]]*[A-Z0-9_]+" diff --git a/syntax/css.nanorc b/syntax/css.nanorc index a0531cdc..27801640 100644 --- a/syntax/css.nanorc +++ b/syntax/css.nanorc @@ -1,6 +1,6 @@ ## Here is an example for CSS files. -syntax "css" "\.css$" +syntax css "\.css$" comment "/*|*/" color brightred "." diff --git a/syntax/debian.nanorc b/syntax/debian.nanorc index 10e8a321..c3b1d537 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(~|\.old|\.save)?$" "sources\.list\.d/.*\.list(~|\.old|\.save)?$" comment "#" # Coloring the deb lines, working from tail to head. First the diff --git a/syntax/default.nanorc b/syntax/default.nanorc index e9ef3036..665f54e4 100644 --- a/syntax/default.nanorc +++ b/syntax/default.nanorc @@ -1,7 +1,7 @@ ## An example of a default syntax. The default syntax is used for ## files that do not match any other syntax. -syntax "default" +syntax default comment "#" # Comments. diff --git a/syntax/elisp.nanorc b/syntax/elisp.nanorc index 296ff49d..a5f69e67 100644 --- a/syntax/elisp.nanorc +++ b/syntax/elisp.nanorc @@ -1,6 +1,6 @@ ## Here is an example for Emacs Lisp. -syntax "elisp" "\.el$" +syntax elisp "\.el$" magic "Lisp/Scheme program" comment ";" diff --git a/syntax/fortran.nanorc b/syntax/fortran.nanorc index 2a56bc78..499f95b3 100644 --- a/syntax/fortran.nanorc +++ b/syntax/fortran.nanorc @@ -1,6 +1,6 @@ ## Here is an example for Fortran 90/95. -syntax "fortran" "\.(f|f90|f95)$" +syntax fortran "\.(f|f90|f95)$" comment "!" color red "\<[0-9]+\>" diff --git a/syntax/gentoo.nanorc b/syntax/gentoo.nanorc index 330db661..937470d9 100644 --- a/syntax/gentoo.nanorc +++ b/syntax/gentoo.nanorc @@ -1,7 +1,7 @@ ## Here is an example for Gentoo ebuilds/eclasses, ## and (further down) one for Portage control files. -syntax "ebuild" "\.e(build|class|blit)$" +syntax ebuild "\.e(build|class|blit)$" comment "#" ## All the standard portage functions: @@ -48,7 +48,7 @@ color ,green "[[:space:]]+$" color ,green " " -syntax "/etc/portage" "\.(accept_keywords|env|keywords|mask|unmask|use)(/.+)?$" +syntax /etc/portage "\.(accept_keywords|env|keywords|mask|unmask|use)(/.+)?$" comment "#" ## Base text: diff --git a/syntax/go.nanorc b/syntax/go.nanorc index 6f12be2f..451fd906 100644 --- a/syntax/go.nanorc +++ b/syntax/go.nanorc @@ -1,6 +1,6 @@ ## Here is an example for Go. -syntax "go" "\.go$" +syntax go "\.go$" comment "//" # Set up a formatter since spelling is probably useless... diff --git a/syntax/groff.nanorc b/syntax/groff.nanorc index 109f9cd6..01eebec9 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 "\.m[ems]$" "\.rof" "\.tmac$" "^tmac." comment ".\"" # The argument of .ds or .nr diff --git a/syntax/guile.nanorc b/syntax/guile.nanorc index db5f786b..aafada07 100644 --- a/syntax/guile.nanorc +++ b/syntax/guile.nanorc @@ -1,6 +1,6 @@ ## Here is an example for Guile Scheme. -syntax "guile" "\.scm$" +syntax guile "\.scm$" header "^#!.*guile" comment ";" diff --git a/syntax/html.nanorc b/syntax/html.nanorc index f8da6990..05075127 100644 --- a/syntax/html.nanorc +++ b/syntax/html.nanorc @@ -1,6 +1,6 @@ ## Here is an example for HTML. -syntax "html" "\.html?$" +syntax html "\.html?$" magic "HTML document" comment "" diff --git a/syntax/java.nanorc b/syntax/java.nanorc index f0bd01dd..5bb294f4 100644 --- a/syntax/java.nanorc +++ b/syntax/java.nanorc @@ -1,6 +1,6 @@ ## Here is an example for Java. -syntax "java" "\.java$" +syntax java "\.java$" magic "Java " comment "//" diff --git a/syntax/javascript.nanorc b/syntax/javascript.nanorc index 5f667a12..1fe75516 100644 --- a/syntax/javascript.nanorc +++ b/syntax/javascript.nanorc @@ -1,6 +1,6 @@ ## Syntax highlighting for Javascript. -syntax "javascript" "\.js$" +syntax javascript "\.js$" comment "//" # Declarational stuff. diff --git a/syntax/json.nanorc b/syntax/json.nanorc index 20d50c1d..293add24 100644 --- a/syntax/json.nanorc +++ b/syntax/json.nanorc @@ -4,7 +4,7 @@ # Original author: Aapo Rantalainen # License: GPLv3 or newer -syntax "json" "\.json$" +syntax json "\.json$" # No comments are permitted in JSON. comment "" diff --git a/syntax/lua.nanorc b/syntax/lua.nanorc index 41d88405..a125d1bd 100644 --- a/syntax/lua.nanorc +++ b/syntax/lua.nanorc @@ -3,7 +3,7 @@ ## Original author: Matthew Wild ## License: GPL 3 or later -syntax "lua" "\.lua$" +syntax lua "\.lua$" magic "Lua script" comment "--" diff --git a/syntax/makefile.nanorc b/syntax/makefile.nanorc index e94a2499..33ee070f 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/man.nanorc b/syntax/man.nanorc index 00d8fe92..2c999d7d 100644 --- a/syntax/man.nanorc +++ b/syntax/man.nanorc @@ -1,6 +1,6 @@ ## Here is an example for manpages. -syntax "man" "\.[1-9]x?$" +syntax man "\.[1-9]x?$" magic "troff or preprocessor input" comment ".\"" diff --git a/syntax/mgp.nanorc b/syntax/mgp.nanorc index 1e9d718f..e460e7a8 100644 --- a/syntax/mgp.nanorc +++ b/syntax/mgp.nanorc @@ -1,6 +1,6 @@ ## Here is an example for Magicpoint presentations. -syntax "mgp" "\.mgp$" +syntax mgp "\.mgp$" header "^%include.*" comment "#" diff --git a/syntax/mutt.nanorc b/syntax/mutt.nanorc index 80fbcf46..97cfcd1e 100644 --- a/syntax/mutt.nanorc +++ b/syntax/mutt.nanorc @@ -1,6 +1,6 @@ ## Here is an example for quoted emails (under e.g. mutt). -syntax "mutt" +syntax mutt # Quoted lines. color green "^>.*" diff --git a/syntax/nanohelp.nanorc b/syntax/nanohelp.nanorc index 18f332fe..d53bb87d 100644 --- a/syntax/nanohelp.nanorc +++ b/syntax/nanohelp.nanorc @@ -1,7 +1,7 @@ ## This is meant for highlighting key combos in a nano help text. # It should not apply to any normal file, so no fileregex. -syntax "nanohelp" +syntax nanohelp # Key combos: color cyan "\^[]4-8A-Z^\_◀▶▲▼]" "[◀▶▲▼]" "(\^|M-)Space" "\?@\^_`{|}~-]|Space))|F([1-9]|1[0-6])|Ins|Del)[[:space:]]+[[:alpha:]]+[[:space:]]+(all|main|search|replace(with)?|gotoline|writeout|insert|ext(ernal)?cmd|help|spell|linter|browser|whereisfile|gotodir)([[:space:]]+#|[[:space:]]*$)" icolor brightgreen "^[[:space:]]*unbind[[:space:]]+((\^([[:alpha:]]|[]0-9\^_]|Space)|M-([[:alpha:]]|[]!"#$%&'()*+,./0-9:;<=>?@\^_`{|}~-]|Space))|F([1-9]|1[0-6])|Ins|Del)[[:space:]]+(all|main|search|replace(with)?|gotoline|writeout|insert|ext(ernal)?cmd|help|spell|linter|browser|whereisfile|gotodir)([[:space:]]+#|[[:space:]]*$)" icolor brightgreen "^[[:space:]]*extendsyntax[[:space:]]+[[:alpha:]]+[[:space:]]+(i?color|header|magic|comment|linter|formatter)[[:space:]]+.*$" -icolor brightgreen "^[[:space:]]*(linter|formatter)[[:space:]]+[[:alpha:]]+" +icolor brightgreen "^[[:space:]]*(syntax|linter|formatter)[[:space:]]+[^[:blank:]]+" icolor green "^[[:space:]]*((un)?(bind|set)|include|syntax|header|magic|comment|linter|formatter|extendsyntax)\>" # Strings diff --git a/syntax/nftables.nanorc b/syntax/nftables.nanorc index ce0ef9c4..252c047d 100644 --- a/syntax/nftables.nanorc +++ b/syntax/nftables.nanorc @@ -1,6 +1,6 @@ ## Here is an example for nftables. -syntax "nftables" "\.(nft|nftables)$" +syntax nftables "\.(nft|nftables)$" header "^#!.*(nft|nftables)" comment "#" diff --git a/syntax/objc.nanorc b/syntax/objc.nanorc index 70fb6c6e..c09c844a 100644 --- a/syntax/objc.nanorc +++ b/syntax/objc.nanorc @@ -1,6 +1,6 @@ ## Here is an example for C/C++/Obj-C. -syntax "m" "\.m$" +syntax m "\.m$" magic "Objective-C source" comment "//" diff --git a/syntax/ocaml.nanorc b/syntax/ocaml.nanorc index 73d6e065..26b20b93 100644 --- a/syntax/ocaml.nanorc +++ b/syntax/ocaml.nanorc @@ -1,6 +1,6 @@ ## Syntax highlighting for OCaml. -syntax "ocaml" "\.mli?$" +syntax ocaml "\.mli?$" magic "OCaml" comment "(*|*)" diff --git a/syntax/patch.nanorc b/syntax/patch.nanorc index 5bf2a399..8d9e0aa9 100644 --- a/syntax/patch.nanorc +++ b/syntax/patch.nanorc @@ -1,6 +1,6 @@ ## Here is an example for patch files. -syntax "patch" "\.(patch|diff|debdiff)$" +syntax patch "\.(patch|diff|debdiff)$" magic "diff output" # There is no official support for comments in patch files. comment "" diff --git a/syntax/perl.nanorc b/syntax/perl.nanorc index beb9b079..81fec835 100644 --- a/syntax/perl.nanorc +++ b/syntax/perl.nanorc @@ -1,6 +1,6 @@ ## Here is an example for Perl. -syntax "perl" "\.p[lm]$" +syntax perl "\.p[lm]$" header "^#!.*perl[-0-9._]*" magic "Perl script" comment "#" diff --git a/syntax/php.nanorc b/syntax/php.nanorc index da47144d..dead9d30 100644 --- a/syntax/php.nanorc +++ b/syntax/php.nanorc @@ -1,6 +1,6 @@ ## Here is an example for PHP. -syntax "php" "\.ph(p[23457s~]?|tml)$" +syntax php "\.ph(p[23457s~]?|tml)$" magic "PHP script" comment "//" diff --git a/syntax/po.nanorc b/syntax/po.nanorc index 526c1c2f..16441d1f 100644 --- a/syntax/po.nanorc +++ b/syntax/po.nanorc @@ -1,6 +1,6 @@ ## Colouring for PO files. -syntax "po" "\.pot?$" +syntax po "\.pot?$" comment "#" # Comments. diff --git a/syntax/postgresql.nanorc b/syntax/postgresql.nanorc index 12d4483f..d6b07ab4 100644 --- a/syntax/postgresql.nanorc +++ b/syntax/postgresql.nanorc @@ -1,6 +1,6 @@ ## Here is an example for PostgreSQL. -syntax "sql" "\.sql[2345s~]?$" +syntax sql "\.sql[2345s~]?$" comment "-- " # Functions. diff --git a/syntax/pov.nanorc b/syntax/pov.nanorc index 9746bcc3..ad1e4e7c 100644 --- a/syntax/pov.nanorc +++ b/syntax/pov.nanorc @@ -1,6 +1,6 @@ ## Here is an example for POV-Ray. -syntax "pov" "\.(pov|POV|povray|POVRAY)$" +syntax pov "\.(pov|POV|povray|POVRAY)$" comment "//" color brightcyan "^[[:space:]]*#[[:space:]]*(declare)" diff --git a/syntax/python.nanorc b/syntax/python.nanorc index ef1dfa01..4e3e75ed 100644 --- a/syntax/python.nanorc +++ b/syntax/python.nanorc @@ -1,6 +1,6 @@ ## Here is an example for Python. -syntax "python" "\.py$" +syntax python "\.py$" header "^#!.*python[-0-9._]*" magic "Python script" linter pyflakes diff --git a/syntax/ruby.nanorc b/syntax/ruby.nanorc index 7fd1e3b7..ab12cc05 100644 --- a/syntax/ruby.nanorc +++ b/syntax/ruby.nanorc @@ -1,6 +1,6 @@ ## Here is an example for Ruby. -syntax "ruby" "\.rb$" +syntax ruby "\.rb$" header "^#!.*ruby[-0-9._]*" magic "Ruby script" linter ruby -w -c diff --git a/syntax/rust.nanorc b/syntax/rust.nanorc index 0381de6d..f7e27566 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 "\.rs" comment "//" # Function definitions diff --git a/syntax/sh.nanorc b/syntax/sh.nanorc index 406e332c..5346808d 100644 --- a/syntax/sh.nanorc +++ b/syntax/sh.nanorc @@ -1,6 +1,6 @@ ## Here is an example for Bourne shell scripts. -syntax "sh" "\.sh$" +syntax sh "\.sh$" header "^#!.*((ba|da|k|pdk)?sh[-0-9_]*|openrc-run|runscript)" magic "(POSIX|Bourne-Again) shell script.*text" linter dash -n diff --git a/syntax/spec.nanorc b/syntax/spec.nanorc index 407cab17..210415e3 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$|spec\.*)" comment "#" # Main tags. diff --git a/syntax/tcl.nanorc b/syntax/tcl.nanorc index 363b53e2..2636425a 100644 --- a/syntax/tcl.nanorc +++ b/syntax/tcl.nanorc @@ -1,6 +1,6 @@ ## Syntax highlighting for Tcl files. -syntax "tcl" "\.tcl$" +syntax tcl "\.tcl$" magic "Tcl(/Tk)? script" comment "#" diff --git a/syntax/tex.nanorc b/syntax/tex.nanorc index 7dcb3836..2f483384 100644 --- a/syntax/tex.nanorc +++ b/syntax/tex.nanorc @@ -1,6 +1,6 @@ ## Here is a short example for TeX files. -syntax "tex" "\.tex$" +syntax tex "\.tex$" magic "(La)?TeX document" linter chktex -v0 -q -I comment "%" diff --git a/syntax/texinfo.nanorc b/syntax/texinfo.nanorc index 3125d254..2a6c6d56 100644 --- a/syntax/texinfo.nanorc +++ b/syntax/texinfo.nanorc @@ -1,6 +1,6 @@ ## Here is an example for Texinfo files. -syntax "texinfo" "\.texi$" +syntax texinfo "\.texi$" header "^\\input texinfo" magic "Texinfo source" comment "@c " diff --git a/syntax/xml.nanorc b/syntax/xml.nanorc index 084618ab..c13c5ebc 100644 --- a/syntax/xml.nanorc +++ b/syntax/xml.nanorc @@ -1,6 +1,6 @@ ## Here is an example for XML files. -syntax "xml" "\.([jrsx]html?|jnlp|mml|pom|rng|sgml?|svg|w[as]dl|wsdd|xjb|xml|xs(d|lt?)|xul)$" +syntax xml "\.([jrsx]html?|jnlp|mml|pom|rng|sgml?|svg|w[as]dl|wsdd|xjb|xml|xs(d|lt?)|xul)$" header "<\?xml.*version=.*\?>" magic "(XML|SGML) (sub)?document" comment ""