Commit 3e1fc638 authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

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.
No related merge requests found
Showing with 21 additions and 21 deletions
+21 -21
......@@ -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;
......
## Here is an example for assembler.
syntax "asm" "\.(S|s|asm)$"
syntax asm "\.(S|s|asm)$"
magic "assembler source"
comment "//"
......
## Here is an example for Autoconf.
syntax "autoconf" "\.(ac|m4)$"
syntax autoconf "\.(ac|m4)$"
comment "#"
# Keywords:
......
## Here is an example for awk.
syntax "awk" "\.awk$"
syntax awk "\.awk$"
magic "awk script"
comment "#"
......
## 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 "//"
......
## Colouring for Changelogs.
syntax "changelog" "Change[Ll]og.*"
syntax changelog "Change[Ll]og.*"
# Author lines.
color green "^(19|20).*$"
......
## Syntax highlighting for CMake files.
syntax "cmake" "(CMakeLists\.txt|\.cmake)$"
syntax cmake "(CMakeLists\.txt|\.cmake)$"
comment "#"
icolor green "^[[:space:]]*[A-Z0-9_]+"
......
## Here is an example for CSS files.
syntax "css" "\.css$"
syntax css "\.css$"
comment "/*|*/"
color brightred "."
......
## 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
......
## 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.
......
## Here is an example for Emacs Lisp.
syntax "elisp" "\.el$"
syntax elisp "\.el$"
magic "Lisp/Scheme program"
comment ";"
......
## Here is an example for Fortran 90/95.
syntax "fortran" "\.(f|f90|f95)$"
syntax fortran "\.(f|f90|f95)$"
comment "!"
color red "\<[0-9]+\>"
......
## 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:
......
## Here is an example for Go.
syntax "go" "\.go$"
syntax go "\.go$"
comment "//"
# Set up a formatter since spelling is probably useless...
......
## 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
......
## Here is an example for Guile Scheme.
syntax "guile" "\.scm$"
syntax guile "\.scm$"
header "^#!.*guile"
comment ";"
......
## Here is an example for HTML.
syntax "html" "\.html?$"
syntax html "\.html?$"
magic "HTML document"
comment "<!--|-->"
......
## Here is an example for Java.
syntax "java" "\.java$"
syntax java "\.java$"
magic "Java "
comment "//"
......
## Syntax highlighting for Javascript.
syntax "javascript" "\.js$"
syntax javascript "\.js$"
comment "//"
# Declarational stuff.
......
......@@ -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 ""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment