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) ...@@ -271,7 +271,7 @@ void parse_syntax(char *ptr)
ptr = parse_next_word(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')) { if ((*nameptr == '\x22') ^ (nameptr[strlen(nameptr) - 1] == '\x22')) {
rcfile_error(N_("Unpaired quote in syntax name")); rcfile_error(N_("Unpaired quote in syntax name"));
return; return;
......
## Here is an example for assembler. ## Here is an example for assembler.
syntax "asm" "\.(S|s|asm)$" syntax asm "\.(S|s|asm)$"
magic "assembler source" magic "assembler source"
comment "//" comment "//"
......
## Here is an example for Autoconf. ## Here is an example for Autoconf.
syntax "autoconf" "\.(ac|m4)$" syntax autoconf "\.(ac|m4)$"
comment "#" comment "#"
# Keywords: # Keywords:
......
## Here is an example for awk. ## Here is an example for awk.
syntax "awk" "\.awk$" syntax awk "\.awk$"
magic "awk script" magic "awk script"
comment "#" comment "#"
......
## Here is an example for C/C++. ## 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)" magic "^(C|C\+\+) (source|program)"
comment "//" comment "//"
......
## Colouring for Changelogs. ## Colouring for Changelogs.
syntax "changelog" "Change[Ll]og.*" syntax changelog "Change[Ll]og.*"
# Author lines. # Author lines.
color green "^(19|20).*$" color green "^(19|20).*$"
......
## Syntax highlighting for CMake files. ## Syntax highlighting for CMake files.
syntax "cmake" "(CMakeLists\.txt|\.cmake)$" syntax cmake "(CMakeLists\.txt|\.cmake)$"
comment "#" comment "#"
icolor green "^[[:space:]]*[A-Z0-9_]+" icolor green "^[[:space:]]*[A-Z0-9_]+"
......
## Here is an example for CSS files. ## Here is an example for CSS files.
syntax "css" "\.css$" syntax css "\.css$"
comment "/*|*/" comment "/*|*/"
color brightred "." color brightred "."
......
## Here is an example for apt's sources.list. ## 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 "#" comment "#"
# Coloring the deb lines, working from tail to head. First the # Coloring the deb lines, working from tail to head. First the
......
## An example of a default syntax. The default syntax is used for ## An example of a default syntax. The default syntax is used for
## files that do not match any other syntax. ## files that do not match any other syntax.
syntax "default" syntax default
comment "#" comment "#"
# Comments. # Comments.
......
## Here is an example for Emacs Lisp. ## Here is an example for Emacs Lisp.
syntax "elisp" "\.el$" syntax elisp "\.el$"
magic "Lisp/Scheme program" magic "Lisp/Scheme program"
comment ";" comment ";"
......
## Here is an example for Fortran 90/95. ## Here is an example for Fortran 90/95.
syntax "fortran" "\.(f|f90|f95)$" syntax fortran "\.(f|f90|f95)$"
comment "!" comment "!"
color red "\<[0-9]+\>" color red "\<[0-9]+\>"
......
## Here is an example for Gentoo ebuilds/eclasses, ## Here is an example for Gentoo ebuilds/eclasses,
## and (further down) one for Portage control files. ## and (further down) one for Portage control files.
syntax "ebuild" "\.e(build|class|blit)$" syntax ebuild "\.e(build|class|blit)$"
comment "#" comment "#"
## All the standard portage functions: ## All the standard portage functions:
...@@ -48,7 +48,7 @@ color ,green "[[:space:]]+$" ...@@ -48,7 +48,7 @@ color ,green "[[:space:]]+$"
color ,green " " color ,green " "
syntax "/etc/portage" "\.(accept_keywords|env|keywords|mask|unmask|use)(/.+)?$" syntax /etc/portage "\.(accept_keywords|env|keywords|mask|unmask|use)(/.+)?$"
comment "#" comment "#"
## Base text: ## Base text:
......
## Here is an example for Go. ## Here is an example for Go.
syntax "go" "\.go$" syntax go "\.go$"
comment "//" comment "//"
# Set up a formatter since spelling is probably useless... # Set up a formatter since spelling is probably useless...
......
## Here is an example for groff. ## Here is an example for groff.
syntax "groff" "\.m[ems]$" "\.rof" "\.tmac$" "^tmac." syntax groff "\.m[ems]$" "\.rof" "\.tmac$" "^tmac."
comment ".\"" comment ".\""
# The argument of .ds or .nr # The argument of .ds or .nr
......
## Here is an example for Guile Scheme. ## Here is an example for Guile Scheme.
syntax "guile" "\.scm$" syntax guile "\.scm$"
header "^#!.*guile" header "^#!.*guile"
comment ";" comment ";"
......
## Here is an example for HTML. ## Here is an example for HTML.
syntax "html" "\.html?$" syntax html "\.html?$"
magic "HTML document" magic "HTML document"
comment "<!--|-->" comment "<!--|-->"
......
## Here is an example for Java. ## Here is an example for Java.
syntax "java" "\.java$" syntax java "\.java$"
magic "Java " magic "Java "
comment "//" comment "//"
......
## Syntax highlighting for Javascript. ## Syntax highlighting for Javascript.
syntax "javascript" "\.js$" syntax javascript "\.js$"
comment "//" comment "//"
# Declarational stuff. # Declarational stuff.
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
# Original author: Aapo Rantalainen # Original author: Aapo Rantalainen
# License: GPLv3 or newer # License: GPLv3 or newer
syntax "json" "\.json$" syntax json "\.json$"
# No comments are permitted in JSON. # No comments are permitted in JSON.
comment "" 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