2017-12-25 14:50:14 +00:00
|
|
|
## Syntax highlighting for Javascript.
|
2014-05-16 20:21:34 +00:00
|
|
|
|
2018-02-07 10:25:46 +00:00
|
|
|
syntax javascript "\.js$"
|
2016-05-25 20:13:50 +00:00
|
|
|
comment "//"
|
2014-05-16 20:21:34 +00:00
|
|
|
|
2017-12-25 14:50:14 +00:00
|
|
|
# Declarational stuff.
|
2017-12-18 19:26:21 +00:00
|
|
|
color green "\<(async|class|const|extends|function|let|this|typeof|var|void)\>"
|
2017-12-25 14:50:14 +00:00
|
|
|
# Flow control and special keywords.
|
2017-12-25 14:40:05 +00:00
|
|
|
color brightyellow "\<(do|while|if|else|switch|case|default|for|each|in|of|with)\>"
|
|
|
|
color brightyellow "\<(await|export|import|throw|try|catch|finally|new|delete)\>"
|
2017-12-25 14:50:14 +00:00
|
|
|
# "Exit" points.
|
2017-12-25 14:40:05 +00:00
|
|
|
color magenta "\<(break|continue|return|yield)\>"
|
2014-03-24 12:39:58 +00:00
|
|
|
|
2017-12-25 14:50:14 +00:00
|
|
|
# Octal/decimal and hexadecimal numbers.
|
|
|
|
color cyan "\<[0-9]+\>" "\<0x[0-9A-Fa-f]+\>"
|
|
|
|
|
2014-05-16 20:21:34 +00:00
|
|
|
# Strings.
|
2017-12-25 14:40:05 +00:00
|
|
|
color brightmagenta ""(\\.|[^"])*"" "'(\\.|[^'])*'" "`(\\.|[^`])*`"
|
2014-05-16 20:21:34 +00:00
|
|
|
# Comments.
|
2017-12-25 14:25:04 +00:00
|
|
|
color brightblue "(^|[[:space:]])//.*"
|
2014-03-24 12:39:58 +00:00
|
|
|
color brightblue start="/\*" end="\*/"
|
|
|
|
|
2014-05-16 20:21:34 +00:00
|
|
|
# Trailing whitespace.
|
2014-03-24 12:39:58 +00:00
|
|
|
color ,green "[[:space:]]+$"
|