mirror of
https://github.com/scopatz/nanorc
synced 2024-11-24 03:10:26 +01:00
48 lines
1.6 KiB
Plaintext
48 lines
1.6 KiB
Plaintext
syntax "typescript" "\.(ts)$"
|
|
header "^#!.*\/(env +)ts-node"
|
|
|
|
## Default
|
|
color white "^.+$"
|
|
|
|
## Decimal, octal and hexadecimal numbers
|
|
color yellow "\<[-+]?([1-9][0-9]*|0[0-7]*|0x[0-9a-fA-F]+)([uU][lL]?|[lL][uU]?)?\>"
|
|
|
|
## Floating point number with at least one digit before decimal point
|
|
color yellow "\<[-+]?([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([EePp][+-]?[0-9]+)?[fFlL]?"
|
|
color yellow "\<[-+]?([0-9]+[EePp][+-]?[0-9]+)[fFlL]?"
|
|
|
|
## Keywords
|
|
color green "\<(as|abstract|asserts|boolean|break|byte|case|catch)\>"
|
|
color green "\<(class|const|continue|debugger|default|delete|readonly)\>"
|
|
color green "\<(do|else|enum|export|extends|finally|final|for)\>"
|
|
color green "\<(from|function|goto|if|implements|import|instanceof)\>"
|
|
color green "\<(var|interface|int|in|is|infer|let|new|package|private)\>"
|
|
color green "\<(protected|public|return|static|super|switch)\>"
|
|
color green "\<(this|throw|try|typeof|type)\>"
|
|
color green "\<(void|while|with|yield)\>"
|
|
color green "\<(async|await)\>"
|
|
color green "\<(set|get)\>"
|
|
color green "\<(module|namespace)\>"
|
|
color green "\<(declare)\>"
|
|
|
|
## Type specifiers
|
|
color red "\<(Array|Boolean|Date|Enumerator|Error|Function)\>"
|
|
color red "\<(Number|Object|RegExp|String)\>"
|
|
color red "\<(true|false)\>"
|
|
|
|
## String
|
|
color brightyellow "L?\"(\\"|[^"])*\""
|
|
color brightyellow "L?'(\'|[^'])*'"
|
|
color brightcyan "L?`(\`|[^`])*`"
|
|
color brightwhite,blue start="\$\{" end="\}"
|
|
|
|
## Escapes
|
|
color red "\\[0-7][0-7]?[0-7]?|\\x[0-9a-fA-F]+|\\[bfnrt'"\?\\]"
|
|
|
|
## Comments
|
|
color magenta start="/\*" end="\*/"
|
|
color magenta "^\s*//.*$"
|
|
|
|
## Trailing whitespace
|
|
color ,green "[[:space:]]+$"
|