mirror of
https://github.com/scopatz/nanorc
synced 2024-11-25 09:55:40 +01:00
ed51c7c00c
As TypeScript extends JavaScript to add types, the basics of JavaScript still apply. This change will parse `.ts` files as if they are JavaScript files, providing basic highlighting support.
26 lines
1.3 KiB
Plaintext
26 lines
1.3 KiB
Plaintext
syntax "JavaScript" "\.(js|ts)$"
|
|
comment "//"
|
|
color blue "\<[-+]?([1-9][0-9]*|0[0-7]*|0x[0-9a-fA-F]+)([uU][lL]?|[lL][uU]?)?\>"
|
|
color blue "\<[-+]?([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([EePp][+-]?[0-9]+)?[fFlL]?"
|
|
color blue "\<[-+]?([0-9]+[EePp][+-]?[0-9]+)[fFlL]?"
|
|
color brightblue "[A-Za-z_][A-Za-z0-9_]*[[:space:]]*[(]|)"
|
|
color cyan "\<(break|case|catch|continue|default|delete|do|else|finally)\>"
|
|
color cyan "\<(for|function|get|if|in|instanceof|new|return|set|switch)\>"
|
|
color cyan "\<(switch|this|throw|try|typeof|var|void|while|with)\>"
|
|
color cyan "\<(null|undefined|NaN)\>"
|
|
color cyan "\<(import|as|from|export)\>"
|
|
color cyan "\<(const|let|class|extends|get|set|of|async|await|yield)\>"
|
|
color brightcyan "\<(true|false)\>"
|
|
color green "\<(Array|Boolean|Date|Enumerator|Error|Function|Math)\>"
|
|
color green "\<(Map|WeakMap|Set|WeakSet|Promise|Symbol)\>"
|
|
color green "\<(Number|Object|RegExp|String)\>"
|
|
color red "[-+/*=<>!~%?:&|]"
|
|
color magenta "/[^*]([^/]|(\\/))*[^\\]/[gim]*"
|
|
color magenta "\\[0-7][0-7]?[0-7]?|\\x[0-9a-fA-F]+|\\[bfnrt'"\?\\]"
|
|
color brightblack "//.*"
|
|
color brightblack "/\*.+\*/"
|
|
color brightwhite,cyan "TODO:?"
|
|
color yellow ""(\\.|[^"])*"|'(\\.|[^'])*'|(`|\})(\\.|[^`$]|$[^{])*(\$\{|`)"
|
|
color ,green "[[:space:]]+$"
|
|
color ,red " + +| + +"
|