syntax: javascript: color strings differently from major keywords

Also, remove the coloring of special single-quoted strings as they
get recolored by the subsequent general string-coloring command.

And remove the coloring of all-uppercase words, as other editors
do not color those either.
master
Benno Schulenberg 2017-12-25 15:27:08 +01:00
parent ab62d28817
commit 1b5b52d2e4
1 changed files with 1 additions and 3 deletions

View File

@ -3,15 +3,13 @@
syntax "javascript" "\.js$" syntax "javascript" "\.js$"
comment "//" comment "//"
color brightred "\<[A-Z_][0-9A-Z_]+\>"
color green "\<(async|class|const|extends|function|let|this|typeof|var|void)\>" color green "\<(async|class|const|extends|function|let|this|typeof|var|void)\>"
color brightyellow "\<(for|if|while|with|do|else|case|default|switch)\>" color brightyellow "\<(for|if|while|with|do|else|case|default|switch)\>"
color brightyellow "\<(await|export|import|try|throw|catch|new|delete)\>" color brightyellow "\<(await|export|import|try|throw|catch|new|delete)\>"
color magenta "\<(continue|break|return|yield)\>" color magenta "\<(continue|break|return|yield)\>"
color brightmagenta "'([^'\]|(\\["'abfnrtv\\]))'" "'\\(([0-3]?[0-7]{1,2}))'" "'\\x[0-9A-Fa-f]{1,2}'"
# Strings. # Strings.
color brightyellow "<[^= ]*>" ""(\\.|[^"])*"" "'(\\.|[^'])*'" "`(\\.|[^`])*`" color brightmagenta "<[^= ]*>" ""(\\.|[^"])*"" "'(\\.|[^'])*'" "`(\\.|[^`])*`"
# Comments. # Comments.
color brightblue "(^|[[:space:]])//.*" color brightblue "(^|[[:space:]])//.*"
color brightblue start="/\*" end="\*/" color brightblue start="/\*" end="\*/"