syntax: javascript: add some comments, and color explicit numbers too
parent
f769465284
commit
bdbd5ff0e7
|
@ -1,13 +1,19 @@
|
||||||
## Here is an example for Javascript.
|
## Syntax highlighting for Javascript.
|
||||||
|
|
||||||
syntax "javascript" "\.js$"
|
syntax "javascript" "\.js$"
|
||||||
comment "//"
|
comment "//"
|
||||||
|
|
||||||
|
# Declarational stuff.
|
||||||
color green "\<(async|class|const|extends|function|let|this|typeof|var|void)\>"
|
color green "\<(async|class|const|extends|function|let|this|typeof|var|void)\>"
|
||||||
|
# Flow control and special keywords.
|
||||||
color brightyellow "\<(do|while|if|else|switch|case|default|for|each|in|of|with)\>"
|
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)\>"
|
color brightyellow "\<(await|export|import|throw|try|catch|finally|new|delete)\>"
|
||||||
|
# "Exit" points.
|
||||||
color magenta "\<(break|continue|return|yield)\>"
|
color magenta "\<(break|continue|return|yield)\>"
|
||||||
|
|
||||||
|
# Octal/decimal and hexadecimal numbers.
|
||||||
|
color cyan "\<[0-9]+\>" "\<0x[0-9A-Fa-f]+\>"
|
||||||
|
|
||||||
# Strings.
|
# Strings.
|
||||||
color brightmagenta ""(\\.|[^"])*"" "'(\\.|[^'])*'" "`(\\.|[^`])*`"
|
color brightmagenta ""(\\.|[^"])*"" "'(\\.|[^'])*'" "`(\\.|[^`])*`"
|
||||||
# Comments.
|
# Comments.
|
||||||
|
|
Loading…
Reference in New Issue