2017-12-25 17:50:14 +03:00
|
|
|
## Syntax highlighting for Javascript.
|
2014-05-17 00:21:34 +04:00
|
|
|
|
2018-02-07 13:25:46 +03:00
|
|
|
syntax javascript "\.js$"
|
2016-05-25 23:13:50 +03:00
|
|
|
comment "//"
|
2014-05-17 00:21:34 +04:00
|
|
|
|
2017-12-25 17:50:14 +03:00
|
|
|
# Declarational stuff.
|
2017-12-18 22:26:21 +03:00
|
|
|
color green "\<(async|class|const|extends|function|let|this|typeof|var|void)\>"
|
2017-12-25 17:50:14 +03:00
|
|
|
# Flow control and special keywords.
|
2017-12-25 17:40:05 +03: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 17:50:14 +03:00
|
|
|
# "Exit" points.
|
2017-12-25 17:40:05 +03:00
|
|
|
color magenta "\<(break|continue|return|yield)\>"
|
2014-03-24 16:39:58 +04:00
|
|
|
|
2017-12-25 17:50:14 +03:00
|
|
|
# Octal/decimal and hexadecimal numbers.
|
|
|
|
color cyan "\<[0-9]+\>" "\<0x[0-9A-Fa-f]+\>"
|
2019-10-23 11:00:55 +03:00
|
|
|
# Special values.
|
|
|
|
color cyan "\<(null|undefined)\>"
|
2017-12-25 17:50:14 +03:00
|
|
|
|
2014-05-17 00:21:34 +04:00
|
|
|
# Strings.
|
2017-12-25 17:40:05 +03:00
|
|
|
color brightmagenta ""(\\.|[^"])*"" "'(\\.|[^'])*'" "`(\\.|[^`])*`"
|
2014-05-17 00:21:34 +04:00
|
|
|
# Comments.
|
2017-12-25 17:25:04 +03:00
|
|
|
color brightblue "(^|[[:space:]])//.*"
|
2014-03-24 16:39:58 +04:00
|
|
|
color brightblue start="/\*" end="\*/"
|
|
|
|
|
2014-05-17 00:21:34 +04:00
|
|
|
# Trailing whitespace.
|
2014-03-24 16:39:58 +04:00
|
|
|
color ,green "[[:space:]]+$"
|